Software Development

Screening C# Candidates: Let’s Play 20 Questions!

Over the past year I was involved in the process of interviewing candidates for both mid and senior level developer positions. We would bring them in for a face-to-face interview, sometimes with multiple interviewers, only to find out they were unable to answer the most basic technical questions concerning C# and .NET. I’m of the persuasion that every .NET developer should understand basic concepts, such as C# language syntax, inheritance, generics, memory management, threading, etc. Without such an understanding, a developer can end up writing apps that are shot-through with problems that make the code difficult to debug and maintain.

Furthermore, I’m looking for a developer with a thirst for knowledge. The technical landscape is constantly shifting, and developers need to come up to speed quickly if they are going to be able to leverage latest enhancements to the platform. In addition, the breadth of the technical spectrum is mind-boggling, and a developer needs the capacity to absorb vast quantities of knowledge from various parts of the framework. For example, someone might be called upon to build a WPF app retrieving data from a WCF service that queries a SQL database using Entity Framework with Ninject for dependency injection and MOQ for unit testing. If a developer has a grasp of the fundamentals of C# and .NET, it tells me they are motivated to dig deeper to understand how things work under the covers, and take the time to acquire technical expertise both through reading and hands-on coding.

In a face-to-face interview, I can take time to ask probing questions and get a fairly good feel for a candidate’s technical prowess. However, there needs to be a process to screen out candidates who lack even the most basic understanding of .NET fundamentals. This is the purpose of the technical phone screen. It should take no more than 15 minutes to conduct, and ideally it can be administered by a non-technical person, such as a project manager or technical recruiter. For this purpose I have composed a list of 20 Questions, each of which has a one or two word answer. Here is the list of questions without answers, which you can use to quiz yourself (see the end of the post for the answers).

C# Phone Screen Questions (without Answers)

1. What kind of type is a string?
2. What kind of type is a double?
3. What keyword defines a custom value type?
4. Can a class have more than one direct base class?
5. What keyword makes a member visible to inherited classes?
6. What keyword makes a class visible only within its assembly?
7. What keyword allows a method to be overridden?
8. What keyword requires a method to be overridden?
9. What keyword prevents a class from being used as a base class?
10. What keyword returns true if a cast will succeed?
11. What keyword returns null if a cast will not succeed?
12. What keyword ensures code execution even if an exception occurs?
13. What keyword calls IDisposable.Dispose?
14. What keyword constrains a generic type argument to derive from a particular class?
15. What two keywords used together return IEnumerable<T>?
16. What keyword would you use to define an inline variable in a LINQ query?
17. What keyword brings an extension method into scope?
18. What keyword do you add to a delegate to force subscribers to use += or –=?
19. What method do you call on a delegate to run it on a background thread?
20. What keyword provides thread synchronization?

The nice thing about this approach is that is should not take just a few minutes to administer, it can be given by anyone regardless of technical background, and the answers are fairly cut and dried. Of course, the questions are not meant to be exhaustive and are only scratching the surface of CLR and C# fundamentals. Just because someone can answer them does not mean they have a firm grasp of the .NET type system, garbage collection mechanics, JIT compilation issues, or multi-threading synchronization techniques. Neither do the questions touch on any of the “pillars” of the .NET Framework API, such as data access (Entity Framework), web services (WCF), or presentation platforms (WPF, SL, ASP.NET MVC). Nor do they attempt to ascertain logical or critical thinking ability. The only way to test for those things is to perform an in-depth technical interview performed by a senior technical specialist. This is not to say that a mid-level developer will know all there is to know. What you are really looking for is not raw knowledge per se, but the capacity to absorb and integrate technical knowledge and the desire to know how things work. If a person has ever bothered to read a book or technical article or taken a training course, their answers will set them apart from the crowd of folks who don’t make time for ongoing professional development.

If you’re reading this blog post and want to know where to begin, my first suggestion would be to run, not walk, to nearest bookseller or online bookstore and pick up Jeffrey Richter’s CLR via C#, which is presently in its third edition. My short list for the books on various .NET API’s is Programming Entity Framework by Julie Lerman, Programming WCF Services by Juval Lowy, Essential WPF by Chris Anderson, Silverlight 4 in Action by Pete Brown, and Pro ASP.NET MVC by Steve Sanderson.

Best of luck on your career development!

C# Phone Screen Questions (with Answers):

1. What kind of type is a string?
> reference
2. What kind of type is a double?
> value
3. What keyword defines a custom value type?
> struct
4. Can a class have more than one direct base class?
> no
5. What keyword makes a member visible to inherited classes?
> protected
6. What keyword makes a class visible only within its assembly?
> internal
7. What keyword allows a method to be overridden?
> virtual
8. What keyword requires a method to be overridden?
> abstract
9. What keyword prevents a class from being used as a base class?
> sealed
10. What keyword returns true if a cast will succeed?
> is
11. What keyword returns null if a cast will not succeed?
> as
12. What keyword ensures code execution even if an exception occurs?
> finally
13. What keyword calls IDisposable.Dispose?
> using
14. What keyword constrains a generic type argument to derive from a particular class?
> where
15. What two keywords used together return IEnumerable<T>?
> yield return
16. What keyword would you use to define an inline variable in a LINQ query?
> let
17. What keyword brings an extension method into scope?
> using
18. What keyword do you add to a delegate to force subscribers to use += or –=?
> event
19. What method do you call on a delegate to run it on a background thread?
> BeginInvoke
20. What keyword provides thread synchronization?
> lock

Reference: Screening C# Candidates: Let’s Play 20 Questions! from our NCG partner Tony Sneed at the Tony Sneed’s Blog blog.

Related Articles

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Back to top button