Search
⌘K

Leetcode 379. Design Phone Directory

Design a data structure that manages a fixed pool of phone numbers (0..maxNumbers-1) supporting get (assign and return an available number), check (report if a number is available), and release (make a previously assigned number available again). The challenge is to support these operations efficiently (ideally O(1)) and correctly handle reuse of released numbers.

Asked at:

Apple


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid February, 2025

Apple

Senior

Variation of this problem to be used in the context of designing fixed size resource allocator

Mid September, 2024

Apple

Senior

Create a phone directory where given a phone number, you return the name (and vice versa)

Comments

Your account is free and you can post anonymously if you choose.