Implement a gig worker payout calculator
Company: DoorDash
Role: Software Engineer
Category: Data Manipulation (SQL/Python)
Difficulty: Medium
Interview Round: Onsite
Implement a payout calculator for gig workers (e.g., delivery drivers). Given a list of completed orders with timestamps, distances, and tips, plus policy tables for base pay, distance/time multipliers, surge/boosts, batching rules, cancellations, and minimum guarantees, compute per-order pay, per-shift summaries, and weekly statements. Handle edge cases such as partial cancellations, stacked deliveries, negative adjustments/chargebacks, rounding and currency precision, timezone boundaries, and idempotent reprocessing of late-arriving events. Provide function signatures or SQL, outline the schema, and include tests that cover typical and extreme scenarios.
Quick Answer: This question evaluates skills in data modeling, time-series event handling, business-rule implementation, monetary rounding/precision, and idempotent processing, with an emphasis on SQL and Python proficiency for data manipulation.