ASP.NET Interview Questions
I do a LOT of interviewing here, and for a while we were hiring ASP.NET people. Here's some of the questions that I asked them. I came up with these questions because you'd "just know" this stuff if you spent time working on a REAL WORLD ASP.NET site - through design, development, debugging, production debugging, and deployment.
Do they suck? Did I miss any? How do you think people did?
- From constructor to destructor (taking into consideration Dispose() and the concept of non-deterministic finalization), what the are events fired as part of the ASP.NET System.Web.UI.Page lifecycle. Why are they important? What interesting things can you do at each?
- What are ASHX files? What are HttpHandlers? Where can they be configured?
- What is needed to configure a new extension for use in ASP.NET? For example, what if I wanted my system to serve ASPX files with a *.jsp extension?
- What events fire when binding data to a data grid? What are they good for?
- Explain how PostBacks work, on both the client-side and server-side. How do I chain my own JavaScript into the client side without losing PostBack functionality?
- How does ViewState work and why is it either useful or evil?
- What is the OO relationship between an ASPX page and its CS/VB code behind file in ASP.NET 1.1? in 2.0?
- What happens from the point an HTTP request is received on a TCP/IP port up until the Page fires the On_Load event?
- How does IIS communicate at runtime with ASP.NET? Where is ASP.NET at runtime in IIS5? IIS6?
- What is an assembly binding redirect? Where are the places an administrator or developer can affect how assembly binding policy is applied?
- Compare and contrast LoadLibrary(), CoCreateInstance(), CreateObject() and Assembly.Load().
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.



About Newsletter
Olly...which ones didn't you get?
The last question threw me off just like Andy. Not that I couldn't answer it (actually I couldn't.. convincingly... :-)) -- just can't see the relevance to ASP.NET. Plus your historical perspective goal is laudable but regular 9.00-5.00 programmers hardly get into that frame of mind IMHO.
cheers!
How did most people fare?
Good thought about the stump the candidate...that's not the intent, but the IDon'tKnow issue comes up a lot. I hate it when folks don't say I don't know. I say it FIRST just to get it out of the way :)
The only other caveat I might add would be to the first question... I know the events exist, and I know how/when/why I would use them, and I know where to look if I want the complete list, but I could not list them all off the top of my head.
The rest are pretty good. I've asked a couple of those. I might also ask about the various places you can store data (cache, session, viewstate, etc.) and the different pros/cons about them. You'd be surprised at the number of people whose experience ends with the word "cookie."
I've also asked: Say you have a class in your ASP.NET app with a static numeric variable. Could you, or could you not, use the variable as a page hit counter, and why?
Sorry, i am being facetitious (sp?).
* Is more than just a "File|New Website" and "Page_Load" person!
* Cares about technology and digs to learn how it works
* Has a sense of history, which will make them a better and deeper debugger
I don't care if the guy has MSDN in his head, I want to know how much of a problem solver he/she is.
I've been doing asp.net for 2 ish years now and I couldnt answer most of the questions off the top of my head, but I know why you are asking each one and the problems areas they cover, i just stopped trying to learn everything off the top of my head. What I do now is learn where the issues are and where the answers are when I need them. Although thanks to teched I know the answers to the versioning one backwards.
Considering the size of .NET, even if you are specializing in ASP.NET Im not sure this type of questioning will find you a problem solver, it will find you someone who can remember stuff, not necesarily be able to do anything with it.
How's it worked out for you so far ? Did you find the dev your looking for? If so perhaps I'll ask a couple of these myself (I do tend to ask the page lifecycle one quite a lot though).
Any questions you ask really should just give you the binary result - "hire / no hire". http://www.joelonsoftware.com/articles/fog0000000073.html
is it hire or no hire if person doesn't know where ASP.NET is hosted on IIS5? no clue! is it hire or no hire if he never used ASHX files before? no clue. "F1" questions won't help you determine that at all.
I would structure it
1) Couple ASP.NET fundamental questions (like viewstate)
2) Couple general fundamental questions (what is design pattern? difference between type and interface? design by contract?)
3) couple puzzle questions: http://discuss.fogcreek.com/techinterview/
Then determine: is he smart? does he understand fundamentials? HIRE! (he will learn all the ASP.NET MSDN details in few days anyway) otherwise: NO HIRE.
BTW, would you hire someone who only has a BSEE instead of a CS degree? My contracting company was not able to present me to your company b/c of my degree. Just wondering...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/httphandl.asp
"I don't care if the guy has MSDN in his head, I want to know how much of a problem solver he/she is. "
But you're not asking problem solving questions, you're asking factoid questions. I ran into this a lot in college, specifically in the science classes I took. If you want to know about a persons problem solving skills and gauge their knowledge at the same time, you should create questions that use specific pieces of knowledge, "factoids", when solving a problem. Take these two questions.
"How does ViewState work and why is it either useful or evil?"
and
"From constructor to destructor (taking into consideration Dispose() and the concept of non-deterministic finalization), what the are events fired as part of the ASP.NET System.Web.UI.Page lifecycle. Why are they important? What interesting things can you do at each?"
Anyone can memorize those questions and regurgitate them upon demand. What you're looking for is someone who can apply that knowledge. Why not ask a question like "If you wanted to handle the storage of data to the viewstate on a page, how would you do it? Can you think of any reasons why you might have to do this?".
Your list reads like a college professors exam. ;)
Do you really believe that one can be an effective developer without knowing half of these questions? Don't you think it's important to have a deep understanding of the underlying platform?
Everyone, tell me this: what is filling the developer's brain, if not details like these?
The question is, do you want someone who could pass a test or do you want to see how someone uses the knowledge they have? Sure you can weed out some people by asking them specific factoids. "Oh I see you put down you are a COM expert, how would you use CoCreateInstance?". You could study up on HttpHandlers right before the interview and pass your quiz without ever having written one!
Again, I don't feel that asking a candidate these questions is really interviewing them. You are just testing them and asking them to regurgitate information. You're quizzing them. That's just my take on it. I'm sure your interview is more than just a pop quiz. I'm assuming that you only posted the ASP.NET related questions because there are a TON of other questions related to information architecture, UI design, HTML and DHTML that I would ask a prospective ASP.NET developer. If the person can't write a RegExp in Javascript and s/he's applying for an ASP.NET position, I don't care if s/he can write a COM server. I don't want to have to spend all my time tutoring someone in HTML and Javascript or correcting layout.
P.S. The ASP.NET page lifecycle events are on page 49 of Fritz Onion's "Essential ASP.NET" book which is right beside my desk. If you know where to look up the factoids, do you need to memorize them? EVentually with experience you'll learn them all. That's the one thing I did get from my college degree, knowledge comes from experience and use your resources.
Here is what I think the problem is. As a developer, you learn a boatload of stuff about .NET. But, not necessarily just ASP.NET. For e.g., I have been working with ASP.NET off and on for the past couple of years. My main line work was still in VB6,Java and classic ASP.
Now, considering that, I have worked with C#, ASP.NET, ADO.NET, web services, VB.NET and XML (extensively). Now, with that in mind, do you really think that I will be able to actually get to the bowels of these systems individually? I love knowing the nitty gritty. So, I read up on IL. But, beyond that, most of what I learnt was to make sure I got my job done. If my job description was "ASP.NET developer only, dont bother with build (NAnt), test (NUnit), deploy (MSI/Installshield), Database (ADO.NET),s ervices ([WebService])", probably, I could have learnt everything that is possibly there about ASP.NET.
But, Given the state of technology flood we have with .NET 1.0, 1.1 and 2.0, it would be impossible for one person to be an "expert" in one technology. Most of us are usually "jack of all trades".
Of course, its just my opinion and I could be wrong.
Do you really believe that one can be an effective developer without knowing half of these questions?
--------
I do, as well as many other people posting comments here. I liked what 'girish' had to say...to be a web developer, there are so many technologies you have to know, that it is near impossible to learn everything about every one of the technologies today. An effective developer just has to have a good overall understanding of them all, then know how to find the answer to any problem fast (search, help, newsgroups, magazines, MSDN, etc.). As you gain experience, you do begin to master various pieces of web development. Does it require mastery to be an "effective" developer though...not in my opinion.
--------
Don't you think it's important to have a deep understanding of the underlying platform?
--------
That's a good question. It really depends on the level of developer you are looking to hire, and it depends on the type of applications that the person will be building. Certainly, the more you know about your profession, the more valuable you become to an employer. Still, if you are looking for a senior ASP.net person, you won't even be considering people under a certain number of years of experience. Nobody works years in web development and does not pick up tricks and workings of parts of the underlying systems. Maybe it comes down to how you determine the value of a candidate that you know nothing about. I believe that a great interviewer can tell in a short time whether a candidate is intelligent and clever-enough to be able to handle the given position, without even asking a single technical question.
When I was younger and more hubristic, I used to ask stuff like this but as most commenters have noted - the minutiae is irrelevant. The ability for an applicant to solve complex problems is more interesting to than if they've memorized the page events.
As the old saying goes - tests are difficult for any man because even the greatest fool can ask questions the wisest man can't answer. ;-)
"Too much dependency on generic MSDN knowledge, too little of real problem solving questions. Postback and Viewstate questions are good since its fundamental ASP.NET concepts, the rest is so-so next to just bad."
No pattern questions? How about this: Describe how Web Forms relate to the MVC design pattern?
Gang of Four: What is Singleton, Factory? Compare object composition to inheritance, which is better (maybe neither)?
Where are the OO questions? Example: open-close principle, fragile base class problem, law of demeter,etc.
If they knew all the technicalities of .NET that you're looking for but none of these other questions I'd be scared to hire them. After all, I'd want someone that knows how to *design* software, not simply hack it.
"Have you ever seen a grown man naked?"
Alternately, from the book "Showstopper" (about the development of NT ~ 1990), an interview question asked of candidates for Dave Cutler's secretary:
"How do you feel about the word 'F**k'?"
"It's my favorite word."
Brilliant :)
I also agree with what Jeff K said above. Having been a consultant all my adult life, the best developers I've worked with haven't been the MSDN savant's - but developers who had strong fundamental development skills, excellent problem solving skills, and the nerve to admit early that they dont understand an issue.
I wouldn't ask them asp.net 2.0 questions yet? 1.1 is so vast, many people don't know 50% of it.
I would concentrate my question on real life production work.
- Questions on security like how to stop sql injections and cross site scripting, trust levels, encryption ...etc
- Questions in performance and optimization like caching, round trips, select statements..etc
Plus some general troubleshooting ones like what do you do when such and such happens.
Abdu
I would be looking for a much broader set of skills: design/architecture, performance tuning, some UML, some patterns, data modeling, db transactions, security, problem solving, state management, load balancing, IIS, deployment, social skills, C#/VB.NET, on and on. Ideally the candidate will have a history of successful products/projects. Having an MCSD for .NET also helps: it shows initiative and interest in learning. My 2 cents.
I'm willing to take a leap here and say that while this kind of knowledge is probably important, we all know that the coding is a small part of the software development process. I'd take a coder new to ASP.NET that understood how to elicit and document requirements, verify and validate those requirements against a specification and had a track record of success before I'd take an ASP.NET academic who could answer the above questions but couldn't answer questions about software lifecycle.
As far as problem solving goes, I advocate a challenge within the domain the candidate is being considered for. "Write me an ASP.NET page that pulls from this database and displays this data. Allow a user to edit it. Make sure you validate this data against these rules. Then send we your solution by next Monday."
Good talkers and memorizers can fool you. Someone forced to DO something has a higher probability of producing results on which a good decision can be made.
Yes. I am an effective developer, in ASP .NET I might add, and I don't know the answer to half your questions off the top of my head.
"Don't you think it's important to have a deep understanding of the underlying platform?"
Yes and No. Yes it's important to understand that ASP .NET is a web environment, but no it's not important to have all the details of how the underlying infrastructure works. That might be useful information in some contexts, but for the applications I've worked on, it's been irrelevant. Of course, on some level I'm making use of all that information, but the beauty of OOP is that I don't have to know how all of the components I use work internally. The beauty of ASP .NET is that in most cases (at least the cases I've worked on) the complexities of the underlying architecture are hidden from me, leaving me free to create the solution. If I'm a System Admin then it's a different ballgame, but not as the developer.
"Everyone, tell me this: what is filling the developer's brain, if not details like these?"
I can't speak for everyone else, but my head is filled with strategies and approaches. I spend my time designing strategies to solve problems. I don't worry too much about the details because I can look those up as needed in any of hundreds of books. On rare occasion a detail makes me rethink some part of my development strategy, but on a fundamental level my designs remain intact.
Great blog btw.
are you realy think, that candidat should know this:
- J# (LoadLibrary())
- Win32 API (CoCreateInstance())
and
- ASP.NET 2.0
I find these questions as little over... ;)
was able to answer them all. I do a lot of msdn reading, there's no
problem solving skills involved in any.
I used to work a lot in firmware - our products may ship one year with a particular MPU, the next with a different set of PIO's and the next a completely changed architecture. I didn't care so much that a developer knew the language jargon, or the specific language library, or could recite the complete mnemonic instruction set...I was more interested in their problem solving skills.
How do they approach a difficult problem? Are they resourceful? Can they find the information and apply it to the situation effectively?
Perhaps this is why so many IT departments have such a high turn over - because they have managers who may know their product well, but are actually shallow in their overall IT strengths and rely heavily on jargon and product centric minutiae.
..just a thought :)
http://www.geocities.com/dotnetinterviews/
Comments are closed.
I'm going to assume that LoadLibrary is a C Win32 thing, CoCreateInstance i think is a COM thing, and the fog of memory seems to recall that CreateObject is a VB/VBScript thing.
What do these have to do with asp.net? Do you really think a dev would "just know" the minutae ( or heck, even what they are ) of these functions after developing a real world asp.net app?
Now, some might say that somebody who doesn't know this stuff isn't worth hiring... and obviously it's fine to have your opinion on that, but to say that it's indicative of your competency for developing asp.net apps... seems dubious.