Denny.NET

I can haz ASP.NET goodness?

About the author

Denny Ferrassoli
Developer at Casting Networks. MCP / .NET
E-mail me Send mail
Add to Technorati Favorites

Recent posts

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Some Interview Questions

Well I've been out on the chopping block lately getting some interviews. The first one sucked, needless to say I was not prepared. Anyways I came across a few interesting interview questions and thought I would share. They're mostly ASP.NET and not specific to any language except for question 1 which is for C#.

#1. Can you implement code in an abstract class?
I came from a VB.NET background and for some reason thought you couldn't (what the hell are interfaces then?? - D'oh!). Yes you can implement code in an abstract class! You can choose which properties and methods should be overridden by using the abstract keyword. The abstract keyword implicitly makes the method or property virtual whereas an interface is always virtual.

#2. Implement a function that will return a corresponding Fibonacci number: Fib(x)
Good old Fibonacci. Try creating a function that will add the sum of the previous 2 numbers. Example:

0 1 2 3 4 5 6  7...
------------------
0 1 1 2 3 5 8 13...

If we passed 6 into Fib(x) it should return 8 because it adds 3 and 5 (the two previous sums). This is a cool function because it can be implemented in about 2 lines of code (in a recursive function)! Try it yourself and then take a look at: http://en.csharp-online.net/Calculate_Fibonacci_number - It took me about 45 minutes to finally see the light, I was always slow at math.

#3. What is the order of Page_Load events if you have a page that uses a Master Page, the Content Page and a User Control? What if the User Control's PageOutput is set to cache the control?
I admit I goofed this one up. The events are as follows: Content Page, Master Page, User Control. And what about caching? The first time the page is loaded the control's Page_Load event will fire. It will not fire any further until it is removed from the cache. So while the User Control is cached the events are only Content Page and then Master Page. That will save you a lot of processing! (Makes sense doesn't it?)

#4. Create a regular expression to match the following: (xxx) xxx-xxxx
Ok, so unless you translate all your favorite books into hexadecimal and read them that way then you probably don't want to touch Regular Expressions. What in the world are all those slashes, squiggly's, dots, parenthesis and what not doing in there!! Well there's a good place to learn: www.regexlib.com and check out the Cheat Sheet. Anyways here's what I came up with (although at the interview I omitted the ^ and $):

^\(\d{3}\)\s\d{3}-\d{4}$

Yes that translates into a phone number :)

More to come... maybe...

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:
Categories: Management
Posted by SuperGhost on Monday, June 18, 2007 8:33 PM
Permalink | Comments (2) | Post RSSRSS comment feed

Comments

Josh Stodola

Tuesday, June 19, 2007 10:34 AM

Josh Stodola

Afff, what happened to the classic laid back interviews where all they want to know is about YOU? That's how my last interview was. Sure we talked about programming, but nothing specific and I definitely didnt get a list of questions! I let my code do the talking after being hired, and I think that's how it should be. One's intellectual and communication skills should be the first things that get evaluated.

Alex

Monday, July 16, 2007 3:58 PM

Alex

We want new postings! We want new postings!

-Both of your regular visitors

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading