Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

ASP.NET Interview Questions: Tips for Hiring ASP.NET Developers

DZone's Guide to

ASP.NET Interview Questions: Tips for Hiring ASP.NET Developers

If you're looking to hire ASP.NET devs, check out these tips to help improve your chances of finding the cream of the crop!

· Web Dev Zone
Free Resource

Learn how to build modern digital experience apps with Crafter CMS. Download this eBook now. Brought to you in partnership with Crafter Software

There are hundreds of questions you could ask to determine a job candidate’s fit for an ASP.NET related position. Characteristics of a good candidate include high comfort level, skill level, and an in-depth understanding of essential and advanced development concepts.

The interview questions below make a good primer for screening employees working in the .NET framework. That said, this list will just get you started. The best interview questions will grow from the specific job offer, ideally identified by those already working in that department and on related tasks.

Best Practices for Interviewing ASP.NET Candidates

ASP.NET is a robust framework with rich possibilities that can vary widely depending on the business and/or team. Ideally, a brainstorming session with current team members is the best way to build a list of relevant and valuable questions.

Enlist all stakeholders. Build a list of potential interview questions from the job opening’s direct reports, collaborators, internal customers, and management.

Prioritize questions. Once a good long list of potential questions is developed, team members and other stakeholders can vote on individual items to produce a shorter, more usable list.

Tailor interview questions to match each candidate. For example, if a candidate proclaims a strong knowledge of C#, have him or her write a short C# FizzBuzz script. That may seem like a weak example since the FizzBuzz problem is a good simple test for just about any developer job opening. The main point is to look through the application for question ideas.

Use prefab questions as a starting point. Begin with the list below, then tailor the questions to fit the actual job description more closely. Come up with other questions that arise directly from the position.

Examples of ASP.NET Interview Questions for Experienced Candidates

The sample questions (and answers) below are a good starting point and should serve as a good gauge of whether an applicant grasps the basic concepts. They’re somewhat generic, which is why a more specific approach involving existing team members is favored.

What does “PostBack” mean in ASP.NET? A PostBack happens when a user takes some action (like submitting a form) that sends information from the page to the server via POST.

Explain the ASP.NET page life cycle in brief. ASP.NET goes through a series of stages in the life cycle of each page. Per Microsoft:

  • Page request. The user requests a page. ASP.NET decides whether to compile it or serve it from a cache.
  • Start. The page’s beginning conditions are set.
  • Initialization. On-page controls become available, and any themes are applied.
  • Load. ASP.NET uses the view state and control state properties to set the control properties.
  • Postback event handling. When applicable, user input is handled.
  • Rendering. ASP.NET saves the view state for the page and writes the output of rendering to the output stream.
  • Unload. The rendered page gets sent to the client. ASP.NET unloads page properties and performs cleanup.

What’s the Difference Between ASP.NET MVC and ASP.NET WebForms?

Web Forms were one of the first ways to create web apps with ASP.NET. They utilize a designer and server controls to make it easy to design a form with a point and click interface like Windows Forms applications.

MVC or the Model View Controller separates a web app into data, display, and actions. Proponents of MVC point to its simplicity, reusability, and “less buggy” nature.

In reality, both MVC and Web Forms are tools with different strengths for different applications. By the way, the new ASP.NET Razor Pages is a new framework that is sort of a hybrid of the two.

What Is View State in ASP.NET?

View state is data used to preserve page values and control values of Web Forms during postbacks.

Explain Briefly the Use of Global.asax.

Global.asax lets us write code that responds to “system level” events like starting up the app, ending a session, or errors, without having to add special, redundant code into each and every page on a website. We use it in Visual Studio by selecting Add > New Item > Global Application Class.

What’s the Difference Between Server.Transfer and Response.Redirect.

Server.Transfer sends information from one web request to another, all on the server side. A response is not sent to the browser to cause the change. On the other hand, Response.Redirect sends an HTTP 302 message to the browser and causes a redirect in the browser.

What Are the ASP.NET Session State Modes?

There are several different session state modes in ASP.NET. They provide different ways to store the session state.

  1. InProc mode is the default mode. It stores the session state in the web server memory.
  2. StateServer mode stores session state in a process known as the ASP.NET state service. If the app is restarted, the session state is preserved.
  3. SQLServer mode puts the session state in a SQL database. The session state is preserved if the web app restarts.
  4. Custom mode lets the developer specify a specialized storage provider.
  5. Off mode disables the session state.

List Some Different ASP.NET Validators.

  • Range Validator
  • Required Field Validator
  • Compare Validator
  • Regular Expression Validator
  • Custom Validator
  • Summary Validator
Can We Create a Web App With Both MVC and Web Forms?

We can use both methods to make pages by including assembly references in the Web Forms app.

Write a Short Script That Sends an Email With ASP.NET.

Ask a prospective employee to perform a simple coding task like the FizzBuzz example mentioned above, or to create a simple script like the one below. This example from ASP.NET Tutorials sends a simple email:

protected void Page_Load(object sender, EventArgs e)
{
try
{
MailMessage mailMessage = new MailMessage();
mailMessage.To.Add("your.own@mail-address.com");
        mailMessage.From = new MailAddress("another@mail-address.com");
        mailMessage.Subject = "ASP.NET e-mail test";
        mailMessage.Body = "Hello world,\n\nThis is an ASP.NET test e-mail!";
        SmtpClient smtpClient = new SmtpClient("smtp.your-isp.com");
        smtpClient.Send(mailMessage);
        Response.Write("E-mail sent!");
}
catch(Exception ex)
{
Response.Write("Could not send the e-mail - error: " + ex.Message);
}
}

Tools for Hiring Top Developers

Here are a few tools that go beyond just asking the right questions, helping you to source top talent for your development needs.

  • Devskiller provides software-based real-world IT tests for hiring developers. It’s flexible so it can be fit to any job opening.
  • Goodcore is an ASP.NET employment service.
  • Upwork compiles a list of the 10 best ASP.NET developers currently looking for work.
  • Toptal is a marketplace featuring the top 3% of freelance developers with expertise in various programming languages.

Conclusion

Obviously, you want to hire the best developer you can find, but you also want to hire a candidate who will fit well within your existing team. By asking the right questions and using best practices for hiring, you can hire a leading developer with the right mindset and skills that complement your existing team’s current capabilities.

Crafter is a modern CMS platform for building modern websites and content-rich digital experiences. Download this eBook now. Brought to you in partnership with Crafter Software.

Topics:
asp.net ,web dev ,web dev careers

Published at DZone with permission of Matt Watson, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}