Practice questions
Warm-up · 8
- 01Customer list, not started
- 02Products priced from 10 to 25, not started
- 03Kitchen catalog from most to least expensive, not started
- 04Products with no description, not started
- 05The three cheapest products, not started
- 06Rename a product and price five of them, not started
- 07Countries customers come from, not started
- 08Orders from 15 December 2010, not started
Easy · 21
- 09Orders by country and type, not started
- 10Providers with no encounters, not started
- 11Frequent customers, not started
- 122011 net sales by department, not started
- 13Users created in March 2025, not started
- 14People invited by several workspaces, not started
- 15Developers and their teams, not started
- 16Every developer, with a team label, not started
- 17Find the lamps, not started
- 18Spring orders from France and Germany, not started
- 19Average price by category, not started
- 20Price bands, not started
- 21Active buyers per month, not started
- 22How long did delivery take?, not started
- 23Create a wishlist table, not started
- 24Reprice the garden range, not started
- 72Predict: patients with and without missed appointments, not started
- 73Predict: unknown prices in a filter, not started
- 78Debug: find products with no description, not started
- 82Debug: February flights at the boundary, not started
- 138Predict: which trips are in January?, not started
Medium · 61
- 25Big spenders for their state, not started
- 26Monthly sales after cancellations, not started
- 27Bestsellers within each category, not started
- 28Seven-day rolling high temperature, not started
- 29More pull requests than their manager, not started
- 30Days with no orders, not started
- 31First and latest order per customer, not started
- 32Orders whose payments don’t match, not started
- 33Flight outcomes by origin state, not started
- 34Loyal customers who never returned anything, not started
- 35Average order value by month, not started
- 36Deployments versus incidents, not started
- 37Keep one invitation per person, not started
- 38A covering index for unit totals, not started
- 39A reusable customer totals view, not started
- 40Second-highest home-run total per team, not started
- 51Make the event-day filter searchable, not started
- 54Abandoned checkouts, not started
- 55Audit duplicate scans, not started
- 61Products bought together, not started
- 64Parse tracking numbers, not started
- 65Normalize invitee emails, not started
- 67Upgrade review 1: the daily pricing audience, not started
- 74Predict: count rows or known values?, not started
- 75Predict: positions and shared ranks, not started
- 77Predict: the previous leg of the same aircraft, not started
- 79Debug: keep carriers without next-day shipments, not started
- 80Debug: count zero projects correctly, not started
- 81Debug: the second-best win total, not started
- 84Grid review 1: regional demand on a peak day, not started
- 85Grid review 2: missing demand hours, not started
- 89Three New York stations side by side, not started
- 90Observation coverage by station, not started
- 91Signed invoice totals, not started
- 94Repeat reviews, distinct pull requests, not started
- 95Two measures, one stream, not started
- 98Reliability bands, not started
- 101Predict: integer and decimal ratios, not started
- 102Predict: missing passenger counts in an average, not started
- 103Predict: a recursive team path, not started
- 104Predict: dates across midnight, not started
- 105Predict: duplicate values in a set, not started
- 106Predict: NOT IN with an unknown alternative, not started
- 107Debug: observable tip rate, not started
- 108Debug: delay among operated flights, not started
- 109Debug: forecast accuracy, not started
- 110Debug: teams without active repositories, not started
- 111Debug: visits after joining observations, not started
- 112Debug: a duplicate scan is not another delivery, not started
- 114Teams that hosted each other, not started
- 119When did devices go silent?, not started
- 121Back-to-back failed deliveries, not started
- 122Each patient’s latest systolic reading, not started
- 123Purchases far above a card’s norm, not started
- 127A histogram of daily highs, not started
- 128How far do taxi trips go?, not started
- 132Developers who review each other, not started
- 133Routes flown in one direction only, not started
- 135Encounters that overlap in time, not started
- 136Predict: payments after joining line items, not started
- 137Debug: redelivered events, not started
Hard · 49
- 41Next-month retention by signup cohort, not started
- 42Longest winning streak, not started
- 43Customer segment at order time, not started
- 44Overlapping prescription fills, not started
- 45Management chain for every developer, not started
- 46Median home attendance per team, not started
- 47Build a country history from invoices, not started
- 48Settlements, refunds and disputes, not started
- 49Design a flight lookup index, not started
- 50Cover the export query, not started
- 52Latest failed deliveries without a sort, not started
- 53An ordered upgrade funnel, not started
- 56Sessionize retries and exact boundaries, not started
- 57Paid conversion by acquisition channel, not started
- 58A replay-safe ledger load, not started
- 59Enforce delivery-slot rules, not started
- 60Recover a partially failed transfer, not started
- 62Customers who bought from every Home category, not started
- 63Department audience overlap, not started
- 66Parse statement amounts into cents, not started
- 68Upgrade review 2: where the funnel drops, not started
- 69Upgrade review 3: time from checkout to subscription, not started
- 70Upgrade review 4: abandoned checkouts that came back, not started
- 71Upgrade review 5: which channels to fix first, not started
- 76Predict: a frame that includes peers, not started
- 83Debug: each account’s last posted amount, not started
- 86Grid review 3: June peak hours and ties, not started
- 87Grid review 4: does demand balance?, not started
- 88Grid review 5: monthly forecast error, not started
- 92What actually moved money?, not started
- 93Has the whole shipment arrived?, not started
- 96Last known daily maximum, not started
- 97Everyone below a director, not started
- 99State as known at an operational cutoff, not started
- 100Merge overlapping incident windows, not started
- 113Sustained warm intervals in cold storage, not started
- 115Device status at the end of each day, not started
- 116Carry the last good reading forward, not started
- 117Merged maintenance downtime, not started
- 118Continuous medication coverage, not started
- 120Three late legs in a row, not started
- 124Reviewers who cover every team repository, not started
- 125Headcount of each team tree, not started
- 126Direct and total reports, not started
- 129Median and 90th-percentile arrival delay, not started
- 130Fork families, not started
- 131Who is within two reviews?, not started
- 134Retried authorization requests, not started
- 139Debug: sessions and events per workspace, not started
task Recursive CTEs · hard
Who is within two reviews?
Find everyone reachable within two steps of developer 7, excluding developer 7. Treat “reviewer reviewed a pull request by author” as an edge from reviewer to author. Return developer_id and steps (the fewest edges, 1 or 2).
what to return
- Columns
developer_idstepsin this order- Rows
- 7 rows · any order
- Skill
- Traverse a directed graph to a fixed depth. Refresher: Recursive CTEs →
expected result
expected result7 rows · any order
| developer_id | steps |
|---|---|
| 13 | 1 |
| 26 | 1 |
| 27 | 1 |
first 3 of 7 rows
data you can query
reviews5 columns · 19,622 rows
| review_idnumber · unique id | pull_request_idnumber · links to pull_requests | reviewer_idnumber · links to developers | submitted_atdate & time | statetext |
|---|---|---|---|---|
| 1 | 8775 | 1986 | 2024-01-01 04:49:28 | approved |
| 2 | 1017 | 245 | 2024-01-01 04:49:34 | commented |
| 3 | 10586 | 2340 | 2024-01-01 06:55:14 | commented |
| 4 | 11308 | 2551 | 2024-01-01 07:54:01 | changes_requested |
| 5 | 9777 | 2204 | 2024-01-01 12:48:19 | approved |
| 6 | 827 | 79 | 2024-01-01 16:04:29 | approved |
| 7 | 1001 | 253 | 2024-01-01 16:39:47 | commented |
| 8 | 1089 | 245 | 2024-01-01 16:53:42 | approved |
| 9 | 11308 | 2551 | 2024-01-01 18:12:42 | approved |
| 10 | 11977 | 2645 | 2024-01-01 20:18:58 | commented |
- review_idnumber · unique id
- 1
- pull_request_idnumber · links to pull_requests
- 8775
- reviewer_idnumber · links to developers
- 1986
- submitted_atdate & time
- 2024-01-01 04:49:28
- statetext
- approved
- review_idnumber · unique id
- 2
- pull_request_idnumber · links to pull_requests
- 1017
- reviewer_idnumber · links to developers
- 245
- submitted_atdate & time
- 2024-01-01 04:49:34
- statetext
- commented
- review_idnumber · unique id
- 3
- pull_request_idnumber · links to pull_requests
- 10586
- reviewer_idnumber · links to developers
- 2340
- submitted_atdate & time
- 2024-01-01 06:55:14
- statetext
- commented
- review_idnumber · unique id
- 4
- pull_request_idnumber · links to pull_requests
- 11308
- reviewer_idnumber · links to developers
- 2551
- submitted_atdate & time
- 2024-01-01 07:54:01
- statetext
- changes_requested
- review_idnumber · unique id
- 5
- pull_request_idnumber · links to pull_requests
- 9777
- reviewer_idnumber · links to developers
- 2204
- submitted_atdate & time
- 2024-01-01 12:48:19
- statetext
- approved
- review_idnumber · unique id
- 6
- pull_request_idnumber · links to pull_requests
- 827
- reviewer_idnumber · links to developers
- 79
- submitted_atdate & time
- 2024-01-01 16:04:29
- statetext
- approved
- review_idnumber · unique id
- 7
- pull_request_idnumber · links to pull_requests
- 1001
- reviewer_idnumber · links to developers
- 253
- submitted_atdate & time
- 2024-01-01 16:39:47
- statetext
- commented
- review_idnumber · unique id
- 8
- pull_request_idnumber · links to pull_requests
- 1089
- reviewer_idnumber · links to developers
- 245
- submitted_atdate & time
- 2024-01-01 16:53:42
- statetext
- approved
- review_idnumber · unique id
- 9
- pull_request_idnumber · links to pull_requests
- 11308
- reviewer_idnumber · links to developers
- 2551
- submitted_atdate & time
- 2024-01-01 18:12:42
- statetext
- approved
- review_idnumber · unique id
- 10
- pull_request_idnumber · links to pull_requests
- 11977
- reviewer_idnumber · links to developers
- 2645
- submitted_atdate & time
- 2024-01-01 20:18:58
- statetext
- commented
first 10 of 19,622 rows · your queries use all of them
pull_requests10 columns · 13,242 rows
| pull_request_idnumber · unique id | repository_idnumber · links to repositories | author_idnumber · links to developers | titletext | created_atdate & time | merged_atdate & time | closed_atdate & time | statetext | additionsnumber | deletionsnumber |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 24 | Fix rate limiter | 2024-01-27 05:50:25 | NULL | 2024-02-16 05:29:35 | closed | 47 | 10 |
| 2 | 1 | 58 | Fix dashboard query | 2024-02-10 17:45:14 | 2024-02-11 12:07:27 | 2024-02-11 12:07:27 | merged | 16 | 5 |
| 3 | 1 | 9 | Fix cache invalidation | 2024-02-12 12:03:26 | 2024-02-12 18:28:29 | 2024-02-12 18:28:29 | merged | 763 | 365 |
| 4 | 1 | 24 | Migrate retry logic | 2024-02-14 09:27:38 | 2024-02-16 01:04:57 | 2024-02-16 01:04:57 | merged | 161 | 53 |
| 5 | 1 | 9 | Remove login flow | 2024-03-10 14:32:05 | 2024-03-11 04:00:50 | 2024-03-11 04:00:50 | merged | 396 | 129 |
| 6 | 1 | 58 | Migrate cache invalidation | 2024-03-12 10:11:26 | 2024-03-12 17:06:25 | 2024-03-12 17:06:25 | merged | 71 | 51 |
| 7 | 1 | 58 | Fix API client | 2024-04-15 11:51:39 | 2024-04-15 16:19:21 | 2024-04-15 16:19:21 | merged | 454 | 154 |
| 8 | 1 | 9 | Speed up schema migration | 2024-05-10 08:51:23 | 2024-05-10 20:04:21 | 2024-05-10 20:04:21 | merged | 19 | 4 |
| 9 | 1 | 42 | Update login flow | 2024-05-17 13:38:44 | 2024-05-17 19:06:31 | 2024-05-17 19:06:31 | merged | 507 | 209 |
| 10 | 1 | 62 | Bump timeout handling | 2024-06-11 23:07:37 | 2024-06-12 15:39:15 | 2024-06-12 15:39:15 | merged | 183 | 71 |
- pull_request_idnumber · unique id
- 1
- repository_idnumber · links to repositories
- 1
- author_idnumber · links to developers
- 24
- titletext
- Fix rate limiter
- created_atdate & time
- 2024-01-27 05:50:25
- merged_atdate & time
- NULL
- closed_atdate & time
- 2024-02-16 05:29:35
- statetext
- closed
- additionsnumber
- 47
- deletionsnumber
- 10
- pull_request_idnumber · unique id
- 2
- repository_idnumber · links to repositories
- 1
- author_idnumber · links to developers
- 58
- titletext
- Fix dashboard query
- created_atdate & time
- 2024-02-10 17:45:14
- merged_atdate & time
- 2024-02-11 12:07:27
- closed_atdate & time
- 2024-02-11 12:07:27
- statetext
- merged
- additionsnumber
- 16
- deletionsnumber
- 5
- pull_request_idnumber · unique id
- 3
- repository_idnumber · links to repositories
- 1
- author_idnumber · links to developers
- 9
- titletext
- Fix cache invalidation
- created_atdate & time
- 2024-02-12 12:03:26
- merged_atdate & time
- 2024-02-12 18:28:29
- closed_atdate & time
- 2024-02-12 18:28:29
- statetext
- merged
- additionsnumber
- 763
- deletionsnumber
- 365
- pull_request_idnumber · unique id
- 4
- repository_idnumber · links to repositories
- 1
- author_idnumber · links to developers
- 24
- titletext
- Migrate retry logic
- created_atdate & time
- 2024-02-14 09:27:38
- merged_atdate & time
- 2024-02-16 01:04:57
- closed_atdate & time
- 2024-02-16 01:04:57
- statetext
- merged
- additionsnumber
- 161
- deletionsnumber
- 53
- pull_request_idnumber · unique id
- 5
- repository_idnumber · links to repositories
- 1
- author_idnumber · links to developers
- 9
- titletext
- Remove login flow
- created_atdate & time
- 2024-03-10 14:32:05
- merged_atdate & time
- 2024-03-11 04:00:50
- closed_atdate & time
- 2024-03-11 04:00:50
- statetext
- merged
- additionsnumber
- 396
- deletionsnumber
- 129
- pull_request_idnumber · unique id
- 6
- repository_idnumber · links to repositories
- 1
- author_idnumber · links to developers
- 58
- titletext
- Migrate cache invalidation
- created_atdate & time
- 2024-03-12 10:11:26
- merged_atdate & time
- 2024-03-12 17:06:25
- closed_atdate & time
- 2024-03-12 17:06:25
- statetext
- merged
- additionsnumber
- 71
- deletionsnumber
- 51
- pull_request_idnumber · unique id
- 7
- repository_idnumber · links to repositories
- 1
- author_idnumber · links to developers
- 58
- titletext
- Fix API client
- created_atdate & time
- 2024-04-15 11:51:39
- merged_atdate & time
- 2024-04-15 16:19:21
- closed_atdate & time
- 2024-04-15 16:19:21
- statetext
- merged
- additionsnumber
- 454
- deletionsnumber
- 154
- pull_request_idnumber · unique id
- 8
- repository_idnumber · links to repositories
- 1
- author_idnumber · links to developers
- 9
- titletext
- Speed up schema migration
- created_atdate & time
- 2024-05-10 08:51:23
- merged_atdate & time
- 2024-05-10 20:04:21
- closed_atdate & time
- 2024-05-10 20:04:21
- statetext
- merged
- additionsnumber
- 19
- deletionsnumber
- 4
- pull_request_idnumber · unique id
- 9
- repository_idnumber · links to repositories
- 1
- author_idnumber · links to developers
- 42
- titletext
- Update login flow
- created_atdate & time
- 2024-05-17 13:38:44
- merged_atdate & time
- 2024-05-17 19:06:31
- closed_atdate & time
- 2024-05-17 19:06:31
- statetext
- merged
- additionsnumber
- 507
- deletionsnumber
- 209
- pull_request_idnumber · unique id
- 10
- repository_idnumber · links to repositories
- 1
- author_idnumber · links to developers
- 62
- titletext
- Bump timeout handling
- created_atdate & time
- 2024-06-11 23:07:37
- merged_atdate & time
- 2024-06-12 15:39:15
- closed_atdate & time
- 2024-06-12 15:39:15
- statetext
- merged
- additionsnumber
- 183
- deletionsnumber
- 71
first 10 of 13,242 rows · your queries use all of them
solution.sql
Output
Hints and the answer are always available. Using them counts the question as solved with help.