0% found this document useful (0 votes)
4 views35 pages

Net Iq

This document provides a comprehensive guide to .NET interview questions, covering topics for freshers to experienced developers. It includes basic, advanced, and coding questions, as well as insights into .NET roles, responsibilities, and job trends. Additionally, it offers statistical data on .NET usage and market share, along with explanations of key concepts and components within the .NET framework.

Uploaded by

hellobhaskarhere
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views35 pages

Net Iq

This document provides a comprehensive guide to .NET interview questions, covering topics for freshers to experienced developers. It includes basic, advanced, and coding questions, as well as insights into .NET roles, responsibilities, and job trends. Additionally, it offers statistical data on .NET usage and market share, along with explanations of key concepts and components within the .NET framework.

Uploaded by

hellobhaskarhere
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

t

aa Top .NET
Interview Questions
lliP
te
In

Click here to view the live version of the page

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

The rise in the number of job openings leads to a lot of vacancies and stiff
competition to hire the most proficient .NET developers. With these questions, you
will gain in-depth knowledge and insight into how to answer the most asked
questions in a .NET interview. This guide has been carefully curated, considering
many factors and including expert advice from multiple professionals and .NET
experts.

.NET Basic Interview Questions for Freshers with Answers

.NET Interview Questions for Experienced (2 to 5 Years)

t
aa
Advanced .NET Interview Questions for 10 Years Experience

.NET Coding Interview Questions

.NET Core Interview Questions for Experienced


lliP
.NET Salary Trends

.NET Job Trends

Job Opportunities in .NET

.NET Roles and Responsibilities


te

Conclusion

Did You Know?


In

● According to the reports from Enlyft, there are more than 2,46,780
companies that use Microsoft.NET
● Microsoft.NET has a market share of 1.4% in the software framework
category.
● As per the data published by Enlyft, 67% of all the customers who are using
.NET are small (<$50M), 9% are large (>$1000M), and 17% are medium-sized
companies.

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

Let us begin this with basic .net interview questions and answers!

Basic .NET Interview Questions for Freshers with

t
Answers

aa
1. What is the .NET framework?

.NET is one of the platforms provided by Microsoft, which is used to build a variety
of applications using Windows.
lliP
The ability to develop classes, libraries, and APIs and run, debug, and deploy code
into web services and applications form are the key uses of this framework. It
supports a lot of languages, and you can work with everything from C# to VB all the
way to Perl, and more.
te

The object-oriented model is championed here in the .NET framework

2. What are some of the common components of .NET?


In

There are a lot of components that make up the .NET framework, and some of
them are as follows:

● .NET Class Library


● .NET Framework
● Language Runtime
● Application Domain
● Profiling

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

3. What does JIT stand for in .NET?

JIT is the abbreviation of Just in Time. It is a compiler that is used to convert


intermediate code into native code easily.

In .NET, during execution, the code is converted into the native language, also
called the byte code. This is processed by the CPU, and the framework helps with
the conversion.

t
4. What is the meaning of MSIL?

aa
MSIL is the abbreviation for Microsoft Intermediate Language. It is used to provide
the instructions required for operations such as memory handling, exception
handling, and more. It can also provide instructions to initialize and store values
and methods easily.
lliP
The next .NET interview question involves an important concept.

5. What is CTS?

The acronym CTS stands for Common Type System, which encompasses a
te

predefined set of systematic regulations dictating the proper definition of data


types in relation to the values provided by a user. Its primary purpose is to
characterize and encompass all the various data types utilized within a user’s
application.
In

Nevertheless, it is also permissible for users to construct custom calls using the
guidelines established by the CTS. This feature is primarily provided to
accommodate the diverse range of programming languages that can be employed
when working within the .NET framework.

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

6. What is CLS?

CLS stands for Common Language Specification in .NET. It is put into place to
ensure that the application developer is capable of inter-language operations if
required. It is a reusable aspect among all of the .NET compatible languages.

Learn about everything there is to know in the .NET Framework. Join our .NET
Programming course now!

t
7. What does CLR stand for in .NET?

aa
CLR stands for Common Language Runtime. It forms to be the most vital
component of .NET as it provides the foundation for many applications to run on.

If a user writes an application in C#, it gets compiled and converted to intermediate


code. After this, CLR takes up the code and works on it with respect to the following
lliP
aspects:

● Memory management
● Security protocols
● Libraries for loading
● Thread management
te

Next up on this top .NET basic interview questions and answers, we need to
understand a very important difference. Check it out.
In

8. What is the difference between managed code and


unmanaged code in .NET?

Managed Code Unmanaged Code

Managed by CLR Not managed by any entity

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

Garbage collection is used to manage Runtime environment takes care of the


memory management

The .NET framework is necessary for N


the execution
ot dependant on the .NET framework to
run

t
aa
9. How does managed code execute in the .NET
framework?

There are four main steps that include in the execution of the managed code. They
are as follows:
lliP
1. Choosing a compiler that can execute the code written by a user
2. Conversion of the code into Intermediate Language (IL) using a compiler
3. IL gets pushed to CLR, which converts it into native code using JIT
4. Native code is now executed using the .NET runtime
te

10. What is the meaning of state management in .NET?

State management, as the name suggests, is used to constantly monitor and


maintain the state of objects in the runtime. A web page or a controller is
In

considered to be an object.

There are two types of state management in ASP.NET:

● Client-side: It is used to store information on the client’s machine and is


formed mostly of reusable and simple objects.
● Server-side: It stores the information on the server and makes it easier to
manage and preserve the information on the server.

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

Next up on this top .net interview questions for freshers and experienced, let us
understand the difference between an object and a class.

11. What is the difference between an object and a class


in .NET?

Object Class

t
An instance of a class The template for creating an object

aa
A class becomes an object after The basic scaffolding of an object
instantiation
lliP
Used to access properties from a class The description of methods and
properties

12. What is the difference between system.stringbuilder


and system.string in .NET?
te

system.stringbuilder system.string
In

Mutable Immutable

Supports using append Cannot use the append keyword

13. What is the meaning of LINQ?

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

LINQ is the abbreviated form of Language Integrated Query. It was first brought out
in 2008, and it provides users with a lot of extra features when working with the
.NET framework. One highlight is that it allows the users to manipulate data without
any dependency on its source.

14. What is an assembly in .NET?

An assembly is the simple collection of all of the logical units present. Logical units
are entities that are required to build an application and later deploy the same

t
using the .NET framework. It can be considered as a collection of executables and

aa
DLL files.

15. What are some of the components of an assembly in


.NET?
lliP
There are four main components of an assembly. They are as follows:

1. Resource: A collection of related files


2. MSIL: The Intermediate Language code
3. Metadata: The binary data of a program
4. Manifest: A collection of information about the assembly
te

16. What is the meaning of caching?


In

Caching is a term used when the data has to be temporarily stored in the memory
so that an application can access it quickly rather than looking for it in a hard drive.
This speeds up the execution to an exponential pace and helps massively in terms
of performance.

There are three types of caching:

● Data caching
● Page caching
● Fragment caching

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

The next .NET interview question we will check involves an important concept.

17. What is the difference between a function and a


stored procedure in .NET?

Function Stored Procedure

Can only return one value Can return any number of values

t
aa
No support for exception handling Supports the usage of try-catch blocks
using try-catch blocks for exception handling

The argument consists of only one Both input and output parameters are
lliP
input parameter present

A function can be called from a stored The stored procedure cannot be called
procedure from a function
te

18. What are the constructor types present in C# .NET?

There are five main types of constructor classes in C# as listed below:


In

● Copy constructor
● Default constructor
● Parameterized constructor
● Private constructor
● Static constructor

19. What are some of the advantages of using a session?

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

There are numerous advantages of making use of a session are as mentioned


below:

● It is used to store user data across the span of an application.


● It is very easy to implement and store any sort of object in the program.
● Individual entities of user data can be stored separately if required.
● The session is secure, and objects get stored on the runtime server.

20. Is it possible to manually set a timeout for a session

t
in .NET?

aa
Yes, it is possible to manually set a session’s out time. It can easily be done by
manipulating the web.config file.

Next up in this set of top .NET interview questions for freshers and experienced
lliP
developers, we can take a look at the questions categorized as intermediate!

.NET Interview Questions for Experienced (2 to


5 Years)
te

21. What is the meaning of boxing and unboxing in .NET?


In

Boxing is the process that is used when a user wishes to convert a value type into a
reference type directly.

Unboxing is the opposite of boxing, where the reference type is converted back into
a value type.

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

22. What is the use of manifest in the .NET framework?

Manifest is mainly used to store the metadata of the assembly. It contains a variety
of metadata which is required for many things as given below:

● Assembly version information


● Security identification
● Scope checking of the assembly
● Reference validation of classes

t
aa
23. What are memory-mapped files used for in .NET?

Memory-mapped files in .NET are used to instantiate the contents of a logical file
into the address of the application. This helps a user run processes simultaneously
on a single machine and have the data shared between processes.
lliP
The MemoryMappedFile.CreateFromFiles() function is used to obtain a
memory-mapped file object easily.

24. What is the meaning of CAS in .NET?


te

CAS stands for Code Access Security. It is vital in the prevention of unauthorized
access to programs and resources in the runtime. It can provide limited access to
the code to perform only certain operations rather than providing all at a given
point in time. CAS forms to be a part of the native .NET security architecture.
In

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

25. What is the meaning of garbage collection?

Garbage collection is a process that is used to maintain various aspects of memory


to prevent memory leaks during program execution.

An entity called the garbage collector is used to allocate and deallocate memory as
and when required by an application. This is done by performing checks on the
references of variables and objects used by the application. If an object is no longer
required by the application, the memory is de-allocated and freed up.

t
If you want to learn Data Structures in C and master various aspects of the C

aa
programming language, make sure to check out C Programming Course from
Intellipaat.

26. What is the use of GAC in .NET?


lliP
GAC is the abbreviation of Global Assembly Cache. GAC is a part of CLR, which is
used to store the assemblies that are shared across all of the applications. A user
can make use of the Gacutil application to add any file into GAC easily.

27. What are the three generations of garbage collection


te

in .NET?

The three generations of garbage collection are as follows:


In

● Gen 0: Stores short-lived objects


● Gen 1: Objects moved from Gen 0 live here
● Gen 2: Stores long-lived objects and Gen 1 objects

Next on this top dot net interview questions blog, we will be checking a frequently
asked question, i.e. MVC.

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

28. What is MVC?

MVC stands for Model-View-Controller. It is an architectural model that is used to


build applications in .NET. It serves as the foundation for the creation of
applications.

MVC consists of three entities as the name suggests:

● Model: Used to store and pull back data from a database


● View: Used to display the contents of an application

t
● Controllers: Entities that handle user interaction

aa
29. What are the types of memories supported in the
.NET framework?
lliP
There are two types of memories present in .NET as listed below:

● Stack: Used for static memory allocation


● Heap: Used for dynamic memory allocation

30. What is the use of delegation in .NET?


te

A delegate works similar to that of a function pointer of other programming


languages. It provides a way to encapsulate the reference of a method in an object.

A delegate object can be easily passed to a program after this, and then a method,
In

which was referenced earlier, can be called. Custom events can also be created in
the class using a delegate.

Next up on this top Dot NET developer interview questions and answers, we need
to understand a very important difference. Check it out.

31. What is the difference between an abstract class and


an interface in .NET?

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

Abstract Class Interface

Provides the partial implementation of Used to declare the behavior of an


functionalities that are done by implementing class
inheriting classes

Used to declare properties, methods, Feilds cannot be declared using

t
events, and fields as well interfaces

aa
32. What is the meaning of AutoPostBack in .NET?

AutoPostBack is a property in the .NET framework, which provides automatic


postback whenever an event starts its execution cycle. To use AutoPostBack, you
lliP
have to set the property to True.

33. What are the parameters that control connection


pooling behaviors in .NET?
te

There are four main parameters that control connection pooling behaviors in .NET
as given below:

● Connect Timeout
In

● Min Pool Size


● Max Pool Size
● Pooling

34. What are the requirements needed for connection


pooling?

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

Three main requirements to be fulfilled for connection pooling are as explained


below:

● The presence of an identical connection string for both entities


● The existence of multiple processes with the same connection
parameters
● The presence of similar security protocols and settings

Next up on this set of top .NET interview questions and answers, let’s take a look at
the questions categorized as advanced!

t
aa
Advanced .NET Interview Questions for 10 Years
Experience
lliP
35. How many elements can a tuple hold in .NET?

A tuple in .NET can hold anywhere up to eight elements. If there are more than
eight elements at a time, each of those extra elements gets defined into a separate
tuple.
te

The advantage of tuples in .NET is that they can be used as parameters or return
type specifiers.
In

36. Differentiate between the user control and the


custom control in the .NET framework.

User Control Custom Control

Static Layout Dynamic Layout

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

No support for the toolbox Supports the usage of the toolbox

Tightly coupled control access Loosely coupled control access

Branches from UserControl Branches from the control group

Next up on this .NET framework interview questions and answers, let us check out

t
an important question that is asked quite often.

aa
37. What is the meaning of role-based security in .NET?

Role-based security, as the name suggests, is a measure implemented in .NET to


provide security access based on the roles assigned to users. Examples include the
lliP
provision of access to users, administrators, and guests.

38. Can themes be applied to ASP.NET applications?

Yes, themes can be applied to ASP.NET applications easily by modifying the


te

following code in the web.config file:

1 &lt;configuration&gt;
In

2 &lt;system.web&gt;

3 &lt;pages theme="windows"/&gt;

4 &lt;/system.web&gt;

5 &lt;/configuration&gt;

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

39. What are some of the templates that are present in


Repeater control?

Many templates are widely used in Repeater control, and some of them are as
follows:

● AlternatingItemTemplate
● ItemTemplate
● HeaderTemplate

t
● FooterTemplate

aa
● SeparatorTemplate

40. How is the status of a DataReader checked in .NET?

The status of a DataReader can be checked easily by using a property called


lliP
‘IsClosed.’ It will tell you if the DataReader is closed or opened.

If it is closed, a true value is returned, and if the reader is open, it returns a false
value.

41. What do you mean by cross-page posting?


te

Consider the situation where you press the submit button on a webpage. Here, the
data is stored on the same page. However, if the data has to be stored on a
different page and linked to the current one, it would be called a cross-page post.
In

There is a property called PostBackUrl, which helps you achieve cross-page posting.

42. What is the use of MIME in .NET?

MIME is the short form of Multipurpose Internet Mail Extensions. It is an add-on to


the existing email protocols that lets you exchange files over emails easily.

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

During a web transmission, servers have the ability to add in a MIME header to the
beginning to denote that it is a MIME transaction.

43. What are the types of cookies available in ASP.NET?

There are two types of cookies available in ASP.NET as shown below:

● Session cookies: Present on the client machine and valid only for single
sessions

t
● Persistent cookies: Present on the user machine and has a specific

aa
period denoting its expiry

Next up on this top Dot NET developer interview questions and answers, we need
to check out certain aspects of security controls in .NET.

44. What are some of the security controls present in


lliP
ASP.NET?

There are five security controls present in ASP.NET as shown below:

● <asp: PasswordRecovery>: Used to send an email to a user upon


te

performing a password reset operation


● <asp: Login>: Gives the provisions of login controls with ID and password
fields for users to login via credentials
● <asp: LoginName>: Used to display the name of the user who has logged
In

into the system


● <asp: LoginStatus>: Used to denote the authentication flag of the user
who has logged in
● <asp: LoginView>: Used to provide a variety of views based on themes
upon user login

45. What is the order of the events that take place in a


page life cycle?

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

There are eight events as shown below that take place in an order to successfully
render a page:

1. Page_PreInit
2. Page_Init
3. Page_InitComplete
4. Page_PreLoad
5. Page_Load
6. Page_LoadComplete

t
7. Page_PreRender
8. Render

aa
lliP
46. Why are you applying for the .NET Developer role in
our company?
te

With this question, the interviewer wants to understand your interests, goals, and
career prospects in the field of .NET. Make sure to state the reasons why you feel
that .NET is the right career for you and how you plan to use it to add value to the
In

firm you just gave the .NET interview for.

47. Can you rate yourself on a scale of 1–10 depending on


your proficiency in .NET?

Here, the interviewer wants to know your understanding of the subject and the
proficiency with which you can handle tasks and solve problems. Make sure to
retrospect and give out an honest answer.

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

48. Has your college degree helped you with .NET


development in any way?

The interviewer asks this to assess if you have had any experience learning .NET
development in your degree course. Do explain about it if you have come across or
used the subject, and it would add a lot of value if you talk about how you plan to
use that learning in the coming days after being recruited.

t
49. What skills should a successful .NET Developer

aa
possess?

This question is primarily asked to gauge your understanding of the depths of the
role. The following are some of the important domains and skills you should have:

● NET MVC architecture


lliP
● Database handling
● Client-side web development
● .NET core

We can wind up this top Dot NET interview questions and answers with this very
important question.
te

Want to become a full-stack developer? Enroll in this Full Stack Developer Training and
learn from experts.
In

50. Have you earned any sort of certification to boost


your opportunities as a .NET Developer?

This is a very commonly asked question in .NET interviews today. The interviewer
tries to assess how serious you are with your application and career direction
toward the .NET field.

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

It adds immense value to possess a certification from a reputable organization to


prove to the interviewer that you have learned the concepts thoroughly and have
applied the same using industry-level projects, which have provided you with ample
experience about using .NET in the real world!

.NET Coding Interview Questions

t
51. Given a positive integer num, Write a C# function to

aa
determine if it is a perfect square without using any
built-in library functions.

The code has a method named IsPerfectSquare that checks if a given number is a
lliP
perfect square. If the number is less than 1, it’s not a perfect square, and the
method returns false. The code then uses a method to estimate the square root of
the number. If the square of this estimate equals the original number, the method
returns true, signaling that the number is a perfect square.

1 public class Solution


te

2 {
In

3 public bool IsPerfectSquare(int num)

4 {

5 if (num < 1)

6 {

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

7 return false;

8 }

10 long x = num;

t
11

aa
12 while (x * x > num)

13 {
lliP
14 x = (x + num / x) / 2;

15 }

16
te

17 return x * x == num;

18 }
In

19 }

52. Given an unsorted array of integers. Write a C#


function to find the length of the longest consecutive
element sequence.

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

The code identifies the longest consecutive sequence in an array. It uses a set to
swiftly check for the presence of a number’s predecessor. It iterates through each
number, verifying and updating the length of consecutive sequences, and
ultimately returns the longest length.

1 public class Solution

2 {

3 public int Trap(int[] height)

t
4 {

aa
5 int left = 0, right = height.Length - 1;

6 int leftMax = 0, rightMax = 0;

7 int waterTrapped = 0;
lliP
8

9 while (left < right)

10 {
te

11 if (height&#91;left&#93; < height&#91;right&#93;)

12 {

13 if (height&#91;left&#93; >= leftMax)


In

14 {

15 leftMax = height[left];

16 }

17 else

18 {

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

19 waterTrapped += leftMax - height[left];

20 }

21 left++;

22 }

23 else

24 {

t
aa
25 if (height[right] >= rightMax)

26 {

27 rightMax = height[right];

28 }
lliP
29 else

30 {

31 waterTrapped += rightMax - height[right];


te

32 }

33 right--;
In

34 }

35 }

36

37 return waterTrapped;

38 }

39 }

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

53. Given a string that contains only the digits 0-9 and a
target value. Write a C# function to return all possible
expressions that evaluate the target value.

This program tries to create various ways of adding, subtracting, and multiplying
digits in a given number to reach a specific result. It uses a method called recursive
backtracking to explore different options. The Backtrack function remembers
important details like the current position, previous value, current value, and the

t
expression being formed. The objective is to find combinations that give the desired
result while making sure not to have leading zeros. The outcomes are collected in a

aa
list and given as the final result.

1 using System;

2 using System.Collections.Generic;
lliP
3

4 public class Solution

5 {

6 public IList<string> AddOperators(string num, int target)


te

7 {

8 IList<string> result = new List<string>();


In

9 if (string.IsNullOrEmpty(num))

10 {

11 return result;

12 }

13

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

14 Backtrack(num, target, 0, 0, 0, "", result);

15 return result;

16 }

17

18 private void Backtrack(string num, int target, int index, long prevValue, long
currentValue, string expr, IList<string> result)

t
19 {

aa
20 if (index == num.Length)

21 {

22 if (currentValue == target)
lliP
23 {

24 result.Add(expr);

25 }

26 return;
te

27 }

28
In

29 for (int i = index; i < num.Length; i++)

30 {

31 if (i > index && num[index] == '0')

32 {

33 break; // Avoid leading zeroes in numbers

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

34 }

35

36 long currentNumber = long.Parse(num.Substring(index, i - index + 1));

37

38 if (index == 0)

39 {

t
aa
40 Backtrack(num, target, i + 1, currentNumber, currentNumber,
currentNumber.ToString(), result);

41 }

42 else
lliP
43 {

44 Backtrack(num, target, i + 1, currentNumber, currentValue + currentNumber,


expr + "+" + currentNumber, result);

45 Backtrack(num, target, i + 1, -currentNumber, currentValue - currentNumber,


te

expr + "-" + currentNumber, result);

46 Backtrack(num, target, i + 1, prevValue * currentNumber, currentValue -


prevValue + (prevValue * currentNumber), expr + "*" + currentNumber, result);
In

47 }

48 }

49 }

50 }

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

54. Given n non-negative integers representing an


elevation map where the width of each bar is 1, write a
C# function to compute how much water it can trap
after rain.

This C# code aims to solve the problem of trapping rainwater. It uses a method
where two pointers, left and right, start at the edges of the array and gradually
move towards each other.

t
aa
The idea is to find the maximum height encountered from the left (leftMax) and the
maximum height from the right (rightMax). While moving the pointers, it calculates
the trapped water based on the smaller of the two maximum heights. If the current
height is less than the maximum height, it adds the difference to the total trapped
water.
lliP
This process continues until the pointers meet in the middle, accumulating the
overall trapped water. The code employs a simple and efficient strategy to address
the rainwater trapping challenge.

Here is the code:


te
In

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

1 public class Solution

2 {

3 public int Trap(int[] height)

4 {

t
5 int left = 0, right = height.Length - 1;

aa
6 int leftMax = 0, rightMax = 0;

7 int waterTrapped = 0;
lliP
8

9 while (left < right)

10 {
te

11 if (height&#91;left&#93; < height&#91;right&#93;)

12 {
In

13 if (height&#91;left&#93; >= leftMax)

14 {

15 leftMax = height[left];

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

16 }

17 else

18 {

19 waterTrapped += leftMax - height[left];

t
20 }

aa
21 left++;

22 }
lliP
23 else

24 {

25 if (height[right] >= rightMax)


te

26 {

27 rightMax = height[right];
In

28 }

29 else

30 {

31 waterTrapped += rightMax - height[right];

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

32 }

33 right--;

34 }

35 }

t
36

aa
37 return waterTrapped;

38 }
lliP
39 }

.NET Core Interview Questions for Experienced


te

55. Differentiate .NET Core and .NET Frameworks.

.NET Core is a framework created by Microsoft that works on different operating


In

systems, and it’s free for anyone to use. On the other hand, .NET Framework is
older and only works on Windows. .NET Core is lighter and more modern, making it
great for new applications, while .NET Framework has a lot of libraries and features,
mainly for Windows programs.

56. What is CoreRT?

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

CoreRT is like a special version of .NET Core that makes your applications start
faster and use less memory by converting your code into machine language ahead
of time.

57. What is Transfer-Encoding?

Transfer-Encoding is a special instruction in HTTP (the language websites use to talk


to browsers) that tells how the information in a message should be sent. It helps
make data transmission over the internet more efficient. Imagine it like a code that

t
says whether the information should be sent in chunks or compressed to save

aa
space. It’s like a set of rules for sending and receiving messages on the internet so
that it’s done smartly and effectively.

58. Explain what .NET Core Middleware is.


lliP
Middleware acts as a crucial layer in software, functioning as a dynamic bridge for
handling requests and responses. This versatile middleware consists of multiple
delegates arranged in an application pipeline. Each delegate in the middleware
pipeline plays a pivotal role in determining whether to pass a request to the next
component and execute specific actions before or after passing it, ensuring a
seamless and optimized flow of data. Explore the power of middleware for
te

enhanced software performance and communication efficiency.

.NET Salary Trends


In

A .NET Developer in the US gets a salary in the range of $79,380 to $198,806 with an
average of $125,623 per year. The salary in India falls in the range of
₹3,00,000–₹8,00,000 per year, with an average of ₹5,34,883 per year.

Job Role Experience Salary Range

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

Web Developer 2 – 4 Years ₹3L – ₹7L /yr

Senior Web Developer 2 – 4 Years ₹5L – ₹10L /yr

.NET Job Trends

t
aa
1. Global Demand: As per the job postings on LinkedIn, there are more
than 1,000 jobs available in the United States.
2. Projected Growth: According to a report published by Statista recently,
for building a dynamic website, 17.03% of developers used .NET.
3. Regional Trends: There are more than 7,000 .NET Developer jobs in India,
lliP
as per the jobs posted by recruiters on LinkedIn. Companies are mostly
hiring for .NET Senior Software Engineer, .NET Developer, .NET Azure
Developer, ASP.NET Developer, etc.

Job Opportunities in .NET


te

There are multiple job opportunities in .NET. We have listed a few job roles below
with their descriptions.
In

Job Role Description

.Net Using the language and technologies of the .NET framework, a


Developer .NET developer builds software applications. Apart from
providing technical support and maintaining it, they are also
responsible for the coding, testing, and deployment of the
applications.

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

.Net The main focus of .NET consultants is to work on challenging,


Consultant large-scale, and cross-functional projects and provide the skills or
expertise required to create applications that are reliable, secure,
and scalable.

Software An ASP.NET developer builds applications or devices that can


Engineer understand the human language.
(ASP.NET)

t
aa
.NET Roles & Responsibilities

As a .NET developer, you will be responsible for creating code using .NET
lliP
framework languages like C#. You will be providing technical support for web
applications, desktop, and mobile applications. As a .NET developer, you should be
able to build a reliable, scalable application.

According to a .NET job description posted by Conduents on Google:

Job Role: .Net Developer


te

1. Responsibilities:
● As a .NET developer, you will be building a .NET application.
● As a .NET developer, a company expects you to know OOPS and SOLID
In

principles.
● You should have a good understanding of microservice architecture.
● As a .NET developer, you will be developing, managing, and testing APIs.
2. Skills Required:
● Good experience in cloud-native development
● Experienced in the waterfall and Agile software development lifecycle
● Should be proficient in C# and SQL

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved


.NET Interview Questions

Conclusion

We hope this set of .NET framework interview questions will help you prepare for
your interviews. We wish you luck in your endeavors!

Enroll today in our comprehensive .NET Course Online—to start your career or
enhance your skills in the field of automation and get certified today.

t
If you’re eager to explore additional UiPath interview questions in depth, feel free to join
Intellipaat’s .NET Community and get answers to your queries.

aa
lliP
te
In

Contact us: [email protected] / © Copyright Intellipaat / All rights reserved

You might also like