by orthoxerox · 3y ago · 0 comments
Given a table that contains a history of spot readings from many different sensors
readings(sensor_id bigint, reading_ts timestamp, reading_value decimal)
show me the latest known reading for each sensor.Things I look at:
1. Does the candidate immediately reach for a window function?
2. Can they do it without a window function?
If the candidate fails at this stage, it's a no-hire, then I can use the same task to check their seniority.
3. Do they actually know the right window function?
4. Can they explain why a window function is better here than grouping in a subquery?
5. Can they do it in an imperative language?
If they can answer at least two out of three, they are a solid middle.
6. Can they suggest a way to store the data that makes the query take O(number of sensors) time?
Okay, this is a senior engineer.
My v1 would not pass your interview. My v4 would be a world-class solution. Fair enough, you are not looking for my v4, and rightfully so I should fail your interview (because I bet there be some people out there who can produce world-class solutions without relying on external sources)
I can’t do without documentation or google.
And that makes me think am i a bad programmer
You’re not. We all need documentation and google, and anyone who claims otherwise will eventually shoot themselves in the foot.
I’ve definitely given interview questions my best shot and admitted where I’d defer to the internet.
Totally curious - what is your fail rate like for applicants at the first stage for the window function? We are happy with more junior engineers who usually haven't used a window function but can currently do simple queries and an easy candidate to move forward with will come up with a group by subquery . . .
I'm guessing that 2/3 to 3/4 of our in-person interview candidates look (on paper) like they could handle simple queries and grouping but struggle in the interview context.