Data Modelling Interview: Design a Ride Hailing Schema
On one made-up day, a wide table I wrote to fail could not find the busiest hour, overstated one driver's earnings by 54.18, and gave a surge of 1.0 where the schema said 1.8.
Video #273 ยท Data modelling
Steps in the video
- 0:00 One wide table: no busiest hour, earnings 54.18 too high, surge 1.0 not 1.8
- 0:35 The idea
- 1:10 Setup
- 1:31 The things and the timeline
- 1:49 Money, ratings, surge
- 2:15 A made-up day
- 2:36 Busiest hour and earnings
- 2:55 History and surge then
- 3:35 The wide table
- 4:43 What this does not show
- 5:18 Mistakes to avoid
- 5:48 My take and next steps
- 6:10 Recap
Files
- data.py (43 lines)
- load.py (50 lines)
- questions.py (34 lines)
- run.py (37 lines)
- schema.py (31 lines)
Tested with
Python 3.12.15
What this does not show
One made-up day of 18 trips; the wide table was written to show these failures; the interview questions are my own choice; no platform commission in earnings; no time zones; ratings are stored but not queried; not any real company's design.
Sources
Learning IT by Example.