Senior .Net Developer

  Home  Microsoft .Net Technologies  Senior .Net Developer


“Senior .Net Developer based Frequently Asked Questions in various Senior .Net Developer job interviews by interviewer. These professional questions are here to ensures that you offer a perfect answers posed to you. So get preparation for your new job hunting”



60 Senior .Net Developer Questions And Answers

1⟩ Do you know what is Garbage Collector?

Garbage Collector is an automatic process of memory release. When memory goes low, it goes through the Heap and eliminates the objects no longer in use. It frees up memory, reorganizes remaining threads and adjusts pointers to these objects, both in Heap and Stack.

 125 views

2⟩ Do you know what is the difference between an abstract class and an interface?

☛ An abstract class can contain both public and private constructors, methods, and fields. On the contrary, the interface contains only methods and public properties.

☛ You can only inherit from an abstract class, but implement many interfaces.

☛ An interface defines behavior, something that the class that implements it can do. Contrary, an abstract class defines what the class is and what it represents.

☛ You can’t instantiate anyone.

☛ An abstract class is useful when creating components, making a partial initial implementation and a specific definition. This leaves you free to implement other methods.

 155 views

3⟩ Please tell us what is the difference between Override and Overload in a method?

Override is to overwrite the method with the same signature (parameters and return type) but different functionality. Overwriting requires a “virtual” declaration of the method.

On the other hand, overloading refers to coding several versions of the same method. Though the “virtual” declaration for a method is not necessary to overload, it requires a different signature (parameters and/or return value).

 159 views

5⟩ Do you know what is .NET Standard?

☛ .NET Standard solves the code sharing problem for .NET developers across all platforms by bringing all the APIs that you expect and love across the environments that you need: desktop applications, mobile apps & games, and cloud services

☛ .NET Standard is a set of APIs that all .NET platforms have to implement. This unifies the .NET platforms and prevents future fragmentation.

☛ .NET Standard 2.0 will be implemented by .NET Framework, .NET Core, and Xamarin. For .NET Core, this will add many of the existing APIs that have been requested.

☛ .NET Standard 2.0 includes a compatibility shim for .NET Framework binaries, significantly increasing the set of libraries that you can reference from your .NET Standard libraries.

☛ .NET Standard will replace Portable Class Libraries (PCLs) as the tooling story for building multi-platform .NET libraries.

 146 views

6⟩ Tell us the difference between managed and unmanaged code?

Managed code is a code created by the .NET compiler. It does not depend on the architecture of the target machine because it is executed by the CLR (Common Language Runtime), and not by the operating system itself. CLR and managed code offers developers few benefits, like garbage collection, type checking and exceptions handling.

On the other hand, unmanaged code is directly compiled to native machine code and depends on the architecture of the target machine. It is executed directly by the operating system. In the unmanaged code, the developer has to make sure he is dealing with memory usage and allocation (especially because of memory leaks), type safety and exceptions manually.

In .NET, Visual Basic and C# compiler creates managed code. To get unmanaged code, the application has to be written in C or C++.

 146 views

7⟩ Please explain what inheritance is, and why it’s important?

Inheritance is one of the most important concepts in object-oriented programming, together with encapsulation and polymorphism. Inheritance allows developers to create new classes that reuse, extend, and modify the behavior defined in other classes. This enables code reuse and speeds up development. With inheritance, developers can write and debug one class only once, and then reuse that same code as the basis for the new classes. The class whose members are inherited is called the base class, and the class that inherits those members is called the derived class. By default, all classes in .NET are inheritable.

 159 views

9⟩ What is the difference between a stack and a queue?

This .NET interview question tests candidates’ basic knowledge of collections. Along with stacks and queues in this category are hash tables, bags, dictionaries and lists. A stack keeps track of what is executing and contains stored value types to be accessed and processed as LIFO (Last-In, First-Out), with elements inserted and deleted from the top end.

A queue, on the other hand, lists items on a FIFO (First-In, First-Out) basis in terms of both insertion and deletion, with items inserted from the rear end and deleted from the front end of the queue.

 162 views

10⟩ Do you know what are three common acronyms used in .NET, and what do they stand for?

This one should be easy for .NET developer candidates to answer. The question allows them some flexibility in choosing terms with which they are most familiar. Three frequently used acronyms in .NET are IL, CIL and CLI:

☛ IL stands for Intermediate Language, which is an object-oriented programming language that is a partially compiled code that .NET developers will then compile to native machine code.

☛ CIL stands for Common Intermediate Language, formerly known as Microsoft Intermediate Language (MSIL). This is another programming language that .NET developers use, and it represents the lowest possible level for a language that humans can still read.

☛ CLI stands for Common Language Infrastructure. This is a compiled code library that Microsoft developed as an open specification. Developers use CLI for security, versioning and deployment purposes.

 161 views

11⟩ Explain me what are the deferred execution and the immediate execution in LINQ?

A deferred execution encapsulates a query’s definition without executing it till the data is used at runtime. However, an immediate implementation calls the query at the same moment of its definition.

By default, the executions are deferred but we can do them immediately by calling “To List ()”. For example, in this way, a list of objects will be executed and returned to us when we define it.

 170 views

15⟩ Explain me why do we use MSMQ?

Microsoft Message Queuing, or MSMQ, is technology for asynchronous messaging. Whenever there's need for two or more applications (processes) to send messages to each other without having to immediately know results, MSMQ can be used. MSMQ can communicate between remote machines, even over Internet. It's free and comes with Windows, but is not installed by default.

This mainly addresses the common use case of asynchronous message processing: you have a service Service1 that communicates (send messages) with another part of your software architecture, say Service2.

Main problem: what if Service2 becomes suddenly unavailable? Will messages be lost? If you use MSMQ it won't: Service1 will send messages into a queue, and Service2 will dequeue when it is available.

 164 views

16⟩ Tell us the difference between the while and for loop. Provide a .NET syntax for both loops?

Both loops are used when a unit of code needs to execute repeatedly. The difference is that the for loop is used when you know how many times you need to iterate through the code. On the other hand, the while loop is used when you need to repeat something until a given statement is true.

The syntax of the while loop in C# is:

while (condition [is true])

{

// statements

}

The syntax of the while loop in VB.NET is:

While condition [is True]

' statements

End While

The syntax of the for loop in C# is:

for (initializer; condition; iterator)

{

// statements

}

The syntax of the for loop in VB.NET is:

For counter [ As datatype ] = start To end [ Step step ]

' statements

Next [ counter ]

 182 views

17⟩ Tell us what do the following acronyms in .NET stand for IL, CIL, MSIL, CLI and JIT?

IL, or Intermediate Language, is a CPU independent partially compiled code. IL code will be compiled to native machine code using current environmental properties by Just-In-Time compiler (JIT). JIT compiler translates the IL code to an assembly code and uses the CPU architecture of the target machine to execute a .NET application. In .NET, IL is called Common Intermediate Language (CIL), and in the early .NET days it was called Microsoft Intermediate Language (MSIL).

CLI, or Common Language Infrastructure, is an open specification developed by Microsoft. It is a compiled code library used for deployment, versioning, and security. In .NET there are two CLI types: process assemblies (EXE) and library assemblies (DLL). CLI assemblies contain code in CIL, and as mentioned, during compilation of CLI programming languages, the source code is translated into CIL code rather than into platform or processor specific object code.

To summarize:

☛ When compiled, source code is first translated to IL (in .NET, that is CIL, and previously called MSIL).

☛ CIL is then assembled into a bytecode and a CLI assembly is created.

☛ Before code execution, CLI code is passed through the runtime’s JIT compiler to generate native machine code.

☛ The computer’s processor executes the native machine code.

 188 views

18⟩ Explain me what is the difference between a class and an object, and how do these terms relate to each other?

A class is a comprehensive data type that is the primary building block, or template, of OOP. Class defines attributes and methods of objects, and contains an object’s behavior and data. An object, however, represents an instance of class. As a basic unit of a system, objects have identity and behavior as well as attributes.

Make sure candidates respond to the second part of this .NET interview question, addressing how these terms are related to each other. Answer: The relationship is based on the fact that a class defines the states and properties that are common to a range of objects.

 168 views

20⟩ Explain me what is the .Net framework and how does it work?

It is a virtual machine that executes a managed code. The code is compiled from C# or VB .NET and is executed by the CLR (Common Language Runtime).

Its working is as follows:

☛ You create a program in C # or VB.Net and compile it. The code is then translated to CIL (Common Intermediate Language).

☛ The program is assembled into bytecode to generate a CLI (Common Language Infrastructure) assembly file of.exe or .dll format.

☛ When you run the program (or the DLL), it is executed by the .Net framework CLR (Common Language Runtime). Since the code isn’t directly run by the operating system, it is called “Managed Code”.

☛ The .Net Framework CLR, through the JIT (Just-In-Time) Compiler, is responsible for compiling this code managed in the intermediate language. The compiled code is then sent to the native machine language assembler for the CPU to execute it.

 205 views