← Expedia Interview Insights

Expedia·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Apr 2026

Summary

Expedia system design round focused entirely on building an employee management backend, specifically the org hierarchy parts. Pretty deep dive, they really wanted to see you sweat the storage tradeoffs.

Questions Asked (4)

Q1

Design a backend service that supports full CRUD operations on employee records and can query an employee's full reporting chain up to the CEO, as well as their direct and indirect reports.

System DesignAPI & Integrations
Author's notes

I started with the API surface and that was probably the right call since it grounded everything.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then design a normalized schema with a self-referencing manager_id and indexes for efficient hierarchy queries. Propose a REST API for CRUD and dedicated endpoints for reporting chain and reports, using recursive CTEs or a closure table for traversal. Discuss trade-offs, caching, and scalability.

Pro tip: Mention that reporting chains are typically shallow (5-7 levels) and change infrequently, so caching the chain per employee can drastically reduce database load. Also, consider using a closure table for O(1) ancestor/descendant queries at the cost of write complexity.

1. Clarify Requirements and Scale

Ask about expected number of employees, read/write ratio, latency requirements, and whether the hierarchy is strictly a tree. This informs database and caching choices.

2. Design Data Model

Propose an employees table with id, name, manager_id (self-referencing foreign key), and other attributes. Discuss indexing manager_id for direct reports and options for hierarchy storage (adjacency list, closure table, materialized path).

3. Define API Endpoints

Outline RESTful endpoints: POST /employees, GET /employees/{id}, PUT /employees/{id}, DELETE /employees/{id}, GET /employees/{id}/chain, GET /employees/{id}/reports. Specify request/response formats and pagination for reports.

4. Implement Hierarchy Queries

Explain how to retrieve the reporting chain (using recursive CTE or closure table) and direct/indirect reports (recursive CTE or closure table). Discuss performance and potential optimizations like caching.

5. Address Scalability and Trade-offs

Discuss caching strategies (e.g., Redis for chains), database sharding or read replicas, and trade-offs between adjacency list (simple writes, complex reads) and closure table (complex writes, fast reads).

Key Points to Mention

  • Self-referencing foreign key (manager_id) for adjacency list model
  • Recursive Common Table Expressions (CTEs) for querying hierarchies
  • Closure table pattern for efficient ancestor/descendant queries
  • Caching reporting chains to reduce database load
  • RESTful API design with proper HTTP methods and status codes
  • Handling edge cases: cycles, orphaned records, and CEO with no manager

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

Q2

How would you model and store the organizational hierarchy? Walk through the tradeoffs between an adjacency list, closure table, and path enumeration.

Data ModelingTechnical Trade-offs
Author's notes

This is where I actually felt okay.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: read vs write patterns, depth of hierarchy, and query types. Then compare the three models (adjacency list, closure table, path enumeration) on query performance, write cost, storage overhead, and complexity. Finally, recommend a model based on the specific use case, possibly a hybrid approach.

Pro tip: Mention that many real-world systems use a hybrid approach, such as adjacency list for writes and a closure table for reads, and that the choice depends on whether the hierarchy is static or dynamic. Also, note that Expedia's org structure might have frequent reorganizations, so write performance could be critical.

1. Clarify Requirements

Ask about read/write ratio, depth of hierarchy, frequency of updates, and typical queries (e.g., find all reports, find manager chain).

2. Describe Each Model

Briefly explain adjacency list (parent_id), closure table (ancestor-descendant pairs), and path enumeration (materialized path).

3. Compare Trade-offs

Discuss query performance (reads), update cost (writes), storage overhead, and complexity for each model.

4. Recommend Based on Use Case

Choose a model or hybrid approach based on the requirements, and justify your choice.

Key Points to Mention

  • Adjacency list: simple, flexible writes, but recursive queries needed for reads (slow for deep hierarchies).
  • Closure table: fast reads (no recursion), but expensive writes (need to update all descendant paths) and higher storage.
  • Path enumeration: fast reads for ancestor queries, but limited depth and expensive updates (rewrite paths).
  • Query patterns: finding all descendants, ancestors, or direct reports.
  • Write frequency: frequent reorganizations favor adjacency list; static hierarchies favor closure table.
  • Hybrid approaches: e.g., adjacency list + closure table for read-heavy systems.

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

Q3

How do you handle concurrency when multiple admins are simultaneously updating the same part of the org tree?

System DesignTechnical Trade-offs
Author's notes

Blanked for a second here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints, such as the expected concurrency level and consistency needs. Then propose a layered approach: optimistic locking at the database level with versioning, combined with a conflict resolution strategy (e.g., last-write-wins or merge). Finally, discuss trade-offs and how you would handle conflicts gracefully, possibly with user intervention.

Pro tip: Mention that you would implement a 'compare-and-swap' mechanism using a version column or ETag, and that you would expose conflicts to the UI for manual resolution when automatic merging isn't safe. This shows you consider both technical and user experience aspects.

1. Clarify requirements

Ask about the expected frequency of concurrent updates, the tolerance for stale data, and whether the org tree is read-heavy or write-heavy. This determines the appropriate concurrency control strategy.

2. Choose a concurrency control mechanism

Propose optimistic locking (e.g., version numbers) for low contention scenarios, or pessimistic locking (e.g., row-level locks) for high contention. Explain why one is preferred over the other.

3. Design conflict detection and resolution

Describe how conflicts are detected (e.g., version mismatch) and resolved. Options include last-write-wins, merging changes, or rejecting the update and notifying the user.

4. Implement at the right layer

Decide whether to handle concurrency at the database level (e.g., transactions, isolation levels), application level (e.g., distributed locks), or both. Consider scalability and performance.

5. Discuss trade-offs and edge cases

Acknowledge trade-offs like performance vs. consistency, and edge cases like network partitions or long-running transactions. Mention monitoring and logging for conflict occurrences.

Key Points to Mention

  • Optimistic vs. pessimistic locking
  • Versioning (e.g., version column, ETag)
  • Conflict resolution strategies (last-write-wins, merge, manual)
  • Database isolation levels and transactions
  • Distributed locking (e.g., Redis, ZooKeeper) for multi-instance deployments
  • User experience: notifying admins of conflicts and allowing them to resolve

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

Q4

What are the read/write tradeoffs at scale for this kind of hierarchical data service?

Technical Trade-offsSystem Design
Author's notes

Talked about caching the reporting chain since it's read-heavy and changes infrequently.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the hierarchical data service's access patterns and scale requirements, then systematically compare read and write tradeoffs across storage, caching, and indexing strategies. Use concrete examples like materialized paths vs. adjacency lists, and discuss how choices impact latency, throughput, and consistency.

Pro tip: Frame tradeoffs in terms of Expedia's specific use cases, such as property hierarchies or user itineraries, and mention how read-heavy workloads (e.g., search) might favor denormalization while write-heavy updates (e.g., inventory changes) need careful consistency handling.

1. Clarify requirements and scale

Ask about expected read/write ratio, data size, depth of hierarchy, and consistency needs to ground the discussion in realistic constraints.

2. Analyze read tradeoffs

Discuss how hierarchical queries (e.g., fetching a subtree) can be optimized via denormalization, caching, or read-optimized indexes, but note increased storage and write complexity.

3. Analyze write tradeoffs

Explain how writes (e.g., updating a node) may require cascading updates or rebalancing, impacting latency and throughput; consider write-optimized structures like LSM trees.

4. Evaluate consistency and partitioning

Address how partitioning by hierarchy (e.g., sharding by root) affects cross-shard reads/writes, and discuss eventual vs. strong consistency tradeoffs.

5. Recommend a balanced approach

Propose a hybrid strategy (e.g., caching hot subtrees, using adjacency lists for writes and materialized paths for reads) and justify based on the clarified requirements.

Key Points to Mention

  • Read-heavy vs. write-heavy workload implications on schema design (e.g., denormalization vs. normalization).
  • Storage engine choices: B-trees for read-optimized, LSM trees for write-optimized, and their impact on hierarchical data.
  • Caching strategies (e.g., Redis) for frequently accessed subtrees to reduce read latency.
  • Indexing techniques like materialized paths, nested sets, or closure tables for efficient hierarchical queries.
  • Partitioning/sharding strategies to distribute load and their effect on cross-shard operations.
  • Consistency models (strong vs. eventual) and how they affect read/write tradeoffs in distributed systems.

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