.Net Developer Interview Questions and Answers

The .NET is the technology from Microsoft, on which all other Microsoft technologies will be depending on in future. It is a major technology change, introduced by Microsoft, to catch the market from the SUN’s Java. Few years back, Microsoft had only VC++ and VB to compete with Java, but Java was catching the market very fast. With the world depending more and more on the Internet/ Web and java related tools becoming the best choice for the web applications, Microsoft seemed to be losing the battle. Thousands of programmers moved to java from VC++ and VB. To recover the market, Microsoft announced .NET.

But Microsoft has a wonderful history of starting late but catching up quickly. This is true in case of .NET too. Microsoft put their best men at work for a secret project called Next Generation Windows Services (NGWS), under the direct supervision of Mr. Bill Gates.

The outcome of the project is what we now know as .NET. Even though .NET has borrowed most of its ideas from Sun’s J2EE, it has really outperformed their competitors.

.NET is both a business strategy from Microsoft and its collection of programming support for what are known as Web services, the ability to use the Web rather than your own computer for various services. Microsoft’s goal is to provide individual and business users with a seamlessly interoperable and Web-enabled interface for applications and computing devices and to make computing activities increasingly Web browser-oriented. The .NET platform includes servers; building-block services, such as Web-based data storage; and device software. It also includes Passport, Microsoft’s fill-in-the-form-only-once identity verification service.

.NET Framework is a software framework developed by Microsoft that runs primarily on Microsoft Windows. It includes a large class library named Framework Class Library (FCL) and provides language interoperability (each language can use code written in other languages) across several programming languages. Programs written for .NET Framework execute in a software environment (in contrast to a hardware environment) named Common Language Runtime (CLR), an application virtual machine that provides services such as security, memory management, and exception handling. (As such, computer code written using .NET Framework is called “managed code”.) FCL and CLR together constitute .NET Framework.

The .NET framework was created by Microsoft in the late 1990’s, with the first version released in 2002. Since then several versions have been released, making the .NET framework better and more popular with each release.

.Net: .Net is a free, cross-platform, open source developer platform for building many different types of applications. With .NET, you can use multiple languages, editors, and libraries to build for web, mobile, desktop, gaming, and IoT. .NET apps in C#, F#, or Visual Basic.

C#: It is a simple, modern, object-oriented, and type-safe programming language.

F#: It is a cross-platform, open-source, functional programming language for .NET. It also includes object-oriented and imperative programming.

Visual Basic It is an approachable language with a simple syntax for building type-safe, object-oriented apps.

The .NET Framework is a managed execution environment for Windows that provides a variety of services to its running apps. It consists of two major components: the common language runtime (CLR), which is the execution engine that handles running apps, and the .NET Framework Class Library, which provides a library of tested, reusable code that developers can call from their own apps.

Microsoft officially definition of .NET Framework:

(The .NET Framework is the heart of Microsoft .NET. The .NET Framework is a software development platform of Microsoft .NET. Like any platform, it provides a runtime, defines functionality in some libraries, and supports a set of programming languages. The .NET Framework provides the necessary compile-time and run-time foundation to build and run .NET-based applications)

Mono is an open source implementation of Microsoft’s .NET Framework based on the ECMA standards for C# and the Common Language Runtime. A growing family of solutions and an active and enthusiastic contributing community is helping position Mono to become the leading choice for development of cross platform applications.

The Universal Windows Platform (UWP) is the app platform for Windows 10. You can develop apps for UWP with just one API set, one app package, and one store to reach all Windows 10 devices – PC, tablet, phone, Xbox, HoloLens, Surface Hub and more. It’s easier to support a number of screen sizes, and also a variety of interaction models, whether it be touch, mouse and keyboard, a game controller, or a pen. At the core of UWP apps is the idea that users want their experiences to be mobile across ALL their devices, and they want to use whatever device is most convenient or productive for the task at hand. The API is implemented in C++, and supported in C++, VB.NET, C#, F# and JavaScript.

The .NET Framework was developed so that it could support a theoretically infinite number of development languages. Currently, more than 20 development languages work with the .NET Framework. C# is the programming language specifically designed for the .NET platform, but C++ and Visual Basic have also been upgraded to fully support the .NET framework. The following are the commonly used languages provided by the Microsoft:

A .NET programming language (C#, VB.NET, J# etc.) does not compile into executable code; instead it compiles into an intermediate code called Microsoft Intermediate Language (MSIL). As a programmer one need not worry about the syntax of MSIL – since our source code in automatically converted to MSIL.

One of the obvious themes of .NET is unification and interoperability between various programming languages. In order to achieve this; certain rules must be laid and all the languages must follow these rules. In other words we cannot have languages running around creating their own extensions and their own fancy new data types. CLS is the collection of the rules and constraints that every language (that seeks to achieve .NET compatibility) must follow. Microsoft have defined three level of CLS compatibility/compliance. The goals and objectives of each compliance level has been set aside.

The Common Type System (CTS) is a standard for defining and using data types in the .NET framework. CTS defines a collection of data types, which are used and managed by the run time to facilitate cross-language integration. CTS provides the types in the .NET Framework with which .NET applications, components and controls are built in different programming languages so information is shared easily. In contrast to low-level languages like C and C++ where classes/struts have to be used for defining types often used (like date or time), CTS provides a rich hierarchy of such types without the need for any inclusion of header files or libraries in the code.

Inheritance is one of the fundamental attributes of object-oriented programming. It allows you to define a child class that reuses (inherits), extends, or modifies the behavior of a parent class. The class whose members are inherited is called the base class. The class that inherits the members of the base class is called the derived class.C# and .NET support single inheritance only. That is, a class can only inherit from a single class.

A strong response to this question might be: “To be classified as a .NET language, a language has to comply with the Common Language Runtime standard. Code in .NET is compiled to the Microsoft Intermediate Language. After it’s compiled to the Intermediate Language, language is not a barrier. Code can use or call functions written in other languages.”

There are 3 types of objects that can be configured to serve as .NET remote objects. You can choose the type of object depending on the requirement of your application.

Single Call: Single Call objects service one and only one request coming in. Single Call objects are useful in scenarios where the objects are required to do a finite amount of work. Single Call objects are usually not required to store state information, and they cannot hold state information between method calls. However, Single Call objects can be configured in a load-balanced fashion.

Singleton Objects: Singleton objects are those objects that service multiple clients and hence share data by storing state information between client invocations. They are useful in cases in which data needs to be shared explicitly between clients and also in which the overhead of creating and maintaining objects is substantial.

Client-Activated Objects (CAO): Client-activated objects (CAO) are server-side objects that are activated upon request from the client. This way of activating server objects is very similar to the classic COM coclass activation. When the client submits a request for a server object using “new” operator, an activation request message is sent to the remote application. The server then creates an instance of the requested class and returns an ObjRef back to the client application that invoked it. A proxy is then created on the client side using the ObjRef. The client’s method calls will be executed on the proxy. Client-activated objects can store state information between method calls for its specific client and not across different client objects. Each invocation of “new” returns a proxy to an independent instance of the server type.

Each process is allocated its own block of available RAM space, no process can access another process’ code or data. If the process crashes, it dies alone without taking the entire OS or a bunch of other applications down. A process is an instance of a running application. An application is an executable on the hard drive or network. There can be numerous processes launched of the same application (5 copies of Word running), but 1 process can run just 1 application.

.NET Framework assembly containing resources specific to a given language. Using satellite assemblies, you can place the resources for different languages in different assemblies, and the correct assembly is loaded into memory only if the user selects to view the application in that language. In general, assemblies should contain culture-neutral resources. If you want to localize your assembly (for example use different strings for different locales) you should use satellite assemblies.

Metadata in .Net is binary information which describes the characteristics of a resource. This information includes Description of the Assembly, Data Types and members with their declarations and implementations, references to other types and members, Security permissions etc. A module’s metadata contains everything that needed to interact with another module.

Thread in computer science means a sequence of execution instructions that can run independently, that is a single flow of execution in a process. Thread is like a process, at least one thread exists within each process. Single Thread (normal programs) in computer science means that only one task can execute and at the same time the other tasks have to wait for the completion of the current task like in a queue. Single thread resulted in systems idle time and application performance. Multithreading allows multiple process to execute concurrently within a single program. That is more than one task in a program can execute at the same time and each thread run independently of its own. If multiple threads can exist within a process, typically share the state information of a process, and share memory and other resources directly. Each thread maintains exception handlers, a scheduling priority, and a set of structures the system uses to save the thread context until it is scheduled.

Shadowing is either through scope or through inheritance. Shadowing through inheritance is hiding a method of a base class and providing a new implementation for the same. This is the default when a derived class writes an implementation of a method of base class which is not declared as overridden in the base class. This also serves the purpose of protecting an implementation of a new method against subsequent addition of a method with the same name in the base class. ‘Shadows’ keyword is recommended although not necessary since it is the default.

Developers tackle several tasks depending on a project’s requirements. If you want a web presence and want to customize a web application without an out-of-the-box solution such as WordPress, then a .NET programmer can take your ideas and turn them into a tangible product. .NET developers also write desktop applications, but many of them specialize in either cloud or web programming. When you search for .NET developers, make sure you’re looking for ones that specialize in the environment you’re looking to build an application for. Cloud applications would be anything that runs in a web browser, while desktop applications are any software that is installed on the local desktop machine.

Internet Information Services (IIS) is created by Microsoft to provide Internet-based services to ASP.NET Web applications. It makes your computer to work as a Web server and provides the functionality to develop and deploy Web applications on the server. IIS handles the request and response cycle on the Web server. It also offers the services of SMTP and FrontPage server extensions. The SMTP is used to send emails and use FrontPage server extensions to get the dynamic features of IIS, such as form handler.

.Net Application Domain: An application domain is a virtual process and is used to isolate applications from one another. Each application domain has their own virtual address space which scopes the resources for the application domain using that address space.Each application running within its main process boundaries and its application domain boundaries. All objects created within the same application scope are created within the same application domain. Multiple application domains can exist in a single operating system process. An application running inside one application domain cannot directly access the code running inside another application domain.

Globalization is design technique which is based on the idea that application might have to run under different cultures. You make decisions in code which act upon some known properties of cultures – for example, you may right-align controls if you find out that current culture is RightToLeft; otherwise leave controls left-aligned. Another examples are to take current culture settings to determine currency, numbers format, date/time format etc. rather than hard-coding them.

Localization is the process of creating actual content which takes current culture into account. It means, for example, writing content with specific currency sign or formatting numbers with specific thousands delimiter. It may become more difficult to represent labels and parts of text. That is typically done by creating string resources that represent particular labels and scribblings on the interface (or Web page). Then, instead of filling controls texts with fixed labels, you rather pick the string from resources, but for the desired culture.