Top 50 Technical and Non-Technical Interview Questions in .NET

We have compiled most frequently asked .NET Interview Questions which will help you with different expertise levels.

Top 50 Technical and Non-Technical Interview Questions in .NET

Note: This is a challenge. You should get at least get 15 questions from given top 50 most asked questions.

Question 1.
Can you explain the architecture of your current project?

Note: I think 40% of the .NET interview starts with this question. Below is a sample answer and will differ from 
          developer to developer.

My current architecture is a three-layer architecture with Ul (User Interface) made in ASP.NET MVC (Model/View/Controller), middle-tier having the business logic and the data access layer created by using Entity Framework code first. It follows MVC architecture and uses Unity Dl (Dependency Injection) to decouple the layers.

We also have a common library that is shared in our project and for the external customer, we have exposed a WCF (Windows Communication Foundation) service.

Question 2.
What role did you play in your project and company?
Answer:

Note: Do not answer in one line like I am developer, project manager, talk end-to-end. This will help the 
           interviewer to understand much better about you completely. Below is a simple sample answer to
           how professionals reply.

My role was end-to-end. I was involved right from the requirement phase where I was a member of the requirement gathering team and helped the team in requirement documentation.

I was also actively involved in the design phase to conceptualize the technical aspect of the project.

My main role was in the development/coding phase where I was involved in coding and unit testing.

I also played an important role in acceptance testing where I helped the team to fix defects and issues raised by testers and end-users.

I am also partly involved with the COE group where I help developers in the company to upgrade to new technologies.

Note: If you are a part of other activities like training, quality, pre-sales team, estimation, etc., 
          speak about the same during the interview. Companies lookout for multitasking capabilities 
          rather than specific capabilities.

Question 3.
What is your salary expectation?
Answer:
This is a very complex question at the end of the book we have a complete Chapter it last current .NET developer salary packages and some tips for negotiation will be discussed.

One golden tip for interviewees, if you really want the job and you do not want salary to be a hurdle, add the word “NEGOTIABLE” after the salary amount. Make the interviewer understand I am ready for a small sacrifice.

Question 4.
Why do you want to leave your current organization?
Answer:
First and foremost avoid the below three reasons:

1. Avoid saying negative about your previous organization because that would send a wrong message to the interviewer. Do not create a pessimistic image before the interviewer. On the contrary, if you start with positive things like: “The current company has no issues and I am extremely happy with the current environment but it’s more of a personal problem, etc, etc…” that would create a very strong and positive image of yours.

2. Avoid complaining about your current work profile like “It’s a maintenance project, it’s in 1.1 version and I am not learning anything new, etc.” It’s very much possible that the interviewer has a maintenance job. So in such kinds of situations, I have seen the interviewer rejecting people irrespective even though if they have performed well in the technical rounds.

3. Avoid saying you are jumping only because of salary. Some of the interviewers do not like people who just look at monetary benefits. When you are asked about salary expectations these things could be better discussed during that conversation. Do not make it explicit during the interview. Bet nobody likes greedy professionals^

Below are some of the good reasons for which the interviewer probably would not question back:

  • For better prospects and growth.
  • The office is far away. I spend a lot of time traveling and would like to minimize my traveling time.
  • They are telling me to relocate but in my current situation, it’s not viable.
  • I am a developer but due to project requirements, I am in a testing role and so want to switch.
  • The project is getting closed and the company does not have projects.
  • The company is not paying its salary on time.

Question 5.
How much do you rate yourself between 1 and 10?
Answer:

Note:  This question can be in different forms like, ‘How much do you rate yourself in ASP.NET?’ 
           ‘How much do you rate yourself in SQL (Structured Query Language) Server?’ etc.

The answer to this question is again very subjective but some important tricks are given here to avoid any traps.

  • Even if you are really good at that topic do not rate yourself 10 or 9. It just shows that you are overconfident. If you are extremely goodput 8. Let your technical answers talk about your rating.
  • If you know the topic average, rate yourself 5.
  • If you are bad at the topic or have never done anything do not put any rating. Probably it’s better to say you have not worked rather than trying to attempt and create more problems.

Question 6.
Can you speak about yourself?
Answer:

Note: Many people become emotional here and talk personally. Most of the time interviewer is expecting
           to talk about your role you played, technological skills, and which field you want to selected and grow. 
           Below is a sample answer and it varies from person to person.

I have 8 years of experience. In the first 4 years, I worked as a developer in Microsoft technologies. For the next 2 years, I worked as a team leader guiding the team, helping them resolve problems. Currently, I have been working on Microsoft server products like SharePoint, BizTalk. My main technical skills revolve around C#, Visual studio, SQL Sen/er, .NET (Network Enabled Technology), and ASP.NET.

I would like to see myself as a technical leader in further coming times.

Note: The last sentence is very important, let the interviewer know where you want to see yourself in the later stages.

Question 7.
How can we improve the performance of .NET?
Answer:

Note:  This question can have various other forms like, ‘How can we improve performance of ASP.NET?’ 
           ‘How can we improve performance of SQL Server?’, etc. Remember 5 best points are given for each category. 
            You can pick your favorite ones. But whatever you pick, should be commonly used by everyone.

Below are some common points you can remember. The list is endless but I do not want to make it long so that you can remember important ones.

  • Use string builder for concatenation rather than string when concatenation data is huge.
  • Avoid boxing/unboxing by using generics.
  • Avoid inline SQL; queries use stored procedures.
  • Choose your indexes (clustered and non-clustered) properly.
  • Use Caching for data that will not change frequently.
  • In ASP.NET use output cache directive for page-level caching.

Question 8.
What is the difference between .NET 1.X, 2.0,3.0, 3.5,4.0 and 4.5?
Answer:
Below is the list of top differences between the framework versions. Please remember the list is much bigger than what I have put down. But for interview perspective, I have taken the top 5 in each one of them so that we can remember the important ones.

.NET 2.0 .NET 3.0 .NET 3.5 .NET 4.0 .NET 4.5
Support for 64-bit application. Generics SQL cache dependency Master pages Membership and roles WCF

WPF (Windows Presentation Foundation) WWF (Windows Workflow) WCS (Windows Card Spale) (card space)

LI NQ Ajax inbuilt ADO (ActiveX Data Objects)

Entity framework ADO data services Multi­targeting

MEF (Managed Extensibility Framework) Parallel computing DLR (Dynamic Language Run­time) dynamic Code contract language runtime Lazy initialization Background GC (Garbage Collection) Async / Await ZIP

Compression

Profile

optimization

Regex timeout

Background

GC

Question 9.
What is IL Code, JIT, CLR, CTS, CLS, and CAS?
Answer:

  • IL (Intermediate Language) Code is a partially compiled code.
  • JIT (Just-in-time) compiler compiles IL Code to machine language.
  • CLR (Common Language Runtime) is the heart of the .NET Framework and it does four primary tasks: Garbage collection, CAS (Code Access Security), CV (Code Verification), and IL to Native translation.
  • CTS (Common Types System) ensures that data types defined in two different languages get compiled to a common data type.
  • CLS is a specification or set of rules or guidelines. When any .NET programming language adheres to this set of rules it can be consumed by any language following .NET specifications.
  • CAS is the part of the .NET security model which determines what kind of rights does a .NET code has.
Note:  Do have a look at the video What are IL code, CLR, CTS, CLS, and JIT? There are two parts 
           to this video in the first part we have discussed the theory, and in the next part, we have discussed 
           practically how these terminologies come to the .NET environment.

Question 10.
What is a garbage collector?
Answer:
The garbage collector is a feature of CLR which cleans unused managed objects (it does not clean unmanaged objects) and reclaims memory. It’s a background thread that runs continuously and at specific intervals checks for unused objects whose memory can be claimed.

Note: Do have a look at the video ‘What are Garbage collector, Gen 0, 1 and 2?

Question 11.
What is GAC?
Answer:
GAC (Global Assembly Cache) is a machine-wide CLI assembly component where all shared .NET assembly resides. GAC is used when assemblies have to be shared among several applications which are installed on the same computer.

Note: Do have a look at two classic videos shipped in the DVD which show how the garbage collector works internally.
          What are Garbage Collector, Gen 0, 1, and 2?
          What are IDisposable interface and finalize dispose patterns in GC (Garbage collector)?

Question 11.
What are stacks, heaps, value types, reference types, boxing, and unboxing?
Answer:
Stack and heap are memory types in an application. Stack memory stores data types like int, double, Boolean, etc., while heaping stores data types like string and objects.

For instance when the below code runs the first two variables, i.e., “i” and “y” are stored in a stack and the last variable “o” is stored in heap.

void MyFunction( )
{
int i = 1; // This is stored in stack,
int y = i; // This is stored in stack,
object o = null; // This is stored in heap.
}
// after this end the stack variable memory space is reclaimed while // the heap memory is reclaimed later by the garbage collector.

Value types contain actual data while reference types contain pointers and the pointers point to the actual data.

Value types are stored on the stack while reference types are stored on the heap. Value types are your normal data types like int, bool, double and reference types are all objects.

When a value type is moved to a reference type it’s called boxing. The vice-versa is termed unboxing.

Note: Watch in-depth videos given in the CD ‘What are stack, Heap, Value types and Reference types, 
          and What are boxing and unboxing?. These examples explain the step-by-step concept of boxing,
         unboxing, value, reference types, stack, and heap.

Question 12.
How are exceptions handled in .NET?
Answer:
Exceptions are handled by the “System. Exception” base class. If you want to raise an error from the source you need to create the Exception object with the below code snippet.

throw new Exception(“Customer code cannot be more than 10”);

Once the exception is raised if you want to catch the same you need to use the ‘try-catch block as shown below.

try
{
// This section will have the code which
// which can throw exceptions.
}
catch(Exception e)
{
// Handle what you want to
// do with the exception
label.text = e.Message;
}

Question 13.
What are the different types of collections in .NET?
Answer:
There are five important collections in .NET Arrays, Lists, Hashtable, Stacks, and Queues.

Question 14.
What are generics?
Answer:
Generics help to separate logic and data type to increase reusability. In other words, you can create a class whose data type can be defined on run-time.

Note: Watch the video shipped in the DVD ‘What are generics?’

Question 15.
Explain abstraction, encapsulation, inheritance, and polymorphism.
Answer:
Abstraction: Abstraction means show only what is necessary. Example color is abstracted to RGB (Red, Green, Blue). By just making the combination of these three colors we can achieve any color in the world. It is a model of the real world.

Encapsulation: It is a process of hiding all the complex processing from the outside world and makes your objects simple.

Inheritance: This concept helps to define the parent-child relationship between classes.

Polymorphism: It’s a property of an object to act differently under different conditions. For instance, a simple user object depending on conditions can act as an admin or as a data entry object.

Note: Watch the video. ‘Can you define OOP and the four principles of OOP?’ for a more detailed explanation.

Question 16.
How is an abstract class different from an interface?

Abstract class Interface
Implementation Some methods in abstract classes can have implementation. All methods, functions, properties in interfaces are empty. They are simple signatures.
Scenario Abstract classes are used when we want to share a common functionality in parent-child relationships. Interfaces are used to define contracts, enforce standardization, decoupling, and dynamic polymorphism.
Variable declaration We can declare variables.
Inheritance vs Implementation Abstract classes are inherited. In the interface, we cannot declare variables. Interfaces are implemented.
Note: Refer to the below three videos to understand abstract classes and interfaces in depth. 
What is an abstract class?
Define interface and what is the difference between abstract and interface.
Define interface and difference between abstract and interface? - Part 2

Question 17.
What are the different types of polymorphism?
Answer:
There are two types of polymorphism: static and dynamic. Many people also call them runtime or compile-time polymorphism. Static polymorphism is implemented by overloading while dynamic polymorphism is implemented by overriding and virtual keywords.

Note:   Do watch the video “What is Polymorphism, overloading, overriding and virtual?” and get a 
           demonstration of how to implement polymorphism in . NET. The video also talks about two 
           different types of polymorphism in brief.

Question 18.
How does delegate differ from an event?
Answer:
Delegate is an abstract strong pointer to a function or method while events are a higher level of encapsulation over delegates. Events use delegates internally.

They differ because of the following reasons:

  • Actually, events use delegates internally. They add an extra layer to the delegates, thus forming the publisher and subscriber model.
  • As delegates function as pointers, they can move across any clients. So any of the clients can add or remove events, which can be confusing. But events give the extra protection/encapsulation by adding the layer and make it a publisher and subscriber model.

Just imagine one of your clients doing this

c.XyzCallback = null

This will reset all your delegates to nothing and you have to keep searching where the error is.

Note: Do watch the below three videos given in the CD to get more insight on delegates and events.
         What problem does delegate Solve? - Part 1 
         What is a multicast delegate? - Part 2
         What are events and what’s the difference between delegates and events? - Part 3

Question 19.
What are different access modifiers?
Answer:
There are 5 access modifiers. Access modifiers define the scope for members.

  • Private: Accessible only within the class.
  • Protected: Accessible within the class and in derived classes.
  • Friend (internal in C#): Accessible anywhere within the current project.
  • Protected friend (protected internal in C#): Accessible with a current project and derived classes.
  • Public: Accessible everywhere.

Top 50 Technical and Non-Technical Questions Interview Questions in .NET chapter 1 img 1

Note: Watch the video.
        Can you explain encapsulation and abstraction? Where we have explained how encapsulation can be 
        implemented using access modifiers?

Question 20.
Explain connection, command, data reader, and dataset in ADO.NET.
Answer:

  • Connection: This object creates a connection to the database. If you want to do any operation on the database you have to first create a connection object.
  • Command: This object helps us to execute SQL queries against the database. Using command objects we can execute select, insert, update and delete SQL commands.
  • Data Reader: This provides a record set that can be browsed only in the forward direction. It can only be read but not updated. Data reader is good for a large number of records where you want to just browse quickly and display it.
  • Dataset Object: This provides a recordset that can be read back and in the forward direction. The record set can also be updated. Dataset is like an in-memory database with tables, rows, and fields.
  • Data Adapter: This object acts as a bridge between database and dataset. It helps to load the dataset object.

Question 21.
How does “Dataset” differ from a “Data Reader”?
Answer:

  • “Dataset” is a disconnected architecture, while “Data Reader” has live connection while reading data. If we want to cache data and pass to a different tier, “Dataset” forms the best choice and it has decent XML (extensible Markup Language) support.
  • When an application needs to access data from more than one table “Dataset” forms the best choice.
  • If we need to move back while reading records, “data reader” does not support this functionality.
  • However, one of the biggest drawbacks of Dataset is speed. As “Dataset” carries, considerable overhead because of relations, multiple tables, etc., speed is slower than “Data Reader”. Use “Data Reader” when you want to quickly read and display records on a screen.
  • Dataset can manipulate data while data reader is only for reading purposes.

Question 22.
How is the ASP.NET page life cycle executed?
Answer:
ASRNET is an open-source server-side Web application framework designed for Web development to produce dynamic Web pages.
Following is the sequence in which the events occur:

  • Init
  • Load
  • Validate
  • Event
  • Render

Remember the word SILVER: SI (Init) L ( Load) V ( Validate) E ( Event) R ( Render).

Note: Watch the complete video. Can you explain ASP.NET application and Page life cycle?

Question 23.
What are HTTP Handlers and HTTP Modules and differences between them?
Answer:
Handlers and modules help you inject pre-processing logic before the ARNET request reaches the Website.
For instance, before your request reaches any resource you would like to check if the user has been authenticated or not.
HTTP Handler is an extension-based processor. In other words, the pre-processing logic is invoked depending on file extensions.
HTTP Module is an event-based processor. In other words, ASP.NET emits a lot of events like begin request, AuthenticateRequest, etc., we can write the logic in those events using HTTP Module.

Note: Watch the complete video. Can you explain the ASP.net application and Page life cycle?
          Where we have explained handlers and modules in depth.

Question 24.
What are the different types of validation controls in ASP.NET?
Answer:
There are six main types of validation controls:

  • RequiredFieldValidator: It checks whether the control has any value. It is used when you want the control should not to be empty.
  • RangeValidator: It checks if the value in validated control is in a specific range. Example: TxtCustomerCode should not be more than eight in length.
  • CompareValidator: It checks that the value in control should match some specific value. Example: Textbox TxtPie should be equal to 3.14.
  • RegularExpressionValidator: When we use the control, the value should match with a specific regular expression.
  • CustomValidator: It is used to define user-defined validation.
  • Validation Summary: It displays a summary of all current validation errors on an ASP.NET page.

Question 25.
How is ‘Server. Transfer’ different from ‘Response. Redirect’?
Answer:
“Response. Redirect” and “Server. Transfer” helps to transfer users from one page to another page while executing the page.
The main difference between them is who does the transfer. In “Response. Redirect” the transfer is done by the browser while in “Server. Transfer” it’s done by the server.
In “Server. Transfer” following the sequence of how transfer happens:

Top 50 Technical and Non-Technical Questions Interview Questions in .NET chapter 1 img 2

1. User sends a request to an ASP.NET page. In Figure 1.3 the request is sent to “Webforml” and we would like to navigate to “Webform2”.

2. Server starts executing “Webforml” and the life cycle of the page starts. But before the complete life cycle of the page is completed “Server. transfer” happens to “Webform2”.

3. “Webform2” page object is created, the full page life cycle is executed and output HTML response is then sent to the browser.

Top 50 Technical and Non-Technical Questions Interview Questions in .NET chapter 1 img 3

In “Response. Redirect” the following is the sequence of events for navigation:

1. Client(browser) sends a request for a page. In figure 1.4 the request is sent to “WebForml ” and we would like to navigate to “Webform2”.

2. Life cycle of “Webforml” starts executing. But in between of the life cycle “Response. Redirect” happens.

3. Now rather than the server does a redirect process it sends a HTTP (HyperText Transfer Protocol) 302 command (a common way of performing URL redirection) to the browser. This command tells the browser that he has to initiate a GET request to “Webform2.aspx” page.

4. Browser interprets the 302 commands and sends a GET request for “Webform2.aspx”.

Top 50 Technical and Non-Technical Questions Interview Questions in .NET chapter 1 img 4

Question 26.
When to use “Server. Transfer” and when to use “Response. Redirect”?
Answer:
Use “Server. Transfer” when you want to navigate pages which reside on the same server as shown in Figure 1.5, use “Response. Redirect” when you want to navigate between pages which resides on different server and domain.

Top 50 Technical and Non-Technical Questions Interview Questions in .NET chapter 1 img 5

Question 27.
What is the importance of the “preserveForm” flag in “Server. Transfer”?
Answer:

Note: This question can also be asked as What is the difference between “Server. Transfer(true)” and
         “Server. Transfer(false)?”.

“Server. Transfer” helps to redirect from one page to another page. If you wish to pass query string and form data of the first page to the target page during this redirection you need to set “preserveForm” to “true” as shown in the below code.

Server. Transfer(“Webform2.aspx", true);

By default, the value of “preserveForm” is “True”.

Response.Redirect(URL, True ) Vs Response.Redirect(URL, False )

Top 50 Technical and Non-Technical Questions Interview Questions in .NET chapter 1 img 6

Response.Redirect(URL, False ): Client is redirected to a new page and the current page on the server will keep processing ahead.
Response.Redirect(URL, True ): Client is redirected to a new page but the processing of the current page is aborted as shown in figure 1.6.

Question 28.
Can you explain windows, forms, and passport authentication?
Answer:
There are three major ways of doing authentication and authorization:

  • Windows: In this mode, the users are stored in windows, local user groups.
  • Forms: In this mode, we create a login screen and use the forms authentication class for validations. It’s a ticket-based authentication.
  • Passport: In this mode, the users are validated from Microsoft sites like Hotmail, devhood, MSN (Microsoft Network), etc., the ticket is generated and that ticket can be used in the authentication and authorization process in your Web application.
Note: Watch the six videos which talk in-depth about the above concepts. It is possible that the 
         interviewer can get into details.
         What are Authentication, Authorization, Principal, and Identity objects? Part-1
         ASP.NET Authentication and Authorization Video series Part-2
         ASP.NET Authentication and Authorization Video series Part-3
         ASP.NET Authentication and Authorization Video series Part-4
         ASP.NET Authentication and Authorization Video series Part-5
         ASP.NET Authentication and Authorization Video series Part-6

Question 29.
What is the difference between Grid view, Data list, and Repeater?
Answer:
Grid view and data grid by default display all the data in tabular format, i.e., in columns and rows. The developer has no control to change the table data display of Datagrid.

Data list also displays data in a table but gives some flexibility in terms of displaying data row-wise and column-wise using the repeat direction property.

Repeater control is highly customizable. It does not display data in the table by default. So you can customize from scratch the way you want to display data.

Question 30.
Which are the various modes of storing ASP.NET session?
Answer:

  • InProc: In this mode, the session, the state is stored in the memory space of the Aspnet_wp.exe process. This is the default setting. If the IIS (Internet Information Services) reboots or the Web application restarts then the session state is lost.
  • StateServer: In this mode session state is serialized and stored in a separate process (Aspnet_state.exe); therefore, the state can be stored on a separate computer (a state server).
  • SQL Server: In this mode session, the state is serialized and stored in a SQL Server database. Session state can be specified in <sessionState> element of application configuration file. Using State Server and SQL Server session state can be shared across Web Farms but note this comes at speed cost as ASP.NET needs to be serializes and deserializes data over network repeatedly.

Question 31.
How can we do caching in ASP.NET?
Answer:
There are two ways of caching: output cache directive and using the cache objects.

Question 32.
What is ViewState?
Answer:
ViewState is a built-in structure for automatically retaining values amongst the multiple requests for the same page. The ViewState is internally maintained as a hidden field on the page but is hashed, providing greater security than developer-implemented hidden fields do.

Question 33.
What are indexes, and what is the difference between clustered and non-clustered?
Answer:
The index makes your search faster by using B-Tree (a tree data structure defined recursively as a collection of nodes) structure logic. Clustered and non-clustered indexes are two types of indexes. In a clustered index, the leaf node points to the actual data while in a non-clustered index the leaf node uses the clustered index to locate data.

Question 34.
How is stored procedure different from functions?
Answer:

  • The function cannot affect the state of the database which means we cannot perform CRUD (Create Read Update Delete) operation on the database. Stored Procedures can affect the state of the database by using CRUD operations.
  • Stored Procedure can return zero or n values whereas Function can return only one value.
  • Stored Procedure can have input, output parameters for it whereas functions can have only input parameters.
  • The function can be called from Stored Procedure whereas Stored Procedure cannot be called from Function.

Question 35.
What’s the difference between Web services and remoting?
Answer:
Remoting works only when both the ends, i.e., server and client are in .NET technologies. Web services are useful when the client is not .NET like Java, etc.

Question 36.
What’s the difference between WCF and Web services?
Answer:

  • WCF (Windows Communication Foundation) services can be hosted in multiple protocols like HTTP (HyperText Transfer Protocol), TCP (Transmission Control Protocol), etc. Web services can only be hosted on HTTP protocol.
  • WCF has COM+ so you can call two different WCF services in a transaction, we cannot call two different Web services in one transaction.
  • WCF integrates with MSMQ (Microsoft Message Queuing) easily, but for Web services, we will need to write code to communicate with the MSMQ pool.

In simple words below equations show the difference.

WCF = Web services + Remoting + MSMQ + COM+
Web service = WCF- (Remoting + MSMQ + COM+ )
Note:  Do watch the below four videos of WCF to get more insight into WCF
          What are the basic steps to create a WCF service (Part 1, Creating the Service)?
          What are the basic steps to create a WCF service (Part 2, Consuming the Service)?
          What are endpoints, addresses, contracts, and bindings?
          What are various ways of hosting WCF services?

Question 37.
What are endpoint, contract, address, and bindings?
Answer:
When we want to host any WCF service we need to provide where to host it, how to host it, and what to host.

  • Contract (What): A contract is an agreement between two or more parties. It defines the protocol of how clients should communicate with your service. Technically, it describes parameters and returns values for a method.
  • Address (Where): An Address indicates where we can find this service. The address is a URL (Uniform Resource Locator), which points to the location of the service.
  • Binding (How): Bindings determine how the service can be accessed. It determines how communications are done. For instance, you expose your service, which can be accessed using
    SOAP (Simple Object Access Protocol) over HTTP (hypertext Transfer Protocol) or Binary over TCP (Transmission Control Protocol). So for each of these communications mediums, two bindings will be created.
  • End point: It is the combination of contract, address, and binding. In WCF Web.config file we can specify end point, address, binding and contract as shown in the below code snippet.
<endpoint address=”HTTP: //www. questpond.com” binding=”wsHTTPBinding” contract=”WcfService3.1Service 1 ">
Note:  Do watch the below four videos of WCF to get more insight into WCF.
           What are the basic steps to create a WCF service (Part 1, Creating the Service)?
           What are the basic steps to create a WCF service (Part 2, Consuming the Service)?
           What are endpoints, addresses, contracts, and bindings?
           What are various ways of hosting WCF services?
           What is the difference between hosting a WCF service on IIS and self-hosting?
           What is the difference between BasicHTTPBinding and WsHTTPBinding?

Question 38.
What are WPF and Silverlight?
Answer:
WPF (Windows Presentation Foundation) is a graphical subsystem for displaying user interfaces, documents, images, movies, etc. It uses XAML (extensible Application Markup Language (Microsoft)) which is an XML (extensible Markup Language) descriptive language to represent Ul (User Interface) elements.

Silverlight is a Web browser plug-in by which we can enable animations, graphics, and audio/video. You can compare Silverlight with Flash. We can view animations with Flash and it’s installed as a plug-in in the browser.

Note: Do have a look at the below videos for WPF and Silverlight.
          What is the need for WPF when we have GDI (Graphics Device Interface), GDI+, and DirectX?
         Can you explain how we make a simple WPF application?
         Can you explain the architecture of Silverlight?
        What are the basic things needed to make a Silverlight application?

Question 39.
What is LINQ and Entity Framework?
Answer:
LINQ (Language Integrated Query (Microsoft)) is a uniform programming model for any kind of data access. It is also an OR (Object Oriented) Mapper which helps us to expedite our business object creation process.

ADO.NET entity is an ORM (Object Relational Mapping) that abstracts data models by providing a simplified object model.

In other words, the complete middle-tier development is expedited using an entity framework.

Note: Below simple video demonstration in the CD that will help you understand LINQ and entity framework in great depth.
          What is LINQ and can you explain the same with an example?
          Can you explain a simple example of LINQ to SQL?

Question 40.
What’s the difference between LINQ to SQL and Entity Framework?

  • LINQ to SQL is good for rapid development with SQL Server. EF (Entity Framework) is for enterprise scenarios and works with SQL servers as well as other databases.
  • LINQ maps directly to tables. One LINQ entity class maps to one table. EF has a conceptual model and that conceptual model maps to the storage model via mappings. So one EF class can map to multiple tables or one table can map to multiple classes.
  • LINQ is more targeted towards rapid development while EF is for enterprise-level where a loosely coupled framework is needed.

If you are starting with fresh development using entity framework, in case you are in an older version of the framework where entity framework does not exist use LINQ to SQL.

Question 41.
What are design patterns?
Answer:
Design patterns are the recurring solutions to recurring problems in software architecture.

Note: Do watch the following videos for the design pattern which is shipped with the CD:
          Introduction
         Factory pattern
         Memento Pattern
         Singleton Pattern

Question 42.
Which design patterns are you familiar with?
Answer:
Left to the readers, pick any three patterns which you have used in your project and talk about them. In Chapter “Design patterns, UML, Estimation and Project management” we have explained three design patterns.

Note: In CD we have snipped three design pattern videos you can have a look at them.
         Factory pattern
         Memento Pattern
         Singleton Pattern

Question 43.
Can you explain singleton pattern?
Answer:
Singleton pattern helps us to create a single instance of an object which can be shared across the project. The main use of singleton patterns is for global data sharing and caching.

Note: The CD contains a video explanation with source code for “Singleton Pattern”.

Question 44.
What are MVC, MVP and MVVM patterns?
Answer:
All the above design patterns come in the presentation pattern category and help to remove any kind of cluttered code in Ul like manipulation of user interfaces and maintaining state. Thus keeping your Ul code cleaner and better to maintain.

MVC pattern divides the architecture into three parts: model, view, and controller. The first request comes to the controller and the controller then decides which view to be displayed and ties up the model with the view accordingly.

MVP (Model View Presenter) has the same goals as MVC, i.e., separating the Ul from the model. It does the same by using a presenter class. The Ul talks via an interface to the presenter class and the presenter class talks with the model.

MVVM (Model-View-View-Model) is an architectural pattern with the focus of removing Ul cluttered code. It does the same by using an extra class called a view model. MVVM is mostly suitable for Silverlight and WPF (Windows Presentation Foundation) projects because of the rich bindings provided by the technologies.

Note: In the CD we have shipped four videos that explain MVC, MVP, and MVVM patterns. Below is the name of the videos:
         The basics of MVC HTTP Handlers
         MVC using core ASP.NETand HTTP Handler
         MVC using MVCASP.NET
         Model View Presenter video

Question 45.
What is UML and which are the important diagrams?
Answer:
The Unified Modeling Language (UML) is a graphical language for visualizing, specifying, constructing, and documenting the artifacts of a software-intensive system.
UML provides blueprints for business processes, system functions, programming language statements, database schemas, and reusable components. Some of the important UML diagrams are use case, class diagrams, sequence diagrams, activity diagrams, object diagrams, collaboration diagrams, state chart diagrams, component diagrams, and deployment diagrams.

Note: We have shipped five videos that explain some important UML diagrams in detail. Below is the list.
Introduction
Use Case Diagrams
Class Digrams
Sequence Digrams
Collaboration Diagrams

Question 46.
What are the different phases in a software life cycle?
Answer:
There are six phases in software development:

  • Requirement
  • Design
  • Coding and unit testing
  • System testing
  • Acceptance testing
  • Go life

Question 47.
What is Ajax and how does it help?
Answer:
Ajax stands for Asynchronous JavaScript and XML (extensile Markup Language). There are two prime benefits of Ajax:

  • It sends only necessary data to the server. For instance, let’s say you have four textboxes and on a submit button you want to send only two textbox data, Ajax helps in the same.
  • The second benefit is it’s asynchronous. In other words, when you click on submit button and until the server processes the request you can do other activities on the site. For instance, when you click on send e-mail and until the e-mail is sent, you can start composing a new e-mail in the background.

Question 48.
How did you do unit testing in your project?
Answer:
From a unit testing perspective, there are two great tools “NUnit” (an open-source unit testing framework) and “Visual Studio Unit Test Template”. Talk about which you are comfortable with. Below are two videos on DVD that show a demonstration of how to use the NUnit and the VSTS (Visual Studio Team System) unit test template.

Note: In the CD we have shipped four videos that explain unit testing using
          What is unit testing and can we see an example of the same?
          How can we write data-driven tests using the NUNIT and VS Test?

Question 49.
What is Agile?
Answer:
Agile is a group of software development methodologies where we develop projects. Its features are incremental (tasks divided into small increments with planning) and iterative (goals are released in short time frames, for example, 1 to 4 weeks). In Agile we. consider software as the most important entity and accept user changes and deliver them in small releases. There are four important principles of Agile:

  • Individuals and interactions over processes and tools.
  • Working software over comprehensive documentation.
  • Customer collaboration over contract negotiation.
  • Responding to change over following a plan.

Question 50.
How do you do code reviews?
Answer:
Code reviews are either done manually, i.e., peer review or automated review using free static code analysis tools like StyleCop and FxCop.

Note: We have shipped two videos in the CD which explain how to use StyleCop and FxCop tools for code reviews.

Question 51.
How do you convert requirements to technical documents?

Note: This is a subjective answer. Below goes my version.

Requirements are normally available in use cases or free text. The first step is to identify the classes, properties for the classes, methods/functions, and relationships between the classes.

As a general rule nouns become classes and verbs become actions for the classes.

Once the classes are identified we can use sequence or collaboration diagrams to detail out the interactions. The database objects are later created using the class diagrams.