I like the FizzBuzz puzzle
I use it to identify if an applicant
- prefers using a set or loop based method where both methods are possible
- knows enough T-SQL to generate a numbers list from scratch (or if the person knows a method to generate such a list based on a system table)
- understand how the CASE fuction works
- knows how deal with error messages (usually an applicant would simply add "ELSE number" leading to a conversion error)
This simple test is also a good start to talk about some rather basic SQL internals: (Why does SQL Server try to convert "fizz" to a numeric value?)
The test to find duplicate rows is a good test for solving a common task.
Unless it's a very smart Junior, I wouldn't expect them to even know what a numbers list is never mind be able to generate one. Sure, the code is simple but I've worked with many supposedly Sr. Level Developers and DBAs that have never heard of things when it comes to numbering things. Shoot, even ROW_NUMBER has been out for over 8 years and I'm still finding Seniors that know nothing about it.
is pronounced ree-bar and is a Modenism for R
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Helpful Links:
How to post code problemsHow to post performance problemsForum FAQs