The Find Interview Candidates coding problem is a SQL task. You are typically given a Contests table (with contest IDs and winner IDs) and a Users table. Your goal is to identify users who are candidates for an interview based on two criteria:
Amazon uses this to test proficiency in SQL Window Functions and complex joins. it's a "real-world" reporting task that evaluates how you handle sequences and aggregations. Specifically, identifying "consecutive" records in a relational database is a high-level skill that demonstrates you can think about data topologically rather than just as a flat set.
This follows the Database and Consecutive Sequence pattern.
ROW_NUMBER() or LAG()/LEAD(). A common trick is to calculate contest_id - ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY contest_id). For a consecutive streak, this difference remains constant.GROUP BY user_id with HAVING COUNT(*) >= 3.UNION or OR to combine both sets of IDs and join with the Users table to get the final names and emails.contest_id - row_num: 101-1=100, 102-2=100, 103-3=100.Master the "Gap and Island" problem in SQL. It is the standard template for finding consecutive ranges or streaks in time-series data.
| Title | Difficulty | Topics | LeetCode |
|---|---|---|---|
| Customer Purchasing Behavior Analysis | Medium | Solve | |
| Employees With Deductions | Medium | Solve | |
| Find the Missing IDs | Medium | Solve | |
| Grand Slam Titles | Medium | Solve | |
| Number of Times a Driver Was a Passenger | Medium | Solve |