I'm preparing a LINQ section in interview questions for senior programmers. What are the most interesting questions in LINQ to include? And why?
Some of the things you can ask would be like.
- Why the
varkeyword is used and when it is the only way to get query result ?
- What is Deferred Execution ?
- Explain Query Expression syntax, Fluent Syntax, Mixed Queries.
- What are Interpreted Queries ?
- Use of
- Use of
intokeyword, and how they help in making Progressive queries but still keep Deferred execution
- What are Expression Trees ?
How about some coding questions, like:
- Give then non-LINQ code that would be better done in LINQ and get them to translate it.
- Give them some LINQ and get them to unravel and re-write in plain C# (better yet, find an example where the non-LINQ version is better or more easily understood)
- Ask them to solve some problem and show with/without LINQ and get them to explain which is better, and why.
Text book questions are fine (e.g. why use
var), but to really find out if they understand just get them to write code.