views:

742

answers:

9

I'm conducting an interview in 45 min (my second ever!) for a candidate who's pretty junior and states she knows VB and C#. I do not have any experience in either of those languages.

Does anyone have any good simple interview questions for these languages that I can ask that will be informative without being too intimidating?

Note: I'm looking for language-specific ones, and not of the FizzBuzz variety (which I'm already planning on asking).

Related Question
http://stackoverflow.com/questions/70763/good-c-interview-questions-for-a-senior-dev-position


UPDATE: It's over - and thanks everyone! As Jon Skeet says - it's hard to ask questions to which you don't know the answers but I did find that her reaction to the question being asked, even without the answer, was pretty telling and showed me immediately whether or not she was familiar with the concepts being presented.

+4  A: 

There are numerous lists on the web.

The C# ones one Mark Wagner's blog are quite good and range from the fairly simple to quite hard so you can go as deep as you like. However, as the commentators have pointed out some of them are in danger of becoming out date (if they're not already) - so use them as a guide.

ChrisF
I've got a problem with quite a few of his answers. Particularly 'everything derives from system.object' that's just a plain untruth - what about interfaces and System.IntPtr?Also having been thoroughly kicked about this on SO myself, structs are not always allocated on the stack ( e.g if they are inlined in a class ), also the statement 'larger overhead but faster retrieval' is just plain bizzare
zebrabox
Some questions are outdated, like the Hashtable question. Well, Hashtable would be a good answer but Dictionary too. But there are good basic questions in there. +1
Meta-Knight
I disagree with those "trivia" based questions. Perhaps if you're taking a BrainBench test or something similiar, but in interview that style of question should be limited.
System.IntPtr derives from object. It's pointer types that do not derive from object and are not convertible to object.
Eric Lippert
I'm marking this one as correct since I found it to be the most helpful.
MCS
+1  A: 

here is an online list revealed by a google search: http://dev.fyicenter.com/Interview-Questions/C-sharp/

and here is another

Muad'Dib
+1  A: 

Look here, maybe you can pick up something not too senior:

Questions every good .NET developer should be able to answer?

Good C# Interview Questions for a Senior Dev Position

Developer Art
+15  A: 

The problem with asking language-specific questions for a language you don't know yourself is that if any of the answers deviate from the specific ones you've been given here, you won't know if they're right or not. (I humbly suggest that most of the answers given so far suffer from that problem.)

Do you have a laptop available, so you can get them to code and see whether the result is the desired output? If so, FizzBuzz-style questions are a good start, and while you won't be able to judge the idiomatic style of the code you can at least see if it works :)

I find that a useful question to ask is what the candidate likes and dislikes about the language. What would they change if they could?

Jon Skeet
Downvoter: care to give a reason?
Jon Skeet
For sure what you're saying is true - I couldn't tell if something was right or not (I wasn't even sure if C# supports multiple inheritance!). But at least I was able to tell that she knew what inheritance was.
MCS
@Jon: by seeing how others use it in code samples. MSDN has a small code sample for almost everything, and the ones that implement IDisposable are invariably wrapped in a "using" statement.
Robert Harvey
@Robert: That strikes me as an incredibly inefficent and unreliable way to program compared with taking a couple of minutes to read up on what the using statement actually does. I personally wouldn't want to hire anyone taking that approach to programming... it's much too much like cargo cult programming for my tastes.
Jon Skeet
Yikes. I guess I've been told off.
Robert Harvey
@Robert: Knowing the language you're using is something I feel pretty passionately about :) I've seen too many people cutting and pasting without understanding what the code is really doing.
Jon Skeet
To be clearer, I knew what the using statement did when I first used it. That the statement is there in the code sample indicates that the object is being cleaned up. As a junior programmer that's probably all I need to know.
Robert Harvey
C# was originally billed as the "simpler" C++. As I gained experience in C#, I realized that is is much more important to deeply understand the underlying platform than I originally thought. I'm not there yet, but I'm getting through your book, so it is progressive. :)
Robert Harvey
@Robert: How did you know what the "using" statement did though? I find it hard to imagine that any reputable description of it would have ignored the IDisposable part of it. To be similarly clear, I'm not suggesting that everyone should know the ins and outs of every bit of the language - just that they should know the important bits of every part of the language they *use*. I know very little about the details of unsafe blocks, mostly because I never use them :)
Jon Skeet
Slightly related question for you Jon, wouldn't it take a significant amount of time to amass the knowledge of the internal details and workings of everything you're using? I do agree with you, but I'm curious what happens when you've spent so much time with one language and invested into it, but then switch to a new language...does the investment in the previous language tend to bleed over into a deeper and quicker understanding of a new one so that it doesn't take as long to find out what you need to know?
thismat
When I began using "using" with database connections, I just assumed that the author of the database connection object knew what he was doing. I'm sorry if that seems naive, but at the time I didn't need to know about the IDisposable interface, because I didn't need to implement one myself.
Robert Harvey
@thismat: Internal details aren't nearly as important as specified behaviour. For example, you don't really need to know how iterator blocks are implemented (although it's interesting) but you should know at least the fundamentals of how they'll behave (in particular, that none of the code executes until the first `MoveNext()` call). As to whether investment bleeds over - it depends on the two languages, but to some extent it does. On the other hand, you need to be careful not to make assumptions about similar but different behaviour. Java and C# are similar in many ways - but not all...
Jon Skeet
@Robert: But at some point didn't you ask yourself "what's this `using` thing?" - how did you find out the answer? Anywhere that told you "it cleans things up" should also have told you that the `using` statement works with the `IDisposable` interface. Maybe it's just me, but I don't like using any language construct without having at least a cursory look at some documentation for it (whether that's a book, a specification, a tutorial or whatever).
Jon Skeet
Yes. Eventually I got curious about the IDisposable interface (or perhaps uncomfortable about not knowing exactly what was happening under the hood), and read up on it in detail. But prior to that, I would have failed Woot4Moo's test, because I though of IDisposable as something that "using" uses, not as something that is used by "using" (if that makes any sense). I would not have connected the dots in the interview.
Robert Harvey
@Jon Skeet: Good points, thanks for taking the time to answer.
thismat
+1  A: 

I'm no expert on interviewing, so please take this as an opinion rather than gospel.

I'd ask the interviewee to bring in a hundred lines or so of code they've written in each language that accomplishes something interesting. In the interview, let them know what languages you do know, and ask them to review their code with you. Even without knowing the language you should be able to ask questions about various design decisions and determine whether the interviewee is actually comfortable with the language.

Larry Lustig
+1  A: 

I think it is far more important to find out how the candidate thinks than to test their specific knowledge on a topic. For example, they may know C# but do they have the aptitude to learn VB.NET, or F#, or some other language. What makes them tick? Do they get excited by new framework features? What do they do for hobbies? How do they tackle problems? These things are far more important than knowing a language inside and out, especially when even the best developers still rely on the compiler to tell them they screwed up.

Jeff Yates
+1  A: 

Read Scott Hanselman's blog here, he has some good questions http://www.hanselman.com/blog/CommentView.aspx?guid=d835178f-a649-45f5-907f-28ad1177d8d5

Mimi
+1  A: 

Its very dificult to answer your question, because we can list thousands of questions. However here is my abstract idea:

  1. Test whether he knows all OOPs concepts and how it can be acheived in C#/VB.Net
  2. Avoid critical questions as they are juniors.
  3. Test them whether they can differntiate .Net languages from other HLL
  4. Explain some .Net features and ask how they will achive them using C#/VB.Net (ex: Reflection, Genrics, property)
  5. Make sure that they can very-well pick-up if they given chance to work.
Kaz
+1  A: 

How about asking which strengths and weaknesses do she sees in each language? What would make one more appropriate than the other?

Note that while one could say that she isn't so familiar as to know an answer, that in itself can be a fine answer. Part of what you are wanting to see is their ability to communicate either technical arguments for or against something or an ability to say, "Well, I don't have enough experience to give a thorough answer on this."

JB King