PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/System Design/Rippling

Design a delivery cost system

Last updated: May 25, 2026

Quick Overview

This question evaluates the ability to design an object-oriented in-memory delivery cost and payment accounting system, focusing on modeling time intervals, prorated duration calculations, currency rounding, idempotent payment semantics, time zone handling, numeric precision, and time/space complexity.

  • medium
  • Rippling
  • System Design
  • Software Engineer

Design a delivery cost system

Company: Rippling

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Technical Screen

Design an object-oriented Delivery Cost System. Each driver registers with an hourly rate. The system must support: RegisterDriver(driverId, hourlyRate) to add/update a driver; RecordDelivery(driverId, startTime, endTime) to record a delivery; getTotalCost() to return the total cost across all recorded deliveries, computed as the sum over deliveries of hourlyRate(driverId) × duration. Define whether times are inclusive/exclusive and how to handle partial hours and rounding. Implement payUpTo(timestamp) to mark all accrued costs up to the given timestamp as paid, splitting overlapping deliveries so only the portion up to timestamp is paid; and getTotalUnpaid() to return the remaining unpaid amount. Provide class design, core data structures, method signatures, and discuss idempotency, time zones, numeric precision, and time/space complexity.

Quick Answer: This question evaluates the ability to design an object-oriented in-memory delivery cost and payment accounting system, focusing on modeling time intervals, prorated duration calculations, currency rounding, idempotent payment semantics, time zone handling, numeric precision, and time/space complexity.

Related Interview Questions

  • Design a personalized news aggregator - Rippling (medium)
  • Design a Scalable News Feed - Rippling (medium)
  • Design Scalable Expense Violation Processing - Rippling (hard)
  • Design a news aggregator like Google News - Rippling (medium)
  • Design several large-scale systems - Rippling (hard)
Rippling logo
Rippling
Jul 31, 2025, 12:00 AM
Software Engineer
Technical Screen
System Design
84
0

Object-Oriented Delivery Cost and Payment Accounting System

Context

You are designing a small in-memory service to track delivery costs for drivers who are paid hourly. Deliveries are recorded with start and end timestamps. The system must compute total cost to date, support marking accrued costs up to a timestamp as paid, and report remaining unpaid amounts.

Make explicit assumptions about time interval semantics (inclusive/exclusive), how to prorate partial hours, and how to round currency.

Requirements

  • Drivers register with an hourly rate (and may be updated):
    • RegisterDriver(driverId, hourlyRate)
  • Record deliveries:
    • RecordDelivery(driverId, startTime, endTime)
  • Aggregate queries:
    • getTotalCost() → sum over all deliveries of hourlyRate(driverId) × duration
    • payUpTo(timestamp) → mark all accrued costs up to timestamp as paid. If a delivery overlaps the timestamp, only the portion up to timestamp is paid (logically split at the timestamp).
    • getTotalUnpaid() → total remaining unpaid amount after all payUpTo calls.

Deliverables

  • Class design and core data structures
  • Method signatures
  • Define: interval inclusivity/exclusivity; partial hours handling and rounding strategy
  • Discuss: idempotency, time zones, numeric precision, and time/space complexity

Solution

Show

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Rippling•More Software Engineer•Rippling Software Engineer•Rippling System Design•Software Engineer System Design
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.