This is just a list of interview questions I've encountered over the years. It's currently a work in progress.
Object Oriented Programming
What are the three pillars of object oriented programming?
This question can be asked in any number of ways. I've received this question as generically as, "What can you tell me about object oriented programming?" Basically what the interviewer is looking for is a list of the three following terms and their definitions.
What is a virtual funtion?
In object-oriented programming, a virtual function or virtual method is a function or method whose behaviour can be overridden within an inheriting class by a function with the same signature.
Are you familiar with any design patterns?
List the page lifecycle events, preferrably in order.
This is a pretty standard question and it's also part of the MCTS test as well. I'm not going to go into any detail here, just following the link in the question for more detail.
What is view state?
View state is the method that the ASP.NET page framework uses to preserve page and control values between round trips. When the HTML markup for the page is rendered, the current state of the page and values that must be retained during postback are serialized into base64-encoded strings. This information is then put into the view state hidden field or fields.
What are some potential issues with view state?
The ASP.NET view state imposes two performance hits whenever an ASP.NET Web page is requested.
- Serialization and deserialization of view state occurs on all page requests.
- The __VIEWSTATE hidden form field adds extra size to the Web page that the client must download.
What is session state?
What is application state?
List and define the access modifiers.
- Public access is the most permissive access level. There are no restrictions on accessing public member.
- A protected member is accessible within its class and by derived class instances.
- Internal types or members are accessible only within files in the same assembly.
- Private access is the least permissive access level. Private members are accessible only within the body of the class or the struct in which they are declared.
List the three ways a question mark, '?', can be used in C#.
Which keyword prevents a class from being inherited?
When applied to a class, the sealed modifier prevents other classes from inheriting from it.
What is an abstract class?
Use the abstract modifier in a class declaration to indicate that a class is intended only to be a base class of other classes. Members marked as abstract, or included in an abstract class, must be implemented by classes that derive from the abstract class.
How many base classes can a class in C# inherit?
A derived class can have only one direct base class. However, inheritance is transitive. If ClassC is derived from ClassB, and ClassB is derived from ClassA, ClassC inherits the members declared in ClassB and ClassA.
What are generics?
Generics introduce to the .NET Framework the concept of type parameters, which make it possible to design classes and methods that defer the specification of one or more types until the class or method is declared and instantiated by client code.
var fakeList = new List<int>();
The data type "int" in the above example is a generic.
What is a delegate?
What is the difference between the TRUNCATE and DELETE keywords?
TRUNCATE removes all rows from a table without logging the individual row deletions. TRUNCATE TABLE is similar to the DELETE statement with no WHERE clause; however, TRUNCATE TABLE is faster and uses fewer system and transaction log resources.
What are the differences among the various joins?
How is GROUP BY used?
What is the difference between HAVING and WHERE?
HAVING is kind of like a WHERE clause for GROUP BY statements.
Which is more efficient, inline sql or a stored procedure, and why?