FullStackFSCCafé
 
 
Sign in with GoogleSign in with Google. Opens in new tab
Kill Your Tech Interview
3877 Full-Stack, Algorithms & System Design Interview Questions
Answered To Get Your Next Six-Figure Job Offer
      
🤖 Having Machine Learning & DS Interview? Check  MLStack.Cafe - 1704 Data Science & ML Interview Questions & Answers!Having ML & DS Interview? Check 🤖 MLStack.Cafe - 1704 ML & DS Interview Questions and Answers

37 ASP.NET Interview Questions You Must Know

The average ASP NET MVC Developer salary in USA is $110,000 per year or $56.41 per hour. Entry level positions start at $71,875 per year while most experienced workers make up to $175,500 per year. Have a look at this list of 37 essential ASP.NET interview questions to advance your career in 2019.

Q1: 
What is ViewData?

Answer

ViewData contains the key, value pairs as dictionary and this is derived from class  ViewDataDictionary. In action method we are setting the value for viewdata and in view the value will be fetched by typecasting.


Having Tech or Coding Interview? Check 👉 54 ASP.NET Interview Questions
Source: medium.com

Q2: 
Can ASP.NET Core work with the .NET framework?

Answer

Yes. This might surprise many, but ASP.NET Core works with .NET framework and this is officially supported by Microsoft.

ASP.NET Core works with:

  • .NET Core framework
  • .NET framework

Having Tech or Coding Interview? Check 👉 54 ASP.NET Interview Questions

Q3: 
Explain startup process in ASP.NET Core?

Answer

Everything starts from Program.cs

public static void Main(string[] args)
{
    BuildWebHost(args).Run();
}
 
public static IWebHost BuildWebHost(string[] args) =>
    WebHost.CreateDefaultBuilder(args)
        .UseStartup<Startup>()
        .Build();

CreateDefaultBuilder extension method will create a default configuration which will look first into appsettings.json files then will look for Environment variables and at the end, it will use command line arguments.

This part will also set up default logger sources (debug and console) and load the settings for logging from appsettings.json.

After the CreateDefaultBuilder finishes, then Startup class is executed. First, the constructor code is executed. After that, services are added to DI container via AddServices method that lives in Startup class. After that, an order of middleware that will handle every incoming request is set up.


Having Tech or Coding Interview? Check 👉 54 ASP.NET Interview Questions

Q4: 
What are the Advantages of Using ASP.NET Web API?

Answer

Using ASP.NET Web API has a number of advantages, but core of the advantages are:

  • It works the HTTP way using standard HTTP verbs like GET, POST, PUT, DELETE, etc. for all CRUD operations
  • Complete support for routing
  • Response generated in JSON or XML format using MediaTypeFormatter
  • It has the ability to be hosted in IIS as well as self-host outside of IIS
  • Supports Model binding and Validation
  • Support for OData

Having Tech or Coding Interview? Check 👉 33 ASP.NET Web API Interview Questions

Q5: 
What exactly is an application pool? What is its purpose?

Answer

Application pools allow you to isolate your applications from one another, even if they are running on the same server. This way, if there is an error in one app, it won't take down other applications.

Additionally, applications pools allow you to separate different apps which require different levels of security.


Having Tech or Coding Interview? Check 👉 54 ASP.NET Interview Questions

Q6: 
What is ASP.NET Core?

Answer

ASP.NET Core is a brand new cross-platform web framework built with .NET Core framework. It is not an update to existing ASP.NET framework. It is a complete rewrite of the ASP.NET framework. It works with both .NET Core and .NET Framework.

Main characterestics of ASP.NET Core:

  • DI Container which is quite simple and built-in. You can extend it with other popular DI containers
  • Built-in and extensible structured logging. You can redirect output to as many sources as you want (file, Azure, AWS, console)
  • Extensible strongly typed configuration, which can also be used to reload at run-time
  • Kestrel – new, cross-platform and super fast web server which can stand alone without IIS, Nginx or Apache
  • New, fully async pipeline. It is easily configured via middleware
  • ASP.NET All meta package which improves development speed, and enables you to reference all Microsoft packages for ASP.NET Core and it will deploy only those that are being used by your code
  • There is no web.config. We now use appsettings.json file in combination with other sources of configuration (command line args, environment variables, etc.)
  • There is no Global._asax – We have _Startup.cs which is used to set up Middleware and services for DI Container.

Having Tech or Coding Interview? Check 👉 54 ASP.NET Interview Questions

Q7: 
What is ViewState?

Answer

View State is the method to preserve the Value of the Page and Controls between round trips. It is a Page-Level State Management technique. View State is turned on by default and normally serializes the data in every control on the page regardless of whether it is actually used during a post-back.

A web application is stateless. That means that a new instance of a page is created every time when we make a request to the server to get the page and after the round trip our page has been lost immediately


Having Tech or Coding Interview? Check 👉 54 ASP.NET Interview Questions

Q8: 
What is a postback?

Answer

A postback originates from the client browser. Usually one of the controls on the page will be manipulated by the user (a button clicked or dropdown changed, etc), and this control will initiate a postback. The state of this control, plus all other controls on the page (known as the View State) is Posted Back to the web server.


Having Tech or Coding Interview? Check 👉 54 ASP.NET Interview Questions
🤖 Having Machine Learning & DS Interview? Check  MLStack.Cafe - 1704 Data Science & ML Interview Questions & Answers!Having ML & DS Interview? Check 🤖 MLStack.Cafe - 1704 ML & DS Interview Questions and Answers

Q9: 
What is the difference between ASP.NET and ASP.NET MVC?

Answer

ASP.NET, at its most basic level, provides a means for you to provide general HTML markup combined with server side "controls" within the event-driven programming model that can be leveraged with VB, C#, and so on. You define the page(s) of a site, drop in the controls, and provide the programmatic plumbing to make it all work.

ASP.NET MVC is an application framework based on the Model-View-Controller architectural pattern. This is what might be considered a "canned" framework for a specific way of implementing a web site, with a page acting as the "controller" and dispatching requests to the appropriate pages in the application. The idea is to "partition" the various elements of the application, eg business rules, presentation rules, and so on.

Think of the former as the "blank slate" for implementing a site architecture you've designed more or less from the ground up. MVC provides a mechanism for designing a site around a pre-determined "pattern" of application access, if that makes sense. There's more technical detail to it than that, to be sure, but that's the nickel tour for the purposes of the question.


Having Tech or Coding Interview? Check 👉 54 ASP.NET Interview Questions

Q10: 
Compare WCF vs ASP.NET Web API?

Answer
  • Windows Communication Foundation is designed to exchange standard SOAP-based messages using variety of transport protocols like HTTP, TCP, NamedPipes or MSMQ, etc.
  • On the other hand, ASP.NET API is a framework for building non-SOAP based services over HTTP only.

Having Tech or Coding Interview? Check 👉 33 ASP.NET Web API Interview Questions

Q11: 
Explain Middleware in ASP.NET Core?

Answer

Middleware is actually sequential series of delegates (piece of code), that can either short-circuit or pass on the HTTP request to next delegate. These are known as middleware, a concept well known to people who worked with Node.js.

Piece of your middleware can do one of the following:

  • Handle an incoming HTTP request by generating an HTTP response (maybe your authentication or authorization middleware will stop the request early and immediately create response)
  • Process the incoming request, change it and pass it to the next middleware in the pipeline
  • Process the outgoing response, change it and pass it on to next middleware in the pipeline or directly to the ASP.NET Core web server

Having Tech or Coding Interview? Check 👉 54 ASP.NET Interview Questions

Q12: 
How can we prevent browser from caching an ASPX page?

Answer

We can SetNoStore on HttpCachePolicy object exposed by the Response object's Cache property:

Response.Cache.SetNoStore();
Response.Write(DateTime.Now.ToLongTimeString ());

Having Tech or Coding Interview? Check 👉 54 ASP.NET Interview Questions
Source: guru99.com

Q13: 
In which event of page cycle is the ViewState available?

Answer

After the Init() and before the Page_Load().


Having Tech or Coding Interview? Check 👉 54 ASP.NET Interview Questions
Source: guru99.com

Q14: 
What are the different types of caching?

Answer

ASP.NET has 3 kinds of caching :

  1. Output Caching,
  2. Fragment Caching,
  3. Data Caching.

Having Tech or Coding Interview? Check 👉 54 ASP.NET Interview Questions
Source: guru99.com

Q15: 
What are the sub types of ActionResult?

Answer

ActionResult is used to represent the action method result. Below are the subtypes of ActionResult:

  • ViewResult
  • PartialViewResult
  • RedirectToRouteResult
  • RedirectResult
  • JavascriptResult
  • JSONResult
  • FileResult
  • HTTPStatusCodeResult

Having Tech or Coding Interview? Check 👉 54 ASP.NET Interview Questions
Source: medium.com
🤖 Having Machine Learning & DS Interview? Check  MLStack.Cafe - 1704 Data Science & ML Interview Questions & Answers!Having ML & DS Interview? Check 🤖 MLStack.Cafe - 1704 ML & DS Interview Questions and Answers

Q16: 
What exactly is the difference between .NET Core and ASP.NET Core?

Answer

.NET Core is a runtime. It can execute applications that are built for it.

ASP.NET Core is a collection of libraries that form a Framework for building web applications. ASP.NET Core libraries can be used on both .NET Core and the "Full .NET Framework" (what has shipped with windows for many years).


Having Tech or Coding Interview? Check 👉 54 ASP.NET Interview Questions

Q17: 
What is ViewState? How is it encoded? Is it encrypted? Who uses ViewState?

Answer

View state is a kind of hash map (or at least you can think of it that way) that ASP.NET uses to store all the temporary information about a page - like what options are currently chosen in each select box, what values are there in each text box, which panel are open, etc. You can also use it to store any arbitrary information.

The entire map is serialized and encoded and kept in a hidden variable (__VIEWSTATE form field) that's posted back to the server whenever you take any action on the page that requires a server round trip. This is how you can access the values on the controls from the server code. If you change any value in the server code, that change is made in the view state and sent back to the browser.

Just be careful about how much information you store in the view state, though... it can quickly become bloated and slow to transfer each time to the server and back.

It's not encrypted at all. Just base encoded, which easily reversible.


Having Tech or Coding Interview? Check 👉 54 ASP.NET Interview Questions

Q18: 
What is the difference between Server.Transfer and Response.Redirect?

Answer
  • In Server.Transfer page processing transfers from one page to the other page without making a round-trip back to the client's browser. This provides a faster response with a little less overhead on the server. The clients url history list or current url Server does not update in case of Server.Transfer.

  • Response.Redirect is used to redirect the user's browser to another page or site. It performs trip back to the client where the client's browser is redirected to the new page. The user's browser history list is updated to reflect the new address.


Having Tech or Coding Interview? Check 👉 54 ASP.NET Interview Questions
Source: guru99.com

Q19: 
What's the difference between REST & RESTful?

Answer
  • Representational state transfer (REST) is a style of software architecture. As described in a dissertation by Roy Fielding, REST is an "architectural style" that basically exploits the existing technology and protocols of the Web.
  • RESTful is typically used to refer to web services implementing such an architecture.

Having Tech or Coding Interview? Check 👉 46 API Design Interview Questions

Q20: 
How to choose between ASP.NET 4.x and ASP.NET Core?

Answer
Join FullStack.Cafe to open this Answer. It's Free!
Sign in with GoogleSign in with Google. Opens in new tab
Join 120k+ Developer Who Trust FullStack.Cafe

Q21: 
What are the different Session State management options available in ASP.NET?

Answer
Join FullStack.Cafe to open this Answer. It's Free!
Sign in with GoogleSign in with Google. Opens in new tab
Join 120k+ Developer Who Trust FullStack.Cafe

Q22: 
What are the different types of cookies in ASP.NET?

Answer
Join FullStack.Cafe to open this Answer. It's Free!
Sign in with GoogleSign in with Google. Opens in new tab
Join 120k+ Developer Who Trust FullStack.Cafe
🤖 Having Machine Learning & DS Interview? Check  MLStack.Cafe - 1704 Data Science & ML Interview Questions & Answers!Having ML & DS Interview? Check 🤖 MLStack.Cafe - 1704 ML & DS Interview Questions and Answers

Q23: 
What is Katana?

Answer
Join FullStack.Cafe to open this Answer. It's Free!
Sign in with GoogleSign in with Google. Opens in new tab
Join 120k+ Developer Who Trust FullStack.Cafe

Q24: 
What is HttpModule in ASP.Net?

Answer
Join FullStack.Cafe to open this Answer. It's Free!
Sign in with GoogleSign in with Google. Opens in new tab
Join 120k+ Developer Who Trust FullStack.Cafe

Q25: 
What is an HttpHandler in ASP.NET? Why and how is it used?

Answer
Join FullStack.Cafe to open this Answer. It's Free!
Sign in with GoogleSign in with Google. Opens in new tab
Join 120k+ Developer Who Trust FullStack.Cafe

Q26: 
What is the difference between web config and machine config?

Answer
Join FullStack.Cafe to open this Answer. It's Free!
Sign in with GoogleSign in with Google. Opens in new tab
Join 120k+ Developer Who Trust FullStack.Cafe

Q27: 
What is the difference between <system.web> and <system.webServer>?

Answer
Join FullStack.Cafe to open this Answer. It's Free!
Sign in with GoogleSign in with Google. Opens in new tab
Join 120k+ Developer Who Trust FullStack.Cafe

Q28: 
What's the difference between OpenID and OAuth?

Answer
Join FullStack.Cafe to open this Answer. It's Free!
Sign in with GoogleSign in with Google. Opens in new tab
Join 120k+ Developer Who Trust FullStack.Cafe

Q29: 
Are static class instances unique to a request or a server in ASP.NET?

Answer
Unlock FullStack.Cafe to open all answers and get your next figure job offer!
Share this blog post to open Expert question!
🤖 Having Machine Learning & DS Interview? Check  MLStack.Cafe - 1704 Data Science & ML Interview Questions & Answers!Having ML & DS Interview? Check 🤖 MLStack.Cafe - 1704 ML & DS Interview Questions and Answers

Q30: 
Explain the difference between WCF, Web API, WCF REST and Web Service?

Answer
Unlock FullStack.Cafe to open all answers and get your next figure job offer!
Share this blog post to open Expert question!

Q31: 
Name some ASP.NET WebForms disadvantages over MVC?

Answer
Unlock FullStack.Cafe to open all answers and get your next figure job offer!
Share this blog post to open Expert question!

Q32: 
What exactly is OWIN and what problems does it solve?

Answer
Unlock FullStack.Cafe to open all answers and get your next figure job offer!
Share this blog post to open Expert question!
 

Rust has been Stack Overflow’s most loved language for four years in a row and emerged as a compelling language choice for both backend and system developers, offering a unique combination of memory safety, performance, concurrency without Data races...

Clean Architecture provides a clear and modular structure for building software systems, separating business rules from implementation details. It promotes maintainability by allowing for easier updates and changes to specific components without affe...

Azure Service Bus is a crucial component for Azure cloud developers as it provides reliable and scalable messaging capabilities. It enables decoupled communication between different components of a distributed system, promoting flexibility and resili...

Cosmos DB has gained popularity among developers and organizations across various industries, including finance, e-commerce, gaming, IoT, and more. Follow along and learn the 24 most common and advanced Azure Cosmos DB interview questions and answers...
More than any other NoSQL database, and dramatically more than any relational database, MongoDB's document-oriented data model makes it exceptionally easy to add or change fields, among other things. It unlocks Iteration on the project. Iteration f...
Unit Tests and Test Driven Development (TDD) help you really understand the design of the code you are working on. Instead of writing code to do something, you are starting by outlining all the conditions you are subjecting the code to and what outpu...
Domain-Driven Design is nothing magical but it is crucial to understand the importance of Ubiquitous Language, Domain Modeling, Context Mapping, extracting the Bounded Contexts correctly, designing efficient Aggregates and etc. before your next DDD p...
At its core, Microsoft Azure is a public cloud computing platform - with solutions including Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS) that can be used for services such as analytics, virtual c...
As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications. Follow along to refresh your knowledge and explore the 52 most frequently asked and advanced Node JS Interview Questions and Answers every...
Dependency Injection is most useful when you're aiming for code reuse, versatility and robustness to changes in your problem domain. DI is also useful for decoupling your system. DI also allows easier unit testing without having to hit a database and...