I'm preparing a LINQ section in interview questions for senior programmers. What are the most interesting questions in LINQ to include? And why?
|
feedback
|
migrated from stackoverflow.com Apr 20 '11 at 10:29
This question came from our site for professional and enthusiast programmers.
|
Some of the things you can ask would be like.
Update: | |||||||||||||||
feedback
|
|
Ask them to give examples of times when they would tend to not use LINQ and why, even though it would be possible (and ReSharper excitedly suggests it). | |||
|
feedback
|
|
You could start but asking what language features that were introduced in C# 3 are needed to support LINQ. Does the candidate understand how features like the var keyword as well as anonymous types, lambda expressions and extension methods were needed to enable LINQ? | |||||
feedback
|
|
If you're looking for a question to which you'd get "interesting" answers, you could ask them why they think most linq examples assign using the "var" keyword on the LHS... there's no right answer and you could probably get some understanding of the type of person they are from what they say. | |||
|
feedback
|
|
How about some coding questions, like:
Text book questions are fine (e.g. why use | |||
|
feedback
|
|
Ask them about expression trees. How the linq transforms into sql on the database server the difference between linq extension methods and linq query's Depends what you are trying to get out of them. | |||
|
feedback
|
|
What are some cases where you would use the First() method instead of the Single() method, and vice-versa? | |||
|
feedback
|
| |||
|
feedback
|