← Expedia Interview Insights

Expedia·Software Engineer·Technical Phone Screen·Senior

Senior
May 2026

Summary

Expedia software engineer interview where they drop a big JSON blob in the editor and tell you to do something with it. Sounds easy but the real conversation is about everything around the parsing, not the parsing itself.

Questions Asked (6)

Q1

You're given a large JSON string in the editor. Write code to parse it and extract specific fields from it. You can use any language or library you want.

Technical Trade-offsAPI & Integrations
Author's notes

The open-ended part threw me a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: which fields to extract, expected input size, and performance constraints. Then outline a solution that uses a streaming JSON parser to handle large data efficiently, and discuss trade-offs between different parsing approaches. Finally, walk through a code example in a language you're comfortable with, highlighting error handling and edge cases.

Pro tip: Mention that for very large JSON, streaming parsers like ijson (Python) or Jackson (Java) avoid loading the entire document into memory, which is crucial for scalability. Also, discuss how you would handle malformed JSON gracefully.

1. Clarify Requirements

Ask about the JSON structure, which fields to extract, the expected size of the JSON, and any performance or memory constraints. This shows you think before coding.

2. Choose Parsing Strategy

Decide between DOM parsing (load entire JSON into memory) and streaming parsing (process incrementally). For large JSON, streaming is preferred to avoid memory issues.

3. Select Language and Library

Pick a language and library that supports your chosen strategy. For example, Python with ijson for streaming, or Java with Jackson. Explain why you chose it.

4. Implement Extraction Logic

Write code to parse the JSON and extract the required fields. Include error handling for malformed JSON and missing fields.

5. Discuss Trade-offs and Optimizations

Talk about trade-offs: streaming vs. DOM, performance vs. simplicity, and how you might optimize further (e.g., parallel processing, schema validation).

Key Points to Mention

  • Streaming vs. DOM parsing: memory efficiency and performance implications
  • Error handling: dealing with malformed JSON, missing fields, or unexpected types
  • Library choices: ijson, Jackson, Gson, or built-in parsers, and their trade-offs
  • Scalability: handling JSON larger than available memory
  • Schema validation: ensuring the JSON conforms to expected structure
  • Testing: how to test the parsing code with various inputs

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

Q2

Once you've parsed the JSON, how would you model the data in your code? Walk through your reasoning between typed DTO classes versus keeping things as raw maps.

Data ModelingTechnical Trade-offs
Author's notes

I talked through DTOs for known schemas and maps for dynamic or unknown structures.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging that the choice depends on the context—data volatility, team size, and API stability. Then walk through a balanced trade-off analysis, leaning toward typed DTOs for maintainability and safety, but noting when raw maps might be acceptable. Conclude with a pragmatic recommendation that fits Expedia's scale and engineering culture.

Pro tip: Mention that you'd use a hybrid approach: typed DTOs for core domain objects and raw maps for flexible or experimental endpoints, showing you understand real-world constraints. Also, highlight that Expedia's codebase likely has established patterns, so you'd align with team conventions rather than impose your own.

1. Clarify the context

Ask about the data source, schema stability, and how the parsed data will be used. This shows you don't jump to solutions without understanding requirements.

2. List trade-offs of typed DTOs

Discuss benefits like compile-time safety, auto-completion, and self-documenting code, but also mention drawbacks like boilerplate and rigidity when schemas change.

3. List trade-offs of raw maps

Highlight flexibility and quick prototyping, but note risks like runtime errors, lack of discoverability, and difficulty in refactoring.

4. Consider Expedia's scale and domain

Tie your reasoning to Expedia's needs: large teams, complex travel data, and long-term maintenance favor typed DTOs, but some dynamic content might warrant maps.

5. Propose a hybrid or pragmatic solution

Recommend using typed DTOs for stable, critical data and raw maps for flexible or rapidly changing parts, with clear boundaries and validation.

Key Points to Mention

  • Compile-time type safety and early error detection
  • Code maintainability and team collaboration
  • Performance considerations (serialization/deserialization overhead)
  • Schema evolution and backward compatibility
  • Use of code generation tools (e.g., OpenAPI, JSON schema)
  • Testing and validation strategies for each approach

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

Q3

How do you handle missing fields, optional values, and type mismatches when deserializing JSON?

Technical Trade-offsAPI & Integrations
Author's notes

Pretty standard but I fumbled the type mismatch part.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging that JSON deserialization robustness is critical for API integrations, then outline a layered strategy: schema validation, defensive parsing with defaults, and explicit error handling. Emphasize trade-offs between strictness and resilience, and tie your answer to real-world scenarios like handling third-party APIs at Expedia.

Pro tip: Mention that you log deserialization failures with enough context (e.g., raw payload, field path) to debug quickly, and that you use contract tests to catch schema drift early. This shows you think about production observability and prevention, not just handling errors.

1. Define the contract and expectations

Clarify which fields are required vs optional, expected types, and acceptable defaults. Use a schema (e.g., JSON Schema, OpenAPI) to document and validate the contract.

2. Choose a deserialization strategy

Decide between strict mode (fail fast on any mismatch) and lenient mode (coerce types, apply defaults). Consider using libraries that support both, like Jackson or Gson with custom deserializers.

3. Handle missing and optional fields

For optional fields, provide sensible defaults or use nullable types. For required fields, throw a clear exception with the field name and expected type.

4. Manage type mismatches

Implement type coercion where safe (e.g., string to number) or reject with detailed errors. Use custom deserializers or validation annotations to enforce types.

5. Log, monitor, and test

Log failures with context, monitor error rates, and write unit tests for edge cases (nulls, wrong types, missing fields). Use contract tests to ensure compatibility with upstream services.

Key Points to Mention

  • Use of schema validation (JSON Schema, OpenAPI) to enforce contracts before deserialization.
  • Trade-offs between strict and lenient parsing: strict catches bugs early but may break on minor changes; lenient is resilient but can hide issues.
  • Handling missing fields with defaults or optional types (e.g., Optional in Java, nullable in Kotlin).
  • Type coercion strategies and when to reject mismatches (e.g., avoid silent data corruption).
  • Error handling and logging: include field path, expected vs actual type, and raw payload for debugging.
  • Testing: unit tests for edge cases and contract tests to detect schema drift.

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

Q4

Can you explain streaming JSON parsers and when you'd choose a streaming approach over full deserialization?

System DesignTechnical Trade-offs
Author's notes

This is where it got interesting.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining streaming JSON parsing as incremental processing of JSON data without loading the entire document into memory, then contrast it with full deserialization. Explain the trade-offs (memory, latency, complexity) and give concrete scenarios where streaming is preferable, ideally tying it to Expedia's domain like handling large search results or real-time data feeds.

Pro tip: Mention that streaming parsers are not just for huge files but also for unbounded streams and when you need early results; also note that they often require a state machine or event-based handling, which adds complexity but can be worth it for scalability.

1. Define streaming JSON parsing

Explain that it processes JSON data incrementally, emitting events (e.g., start object, key, value) as it reads, rather than building a full in-memory object graph.

2. Contrast with full deserialization

Highlight that full deserialization loads the entire JSON into memory and maps it to objects, which is simpler but memory-intensive and higher latency for large payloads.

3. Discuss trade-offs

Cover memory usage, latency, complexity, and error handling: streaming reduces memory and can start processing sooner, but requires more code and careful error recovery.

4. Give scenarios for streaming

Provide examples: processing large log files, real-time data feeds (e.g., Kafka), mobile apps with limited memory, or when you only need a subset of fields from a huge JSON response.

5. Relate to Expedia context

Tie it to Expedia: e.g., streaming hotel search results as they arrive to show partial results faster, or handling large JSON payloads from third-party APIs without memory spikes.

Key Points to Mention

  • Memory efficiency: streaming avoids loading entire JSON into memory, crucial for large files or constrained environments.
  • Latency: streaming allows processing to begin as soon as data arrives, enabling early results or real-time handling.
  • Complexity: streaming parsers require event-based or callback handling, which can be more complex to implement and debug.
  • Use cases: large files, unbounded streams, real-time data, mobile/embedded systems, and when only partial data is needed.
  • Libraries: mention examples like Jackson Streaming API (Java), ijson (Python), or SAX-style parsers for JSON.
  • Error handling: streaming can be more resilient to malformed data if you can skip or recover, but full deserialization fails fast.

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

Q5

How would you write a JSON parser from scratch? Describe the approach and what the time and space complexity would look like.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Recursive descent over the grammar.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scope: which JSON features to support (e.g., basic types, nested structures, escapes) and whether to build a tokenizer and parser or a single-pass recursive descent parser. Then outline a recursive descent approach with a lexer to tokenize input, followed by a parser that builds a tree (or directly evaluates) while handling errors. Finally, analyze time and space complexity, noting O(n) time and O(d) space for depth d, with potential O(n) space for the output tree.

Pro tip: Mention that you'd use an iterative approach with an explicit stack to avoid stack overflow on deeply nested JSON, and discuss trade-offs between building an AST versus streaming/SAX-style parsing for memory efficiency.

1. Clarify requirements and scope

Ask which JSON features to support (e.g., Unicode escapes, numbers, nested objects/arrays) and whether the parser should produce a DOM tree or stream events. This shows you think about real-world constraints before coding.

2. Design the architecture

Propose a two-phase approach: a lexer/tokenizer that converts the input string into tokens, and a parser (recursive descent or iterative with a stack) that consumes tokens to build the output. Alternatively, describe a single-pass recursive descent parser that directly interprets characters.

3. Outline parsing logic

Explain how to handle each JSON construct: objects (key-value pairs), arrays, strings (with escape sequences), numbers, booleans, and null. Describe error handling for invalid syntax and how to manage state (e.g., using an index pointer or token stream).

4. Analyze complexity

State that time complexity is O(n) where n is the input length, as each character is processed a constant number of times. Space complexity is O(d) for the call stack in recursive descent (d = nesting depth) plus O(m) for the output tree (m = number of nodes), which can be O(n) in the worst case.

5. Discuss optimizations and trade-offs

Mention alternatives like iterative parsing to avoid stack overflow, streaming parsers for large inputs, and the trade-off between building a full AST versus on-the-fly processing. Highlight that the choice depends on use case (e.g., memory vs. speed).

Key Points to Mention

  • Recursive descent parsing is a natural fit for JSON's grammar, but be aware of stack depth limitations.
  • Tokenization separates concerns and simplifies the parser, but a single-pass parser can be more efficient.
  • Time complexity is O(n) because each character is visited once; space complexity is O(d) for recursion depth and O(m) for the output structure.
  • Error handling: report line/column numbers and meaningful messages for invalid JSON.
  • Consider iterative parsing with an explicit stack to handle deeply nested JSON without stack overflow.
  • Trade-offs: building a DOM tree uses more memory but allows random access; streaming (SAX) is memory-efficient but harder to use.

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

Q6

How would you test the JSON extraction logic you just wrote?

Technical Trade-offsSystem Design
Author's notes

Unit tests with valid JSON, malformed input, missing required fields, extra unknown fields, deeply nested structures.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and edge cases of the JSON extraction logic, then outline a layered testing strategy from unit tests to integration tests. Emphasize test-driven development, property-based testing, and continuous integration to ensure robustness and maintainability.

Pro tip: Mention that you would write tests before or alongside the code (TDD) and use mutation testing to validate the effectiveness of your test suite. This shows a proactive and quality-focused mindset.

1. Clarify Requirements and Edge Cases

Identify the expected inputs, outputs, and edge cases such as malformed JSON, missing keys, nested structures, and large payloads. This ensures comprehensive test coverage.

2. Design Unit Tests

Write focused unit tests for the extraction function, covering normal cases, boundary conditions, and error handling. Use mocking for external dependencies if needed.

3. Implement Property-Based and Fuzz Testing

Use property-based testing to generate random valid and invalid JSON inputs and verify invariants. Fuzz testing can uncover unexpected edge cases.

4. Integrate with System and Performance Tests

Test the extraction logic within the larger system, including API endpoints and data pipelines. Include performance tests to ensure it handles expected load.

5. Automate and Monitor

Set up continuous integration to run tests on every commit. Add logging and monitoring in production to catch issues not covered by tests.

Key Points to Mention

  • Test-driven development (TDD) and writing tests before code
  • Coverage of edge cases: malformed JSON, missing fields, nested objects, arrays, null values
  • Use of testing frameworks (e.g., JUnit, pytest, Jest) and assertion libraries
  • Property-based testing (e.g., QuickCheck, Hypothesis) and fuzz testing
  • Integration with CI/CD pipelines and automated regression testing
  • Performance and load testing for scalability

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