Rippling SDE2

rippling logo
rippling
SDE IIOngoing
August 25, 202597 reads

Summary

I interviewed for an SDE2 position at Rippling where I was tasked with designing and implementing a system for managing delivery driver payments, progressing from basic cost tracking to managing paid and unpaid deliveries.

Full Experience

During my interview for the SDE2 role at Rippling, I was presented with a comprehensive coding and system design challenge. The core task was to build a robust system for a food delivery company to manage its delivery drivers and calculate their earnings. I first had to implement functions to add drivers with their hourly rates, record delivery start and end times, and then aggregate the total cost of all deliveries for a live dashboard. This initial phase heavily emphasized good OOP practices and efficient data storage for time-based data. Subsequently, the problem evolved, requiring me to add functionalities for payment tracking. This involved implementing a payUpTo function to mark deliveries as paid based on a specific time and a getTotalCostUnpaid function to report outstanding payments. The problem statement explicitly mentioned that the solution did not need to be thread-safe, allowing me to focus on the core logic and data structures.

Interview Questions (2)

Q1
Delivery Driver Payment System (Initial Design)
Data Structures & Algorithms

Food delivery companies employ tens of thousands of delivery drivers who each submit hundreds of deliveries per week. Delivery details are automatically sent to the system immediately after the delivery.

Delivery drivers have different hourly payment rates, depending on their performance. Drivers can take on, and be paid for, multiple deliveries simultaneously.

If a driver is paid $10.00 per hour, and a delivery takes 1 hour and 30 minutes, the driver is paid $15.00 for that delivery.

We are building a dashboard to show a single number - the total cost of all deliveries - on screens in the accounting department offices.

At first, we want the following functions:

  • addDriver(driverId [integer], usdHourlyRate [float])
    • The given driver will not already be in the system
    • The hourly rate applies per delivery, and a driver can be paid for simultaneous deliveries
  • recordDelivery(driverId [integer], startTime, endTime)
    • Discuss the time format you choose
    • Times require minimum one-second precision
    • The given driver will already be in the system
    • All deliveries will be recorded immediately after the delivery is completed
    • No delivery will exceed 3 hours
  • getTotalCost()
    • Return the total, aggregated cost of all drivers' deliveries recorded in the system
    • For example, return 135.30 if one driver is in the system and has a total cost of 100.30 USD and another driver is in the system and has a total cost of 35.00 USD.
    • This will be used for a live dashboard
    • Do not worry about exact formatting

All inputs will be valid.

Share any decisions or assumptions you make. If you do anything differently in this interview than you would in production, share that.

Before coding, let's discuss how you will store the time data and why.

We want to see good OOP practices. You may look up syntax using a search engine.

Q2
Delivery Driver Payment System (Add Payment Tracking)
Data Structures & Algorithms

The analytics team uses the live dashboard reporting function you built to see how much money is owed in total to all drivers.

Add the following functions:

  • payUpTo (payTime)
    • Pay all drivers for recorded deliveries which ended up to and including the given time
  • getTotalCostUnpaid()
    • Return the total, aggregated cost of all drivers' deliveries which have not been paid

The solution does not need to be thread-safe or handle concurrency.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!