Implement Food Delivery Billing
Company: Rippling
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Onsite
Quick Answer: This question evaluates proficiency in implementing business billing rules, time and distance-based fee calculations, timestamp arithmetic, numerical rounding, and efficient aggregation for payouts; it falls under the Coding & Algorithms domain with emphasis on billing logic, time-series aggregation, and data processing.
Part 1: Compute Customer Delivery Charge for One Order
Constraints
- All timestamps use the format 'YYYY-MM-DD HH:MM' and are in the same timezone.
- 0 <= distance_km <= 1000
- requested_at <= picked_up_at <= delivered_at
- All timestamps are exact to the minute.
Examples
Input: ({'requested_at': '2024-05-01 10:30', 'picked_up_at': '2024-05-01 10:40', 'delivered_at': '2024-05-01 11:00', 'distance_km': 5.0},)