I guess this is more of a "do you know about database indexes" question, but I think if it less of a gotcha and more of a jumping off point into a discussion you can take it in a number of directions:
- time vs. space tradeoffs
- insert vs. select tradeoffs
- Oh yeah they're binary trees also, with those implications
- What's reasonably distributable (downsides of UUIDs)
- at what point might you have query performance issues you can address w/ indexes
But like, again practically speaking I think this is just an experience test question. I think I'd prefer something like "on your resume you have Postgres experience dating back 7 years, tell me what you think about it, what its strengths and weaknesses are, and why you would or wouldn't use it".
---
Maybe you have thoughts about this too, but I'm also starting to develop some thoughts around whether to consider interviews quizzes/tests or conversations. Thinking about it, I've always approached my interviews (on both sides of the table) as conversations--even questions with simple answers. I guess that's why my answer here is "this should be a discussion about databases" and less "table scans vs. index scans in 30 seconds go". It's totally OK to drill down into specifics and be technical, but this is potentially your first interaction with a new colleague, and you should be collegial, not domineering and inscrutable right? I think we get so worried about hiring a faker that we justify anything to avoid it.