← Airbnb Interview Insights

Airbnb·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Apr 2026

Summary

Airbnb coding round focused on building an in-memory key-value store from scratch. The question had a few layers to it and the follow-ups kept coming, so it was more involved than I expected going in.

Questions Asked (1)

Q1

Design and implement an in-memory key-value store supporting get, set, and delete operations. Be prepared to discuss API design choices, underlying data structures, edge cases, and extend the design with TTL or snapshot/restore semantics.

System DesignAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

Started with a plain hashmap and felt good about it, then they asked about TTL and I kind of fumbled the expiry logic.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then propose a simple design using a hash map with optional auxiliary structures for TTL or snapshots. Discuss trade-offs of different data structures and API choices, and be prepared to extend the design incrementally.

Pro tip: Demonstrate awareness of concurrency and memory management early, as these are critical for production systems at scale. Also, mention how you would test edge cases like concurrent access and TTL expiration.

1. Clarify Requirements

Ask about expected scale, concurrency needs, persistence requirements, and whether TTL or snapshot/restore are must-haves or nice-to-haves. This shows you think before coding.

2. Design API and Data Structures

Define clear method signatures (get, set, delete) and choose a hash map as the core structure. Discuss alternatives like balanced trees for ordered operations or concurrent maps for thread safety.

3. Handle Edge Cases

Address missing keys, null values, concurrent modifications, and memory limits. Explain how you would handle these in your implementation.

4. Extend with TTL

Propose adding expiration timestamps and a background cleaner or lazy deletion. Discuss trade-offs between active and passive expiration.

5. Extend with Snapshot/Restore

Describe how to serialize the store (e.g., to JSON or binary) and restore it, considering consistency and performance. Mention copy-on-write or incremental snapshots for efficiency.

Key Points to Mention

  • Choice of hash map for O(1) average-case operations, and when to consider alternatives like concurrent hash maps or LRU caches.
  • API design considerations: method naming, return types (e.g., boolean for delete), error handling, and thread safety.
  • TTL implementation strategies: lazy vs. active expiration, time wheel or priority queue for efficient cleanup.
  • Snapshot/restore: serialization formats, consistency guarantees, and performance implications.
  • Concurrency control: locks, read-write locks, or lock-free data structures, and their impact on performance.
  • Memory management: eviction policies (LRU, LFU), capacity limits, and monitoring.

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