views:

834

answers:

9

I do not want to ask candidates questions, but rather give them several problems to resolve. The reason for this is that I've seen people be excellent with theory, but when confronted by a real world c# issue, just couldn't hack it.

These c# problems should be simple enough that it won't take more than 1-20 minutes to resolve, yet complicated enough that I'd be able to weed out candidates that can't code.

Right now, I typically ask the applicants to reverse a string and remove duplicates from a List. This alone weeds out a large number of people.

Any other examples I could use?

Edit: I should have mentioned that this is for a standard c# gig, where they'll be writing business code rather than finding the most optimal way to implement a linked list.

A: 

BFS, DFS, Dijkstra, MaxFlow, Reachability, Priority Queue in O(log(n)), AVL Trees, Stacks, Queues, Lists, Dynamic Programing or some NP problem for test combination skills :-)

List of a NP-complete problems you can find at http://en.wikipedia.org/wiki/List_of_NP-complete_problems

Svisstack
+12  A: 

dont ask for knowledge of class libraries or obscure corners of the language (unsafe, dynamic, ..); smart people can pick these up or look them up.

I would ask to design a class hierarchy to represent something real world (vehicles, animals, ...). This usually flushes out the people who dont get objects. Make them do it with interfaces too. Also make them reverse a string - no harm in oldies but goldies

pm100
A lot of people don't like the "design an object model for a car" type questions. The major problem is that they normally don't give a context for why you want the OO model. I found this article with a bit of help from Google: http://www.nomachetejuggling.com/2010/04/06/avoiding-the-big-design-interview-question/
David Johnstone
But that's very true that you shouldn't ask about things that anybody could Google for in a minute, or obscure things that a smart person could quickly learn when they had to know. The only exception to this is if they advertise themself as a master of C#, in which case asking them some obscure questions is reasonable, as they should have come across many obscure things already.
David Johnstone
+3  A: 

One question I was asked, and subsequently ask interviewees, is"Describe how you would make this phone into an application". Have them describe the classes, their properties, methods, interfaces, etc. Then question them on why they chose to implement them in that specific way. It gives you a good idea if they understand how to code, and gives you some insight into how they approach and solve problems. Also, if you offer a suggestion of how they could have implemented it a different way, it may show you whether they are open to new ideas, criticism, or if they are a team player or not.

derek
+6  A: 

Show them a small section of code or architecture diagram from one of your own projects and ask them to suggest how they would refactor it. Even if you don't wind up hiring them, you might get some interesting suggestions on ways to improve your code.

Dan Bryant
this is an all to common practice and is deplorable in my opinion. I have seen it taken to extreme lengths. it just smells. IN MY OPINION.
Sky Sanders
after looking at your phrasing again, i realize that I may have reacted emotionally with my downvote. Let me remedy that. But I still think that hopes of free work would taint the process and perhaps leave the candidate with a bad taste in their mouth.
Sky Sanders
Certainly not recommending the software equivalent of bidding out a contract and stealing the plans to build it yourself, but I think it's a fair question if you frame it properly.
Dan Bryant
+15  A: 

I like picking simple problems that I actually had to solve at some point; it doesn't get more relevant to the job than that.

When I worked on VBScript I'd ask college candidates how to write a simplified version of DateDiff, since doing so was what I did my first real day of work at Microsoft. More advanced candidates I would ask how to build a device which tracks the relationship between 32 bit handles and an associated 64 bit pointer, which again I actually had to do when working on VBScript.

More recently I tend to ask questions about tree manipulation algorithms, since the compiler is all about tree manipulation. Or about how to codegen new operators using monads, since that's how LINQ works.

My point is not that you should use questions in these areas, my point is that surely you must have had problems that you had to solve in your day-to-day work. Ask the candidates about those problems -- then you'll learn how they solve a realistic problem, and they'll learn what sorts of problems they'd be solving if they came to work with you.

Eric Lippert
So just out of curiosity, how does one implement DateDiff for use in VBScript?
AngryHacker
@angryhacker: http://blogs.msdn.com/ericlippert/archive/2009/06/01/bug-psychology.aspx
Eric Lippert
@eric lippert. Wow, very interesting. I am not an expert in these things by any means, but why not just use a 64-bit integer to count the number of seconds since say Dec 30, 1899. Instead of using doubles with significant numbers. Sounds like it would be a lot more simpler and you'd get a perf benefit because of integer math.
AngryHacker
@AngryHacker: That would have been the smart thing to do. That is not what Lotus 1-2-3 did, and Excel was written to be compatible with Lotus, and VB was designed to work with Excel, and ... yeah, someone should have said 'this is dumb, let's write a translator from the goofy Lotus format to something sensible" but no one did and so that's what VB was stuck with until VB.NET. I blame Joel. :-)
Eric Lippert
+2  A: 

Fizz Buzz

pst
+1  A: 

Something mildly algorithmic.

  1. Write a method that returns true if a string is a palindrome, and false otherwise.
  2. Re-implement the String.Substring(int, int) method.

Something about object-oriented design too.

  1. Design a checkers game (ie, define the classes and some of the methods).
joemoe
+3  A: 

I agree with you, it is surprising how many people claim to be experienced and you find out that all that they did was read the box…

I don’t know if testing for C# is as valuable as it first seems… sure you could ask them to describe an example of when they needed to use inheritance, or why casting might have a performance problem, etc. But these are easy to study for. You would be surprised at how many interviewees give the example using “car” or “color” when giving their real world example of inheritance…. Guess they are in a book somewhere.

When looking at this problem it helps me when I compare experience in development to learning Spanish. A short time into the class everyone is conjugating verbs and can pass a test on this… but nobody speaks Spanish yet. You want the guy that claims to speak Spanish and can actually do it.

So I like to be more specific with the other technologies that will tell me if they have traveled the well-worn path of development. If they say they are an ASP.Net developer I ask them simple questions, but ones that are on the path

EXAMPLES: Give me an example of where the connection string could live? If you need to pass an ID from one page to another, what are your options? If a page takes 5 minutes to load, tell me how you would go about troubleshooting it. If I had a web page that had a single button on it, how would I center that button? Tell me the difference between storing variables in the viewstate verses session state?

You don’t have to know everything, but eighty percent of the people interviewing for a senior level position will get 10% of these types of questions right. (And on 70% of the phone interviews you will hear them Googling for the answers – good thing these aren’t the types of questions you can easily Google for.)

SQL Server is about the same. They say they would rate themselves an 8 or 9 in SQL Sever development, but then get 10% of questions. The questions again are to see if you have been on the well-worn path.

EXAMPLES: If you had a table of customers and a table of orders, how would you find the customers that had no orders? What is a clustered index? If I had a table of developers and a table of projects, how would I set it up so that projects could have multiple developers on it and developers could be on multiple projects?

How could you develop in SQL Server for “years” and not have hit these concepts? A high percentage of candidates get almost none of these answers right!! (I guess the SQL Server box isn’t as informative.)

So if you say you are a senior level guy and you can say “Soy un revelador de software” (I am a software developer), but can’t say “He hecho eso antes” (I have done that before), I don’t think you are the senior level person you are claiming to be.

Now this tells you if they have been on the well-worn path, but not if they are smart and have good problem solving skills. Having gone thru a ton of these types of interviews I can tell you that by the time the process is done you will be satisfied with having enough information to have a strong opinion on both of these issues. You might also see that by then giving them a problem set to solve is unnecessary.

JBrooks
+2  A: 

Building Eric's and other answers here, but answering as an only-ever-so-far-interviewee, what I would like in an interview is a kind of pair-programming 'test', where you sit down together facing the screen, and talk through a real-world problem.

I think there would be many advantages:

  • For the interviewee, being in front of a screen instead of facing the interviewer makes it easier to think about the problem rather than the interview.
  • For the interviewer, being with the interviewee while they look through the code and ask questions about the problem space would give a much greater insight into how the interviewee thinks, how they approach problems, and how they communicate and interact with others.

I would expect that it's more important and interesting to see a candidate thinking round the edges of your real-world problem, even if they don't completely solve it, than to have them get 10 out of 10 on come algorithmic test.

Benjol