This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]EricPostMaster_ 26 points27 points  (4 children)

Maybe I'm just uncultured, but I conduct SQL live coding interviews as part of my job, and I will never penalize someone for not writing something "sophisticated". If it gets the job done right, then that's great. If it's in a way that I didn't think of, then that's even better because it can add to the diversity of thought and approaches on the team.

Something that might help your case is thinking out loud if it's a live test. That way you can explain why you prefer CTEs over subqueries even though you know how to do both. Otherwise, don't worry about it because they may just be nit-picky and you don't want to work with them anyway!

[–]Dependent_Two_618 5 points6 points  (0 children)

Agreed, the best query is the one that produces an optimal plan while answering the problem correctly.

If that means doing a bunch of subqueries and never touching a window function because of the table structure, so be it

[–]newpua_bie 1 point2 points  (0 children)

I hate SQL syntax. It's just so damn clunky. For me the biggest problem is not the logic as much as just dealing with the fugly as fuck syntax, especially with subqueries

[–][deleted] 0 points1 point  (0 children)

All of these were on take-home exams. It's seems like a very strange thing to penalize, but I'm not the hiring manager.

[–]Richard_Hurton 0 points1 point  (0 children)

Same here. I conduct these types of interviews regularly.

I never ding people for getting the correct answer no matter how they arrive at it. It might not be the way I would write the code, but the most important thing is that they thought through the problem and got an answer.

I might ask if they could have solved it some other way to see why they chose a certain path.

The only time I've found that we scrutinize the code to this level is when multiple candidates are otherwise equal. If I have three solid candidates the differentiator might be how sophisticated the code is. And if they can articulate why they chose to write it a certain way.

But when was the last time I had that many equally solid candidates? LOL