Quick Overview

Design a PackageTracker that handles out-of-order and duplicate package IDs while maintaining the contiguous delivered frontier from zero. Discuss how to report every missing ID up to the largest observed package, analyze amortized update and output-sensitive reporting costs, and scale the API for extremely sparse ranges.

Track the Contiguous Package Frontier and Missing IDs

Company: Amazon

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Overview: Design a PackageTracker that handles out-of-order and duplicate package IDs while maintaining the contiguous delivered frontier from zero. Discuss how to report every missing ID up to the largest observed package, analyze amortized update and output-sensitive reporting costs, and scale the API for extremely sparse ranges.

Loading…