I'm preparing a LINQ section in interview questions for senior programmers. What are the most interesting questions in LINQ to include? And why?
migrated from stackoverflow.com Apr 20 '11 at 10:29
|
Some of the things you can ask would be like.
Update: |
|||||||||||||||
|
|
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). |
|||
|
|
|
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? |
|||||
|
|
How about some coding questions, like:
Text book questions are fine (e.g. why use |
|||||
|
|
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. |
|||
|
|
|
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. |
|||
|
|
|
What are some cases where you would use the First() method instead of the Single() method, and vice-versa? |
|||
|
|
|
|||
|
Ask them to build a small rules engine, using Func[]rules{}. Each rule has to be true, the array replacing case or if statements. I just started on linq and lambdas but figure this is a nice test of problem solving and linq literacy. In addition to the more qualified suggestions on here. |
|||
|
|
|
here i have collected lots of Language Integrated Query (LINQ) Interview Questions and Answers kindly have a look this would help you a lot Regards, Akaas Developer |
|||
|
|