← rippling Interview Insights

rippling·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Rippling SWE interview with a pretty dense algorithmic problem centered on delivery driver data. The focus was less on getting a working solution and more on whether you could reason through complexity tradeoffs out loud.

Questions Asked (1)

Q1

You have chronologically sorted delivery records for each driver. Given a timestamp t, how would you count the number of distinct drivers who were online at any point in the 24 hours before t? Walk through an optimized approach using per-driver binary search and explain the time complexity.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

The core idea clicked pretty fast: for each driver, binary search their sorted records to find entries that fall within the window, then count if at least one exists.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

For each driver, use binary search on their sorted timestamps to find the first record within the 24-hour window before t, then check if that record indicates they were online. Count drivers where such a record exists. This yields O(D log N) time, where D is the number of drivers and N is the average number of records per driver.

Pro tip: Clarify the data format: if each record includes an online/offline status, you need to check if the driver was online at any point, not just if they had any record. Also, mention that if the number of drivers is huge, you could optimize further by precomputing or using a segment tree, but the binary search approach is simple and efficient for most cases.

1. Understand the data and problem

Confirm that each driver has a chronologically sorted list of delivery records, each with a timestamp and possibly an online status. The goal is to count distinct drivers who were online at any point in [t-24h, t].

2. Define the search window

Compute the start time as t minus 24 hours. For each driver, you need to find if there is any record with timestamp >= start and <= t that indicates online.

3. Apply binary search per driver

For each driver's sorted list, use binary search to find the first record with timestamp >= start. If such a record exists and its timestamp <= t and it indicates online, then the driver was online.

4. Count and handle edge cases

Increment a counter for each driver meeting the condition. Consider edge cases: no records in window, records exactly at boundaries, and drivers with no records at all.

5. Analyze time complexity

Explain that binary search per driver takes O(log N) time, so total is O(D log N), where D is number of drivers and N is average records per driver. This is efficient compared to scanning all records.

Key Points to Mention

  • Binary search on sorted timestamps to find the first record in the window.
  • Check if the found record's timestamp is <= t and if it indicates online status.
  • Time complexity: O(D log N) where D is number of drivers and N is average records per driver.
  • Space complexity: O(1) extra space if done in-place, or O(D) if storing results.
  • Edge cases: no records in window, records exactly at boundaries, drivers with no records.
  • Alternative approaches: if D is large, consider indexing or segment trees, but binary search is simple and effective.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.