Getting Started with ASP.NET MVC - Part 5: How to do programming with razor syntax
First Time? You can support us by signing up. It takes only 5 seconds. Click here to sign up. If you already have an account, click here to login.


Upload Image Close it
Select File

Browse by Tags · View All
BRH 48
#DOTNET 34
#ASP.NET 29
jQuery 22
ASP.NET 20
.NET 20
WPF 9
jquery interview questions 9
jquery faq 8
ASP.NET4 8

Archive · View All
February 2011 10
September 2011 4
August 2011 4
July 2011 4
May 2011 4
April 2011 4
March 2011 4
October 2011 4
June 2011 4
January 2011 4

Object Oriented Programming Concepts – Interview Questions

Oct 6 2011 11:25AM by Hima   

These Questions are common to C++, C#, Java Interviews. Questions are related to software design patterns

1. What is Loosely Coupling in Object Oriented Programming or Software Design?

System should have as many dependencies as is needed to do their job - and the dependencies should be few. 

 

2. What is the advantage of Loosely Coupling?

Loose Coupling helps in reusability, easier maintainability, and allows providing "mock" objects in expensive services as opposed to creating new objects.

 

3. What is a Concrete Object?

A concrete object is any object created with the keyword new.

 

4. What is Dependency Injection (DI) in Object Oriented Programming (OOP)?

This is also known as “Inversion of Control" (IoC). It refers to the process of supplying an external dependency in order to reduce more dependencies to a software component. This is implemented to achieve loosely coupling. Object's dependencies should be on interfaces but not on concrete objects.

 

5. What are the term SOLID stands in OOPs? Explain about it?

SOLID stands for Single Responsibility Open Closed Liskov Substitution Interface Segregation Dependency Inversion .

SOLID Principles of Object-Oriented Design, as introduced by Robert C Martin.

Single Responsibility Principle

A class (or method) should only have one reason to change.

Open Closed Principle

Extending a class shouldn't require modification of that class.

Liskov Substitution Principle

Derived classes must be substitutable for their base classes.

Interface Segregation Principle

Make fine grained interfaces that are client specific.

Dependency Inversion Principle

Program to the interface, not the implementation.

6. What is Single Responsibility Principle of a class?

There should never be more than one reason for a class to change. The classes should exist for one purpose only.

 

7. What are open closed principles of class?

Open Close Principle strictly says that the Software objects like classes, modules and functions should be open for extension but closed for modifications. The design and writing of the code should be done in a way such that new functionality should be added with minimum changes in the existing code. In other words the design should be done in a way to allow the adding of new functionality as new classes, keeping as much as possible existing code unchanged.

 

8. What is Liskov Substitution Principle?

Likov's Substitution Principle states that if a program module is using a Base class, then the reference to the Base class can be replaced with a Derived class without affecting the functionality of the program module. In other words derived types must be completely substitutable for their base types. For ex: If a person knows how to drive a car then he should be able to drive any type of car.

 

9. What is Interface Segregation Principle?

The Interface Segregation Principle states that clients should not be forced to implement interfaces they don't use. Instead of one fat interface many small interfaces are preferred based on groups of methods, each one serving one submodule.

 

10. What is Dependency Inversion Principle?

According to this principle the way of designing a class structure is to start from high level modules to the low level modules: High Level Classes --> Abstraction Layer --> Low Level Classes

  • High-level modules should not depend on low-level modules. Both should depend on abstractions.
  • Abstractions should not depend on details. Details should depend on abstractions.

Tags: #DOTNET, DOTNET, #ASP.NET, ASP.NET, MultiThreading, #C#, #.NET, #MultiThreading,


Hima
26 · 7% · 1504
1
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

1  Comments  

  • hey, ur post was very helpful to me. keep doing the good work. thank you very much sis Tharindu Vishwanath from Sri Lanka

    commented on May 10 2011 10:57AM  .  Report Abuse This post is not formatted correctly
    tharindu
    2298 · 0% · 2

Your Comment


Sign Up or Login to post a comment.

"Object Oriented Programming Concepts – Interview Questions" rated 5 out of 5 by 1 readers
Object Oriented Programming Concepts – Interview Questions , 5.0 out of 5 based on 1 ratings
    Copyright © Beyondrelational.com Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising