learning-it by example

Back to the video

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

  1. 0:00 One wide table: no busiest hour, earnings 54.18 too high, surge 1.0 not 1.8
  2. 0:35 The idea
  3. 1:10 Setup
  4. 1:31 The things and the timeline
  5. 1:49 Money, ratings, surge
  6. 2:15 A made-up day
  7. 2:36 Busiest hour and earnings
  8. 2:55 History and surge then
  9. 3:35 The wide table
  10. 4:43 What this does not show
  11. 5:18 Mistakes to avoid
  12. 5:48 My take and next steps
  13. 6:10 Recap

Files

  • data.py (43 lines)
  • load.py (50 lines)
  • questions.py (34 lines)
  • run.py (37 lines)
  • schema.py (31 lines)

Download the code (zip)

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.