PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Instacart

Compute delivery wait times

Last updated: Mar 29, 2026

Quick Overview

This question evaluates competence in event-driven simulation, scheduling and queueing concepts, and algorithmic analysis by requiring computation of average customer waiting time for single and multiple shoppers.

  • Medium
  • Instacart
  • Coding & Algorithms
  • Software Engineer

Compute delivery wait times

Company: Instacart

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Onsite

You're building a last‑mile delivery simulator. Given n orders, each with arrival_time (non-decreasing integers) and service_time (positive integers), a single shopper processes one order at a time and is idle until the next order arrives. Compute the average customer waiting time, where waiting_time = finish_time − arrival_time. Return a floating‑point average with 5 decimal places. Follow up: Now there are k shoppers (k ≥ 1). Process orders strictly in arrival order and always assign the next order to the earliest available shopper (break ties by smallest shopper id). Compute the resulting average waiting time and analyze time and space complexity.

Quick Answer: This question evaluates competence in event-driven simulation, scheduling and queueing concepts, and algorithmic analysis by requiring computation of average customer waiting time for single and multiple shoppers.

Related Interview Questions

  • Implement an In-Memory File Storage System - Instacart (medium)
  • Decode an encoded string - Instacart (medium)
  • Evaluate an arithmetic expression - Instacart (medium)
  • Implement worker time and payroll tracker - Instacart (hard)
  • Solve Two Sorted-Array Tasks - Instacart (hard)
Instacart logo
Instacart
Sep 6, 2025, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
4
0

You're building a last‑mile delivery simulator. Given n orders, each with arrival_time (non-decreasing integers) and service_time (positive integers), a single shopper processes one order at a time and is idle until the next order arrives. Compute the average customer waiting time, where waiting_time = finish_time − arrival_time. Return a floating‑point average with 5 decimal places. Follow up: Now there are k shoppers (k ≥ 1). Process orders strictly in arrival order and always assign the next order to the earliest available shopper (break ties by smallest shopper id). Compute the resulting average waiting time and analyze time and space complexity.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Instacart•More Software Engineer•Instacart Software Engineer•Instacart Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,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.