Skip to content
ML Academy

S06 · interview simulation

Python gym: turning cumulative booking curves into pickup in pandas

People, data and outputs in this scenario are simulated. Each stage is recorded when you commit; the reveal comes after.

  • 5stages
  • 35 minabout
  • 0stages committed

The brief

A Python interview (simulated) with the course's synthetic booking_curve joined to route and market. In 2024 it has 90,402 rows: one row per flight and departure date and 13 snapshots at 90, 60, 45, 30, 21, 14, 10, 7, 5, 3, 2, 1 and 0 days before departure.

Columns: date, flight_no, route, market, days_to_departure, bookings (bookings made since the previous snapshot) and cumulative_bookings. The frame is passed in shuffled; no row order may be assumed.

Example, flight ZX104 departing 2024-07-15:

days_to_departure90604530211410753210
bookings3142227232212997742
cumulative_bookings317396689111123132141148155159161

Stage 1 of 5

The interviewer: "What share of final bookings has a flight typically made by 30 days before departure?"

Which implementation answers it, per flight and departure date?

Sign in to play scenarios (answers are recorded before the reveal).