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

22⟩ Please explain what is the difference between encrypting a password and applying a hashing?

It is quite difficult (almost impossible) to decrypt a hashing (MD5 or SHA1, for example). The process of password validation compares the password in plain text with a hash to the stored one.

Conversely, one can decrypt an encrypted password with access to the keys and the encryption algorithms (such as Triple-DES).

 148 views

23⟩ What is the difference between Task and Thread in .NET?

☛ Thread represents an actual OS-level thread, with its own stack and kernel resources. Thread allows the highest degree of control; you can Abort() or Suspend() or Resume() a thread, you can observe its state, and you can set thread-level properties like the stack size, apartment state, or culture. ThreadPool is a wrapper around a pool of threads maintained by the CLR.

☛ The Task class from the Task Parallel Library offers the best of both worlds. Like the ThreadPool, a task does not create its own OS thread. Instead, tasks are executed by a TaskScheduler; the default scheduler simply runs on the ThreadPool. Unlike the ThreadPool, Task also allows you to find out when it finishes, and (via the generic Task) to return a result.

 133 views

24⟩ What is the difference between boxing and unboxing?

Boxing is the process of converting a value type to the type object, and unboxing is extracting the value type from the object. While the boxing is implicit, unboxing is explicit.

Example (written in C#):

int i = 13;

object myObject = i; // boxing

i = (int)myObject; // unboxing

 131 views

25⟩ What is deferred execution vs. immediate execution in LINQ?

In LINQ, deferred execution simply means that the query is not executed at the time it is specified. Specifically, this is accomplished by assigning the query to a variable. When this is done, the query definition is stored in the variable but the query is not executed until the query variable is iterated over. For example:

DataContext productContext = new DataContext();

var productQuery = from product in productContext.Products

where product.Type == "SOAPS"

select product; // Query is NOT executed here

foreach (var product in productQuery) // Query executes HERE

{

Console.WriteLine(product.Name);

}

You can also force immediate execution of a query. This can be useful, for example, if the database is being updated frequently, and it is important in the logic of your program to ensure that the results you’re accessing are those returned at the point in your code where the query was specified. Immediate execution is often forced using a method such as Average, Sum, Count, List, ToList, or ToArray. For example:

DataContext productContext = new DataContext();

var productCountQuery = (from product in productContext.Products

where product.Type == "SOAPS"

select product).Count(); // Query executes HERE

 132 views

26⟩ Tell us what is JSON data, and what is one way that .NET developers can work with JSON?

JSON (JavaScript Object Notation) provides developers with a way to organize and store data so it’s easy to access and read. JSON is important for developers because it allows them to manipulate JSON feeds from other sites and to load them more quickly and easily than via SML/RSS feeds. Json.NET provides a way for .NET developers to define classes that parse objects and arrays from JSON text. You can also use Json.NET if you need to serialize value types into JSON text. Json.NET runs on .NET2, .NET3 and .NET4.

 149 views

27⟩ Do you know what’s the difference between .NET and Laravel?

This is one of the more straightforward .NET interview questions you can ask. Most web developers will at least be familiar with alternative frameworks such as Laravel and should be able to discuss some of the differences between those platforms and .NET. This conversation will allow you to dig down and discover where candidates’ interests lie and how they view the role of .NET developer. For example, they may focus on:

☛ Languages (e.g. C# support in .NET versus Laravel’s support for PHP)

☛ Security

☛ Processing overheads

☛ .NET’s integration with Visual Studio

☛ Third-party libraries

☛ Open-source community support

 137 views

28⟩ Please explain what is Heap and what is Stack?

☛ Both are memory locations, wherein Heap is global and Stack is local.

☛ The Heap is application level while the Stack is thread-level.

☛ The Stack has a defined first-in-first-out stack structure, while the Heap does not have a defined data structure.

☛ Its size is defined at the time of its creation. For Heap, the size is defined when starting the application and for Stack, when creating a thread.

☛ Both can grow dynamically.

☛ The Stack is faster than the Heap. A stack is in “cache” and doesn’t have to synchronize with other threads like the Heap.

☛ The Stack stores values while the Heap stores objects.

 129 views

29⟩ Please explain what is the difference between ODBC and ADO?

Open Database Connectivity is a standard for managing database operations in applications. The standard uses the same methods for Oracle as for Mysql. For example, it declares the connection with particularity at the user or operating system level.

ADO is a set of .Net libraries for data management, including ODBC connections. For ADO, ODBC is a driver.

 131 views

30⟩ Please explain 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.

 137 views

31⟩ Please explain what garbage collection is and how it works. Provide a code example of how you can enforce garbage collection in .NET?

Garbage collection is a low-priority process that serves as an automatic memory manager which manages the allocation and release of memory for the applications. Each time a new object is created, the common language runtime allocates memory for that object from the managed Heap. As long as free memory space is available in the managed Heap, the runtime continues to allocate space for new objects. However, memory is not infinite, and once an application fills the Heap memory space, garbage collection comes into play to free some memory. When the garbage collector performs a collection, it checks for objects in the managed Heap that are no longer being used by the application and performs the necessary operations to reclaim the memory. Garbage collection will stop all running threads, it will find all objects in the Heap that are not being accessed by the main program and delete them. It will then reorganize all the objects left in the Heap to make space and adjust all the Pointers to these objects in both the Stack and the Heap.

To enforce garbage collection in your code manually, you can run the following command (written in C#):

System.GC.Collect();

 144 views

32⟩ What is the difference between managed and unmanaged code?

.NET interview questions like this allow candidates to demonstrate their understanding of Common Language Runtime (CLR), a crucial part of the .NET Framework. Code written in C# or Visual Basic .NET will, when compiled, run only in the CLR, which provides functionalities such as garbage collection and memory management. The advantage of this is that managed code is platform-independent because it runs in the CLR rather than the operating system of the machine accessing the application.

Code written in other languages, such as C or C++, produces unmanaged code, meaning developers can’t rely on the CLR to provide this kind of portability. Managed and unmanaged code are interoperable. Examples of unmanaged code used in .NET include COM components, ActiveX interfaces and Win32 API functions.

 131 views

33⟩ Do you know what is LINQ?

It is standardization to consult data and convert it into objects, regardless of the source. It is a query manager for databases, XML and enumerable collections using a single language.

 130 views

35⟩ Do you know what is lambda expressions in C#?

A lambda expression is an anonymous function that you can use to create delegates or expression tree types. By using lambda expressions, you can write local functions that can be passed as arguments or returned as the value of function calls. Lambda expressions are particularly helpful for writing LINQ query expressions.

 133 views

36⟩ Please explain the difference between constants and read-only variables?

While constants and read-only variable share many similarities, there are some important differences:

☛ Constants are evaluated at compile time, while the read-only variables are evaluated at run time.

☛ Constants support only value-type variables (the only exception being strings), while read-only variables can hold reference-type variables.

☛ Constants should be used when the value is not changing during run time, and read-only variables are used mostly when their actual value is unknown before run time.

☛ Read-only variables can only be initialised at the time of declaration or in a constructor.

 135 views

37⟩ Explain me what is .NET web service?

Web services are reusable components that allow developers to publish an application’s function over the internet to make it accessible and directly interactable with other applications and objects online. Web services communicate by using standard web protocols and data formats — including HTTP, XML and SOAP — allowing them to connect across different platforms and programming languages. ASP.NET provides a simple way to develop web services. The .NET Framework provides built-in classes for building and consuming web services.

 122 views

38⟩ Please explain what do the terms “boxing” and “unboxing” mean?

This question can reveal how much candidates know about data types and OOP principles. The idea is relatively simple: Boxing is a process that converts a value type to an object type — by “boxing” the variable inside a dedicated object or interface. Unboxing extracts this value and stores it in a value type. Boxing was essential in some old Collection types such as ArrayList, and can still be used for accurate conversion of types — for example, from a double to an int.

 117 views

39⟩ Explain me what is encapsulation?

Encapsulation is one of four basic features of OOP and refers to the inclusion within a program object of methods and data needed for the object to function. For .NET interview questions like this, candidates should mention that encapsulation helps keep data from unwanted access through binding code and data in an object, which is the basic, single self-contained unit of a system.

Another way of understanding encapsulation is to think of it as “hiding” the state of an object as private or protected. Under this principle of information hiding, the internal workings of an object are segregated from the rest of the application. This is useful because it makes it less likely that other objects can modify the state or behavior of the object in question.

 119 views

40⟩ Tell us what is Heap and what is Stack?

☛ Both are memory locations, wherein Heap is global and Stack is local.

☛ The Heap is application level while the Stack is thread-level.

☛ The Stack has a defined first-in-first-out stack structure, while the Heap does not have a defined data structure.

☛ Its size is defined at the time of its creation. For Heap, the size is defined when starting the application and for Stack, when creating a thread.

☛ Both can grow dynamically.

☛ The Stack is faster than the Heap. A stack is in “cache” and doesn’t have to synchronize with other threads like the Heap.

☛ The Stack stores values while the Heap stores objects.

 140 views