← Expedia Interview InsightsSoftware Engineer

Expedia·Software Engineer·Technical Phone Screen·Senior

Senior
Jun 2026

Summary

Expedia software engineer interview that looked deceptively simple on the surface. They paste a JSON blob into the editor and suddenly you're not just parsing it, you're defending every design decision you make along the way.

Questions Asked (6)

Q1

Given a large JSON string pasted into the editor, write code to parse it and extract specific fields. You can use any language or library you want.

API & IntegrationsTechnical Trade-offs
Author's notes

I went straight for the one-liner deserialization and it felt like a trap the moment I finished typing.

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 using a streaming parser to handle large JSON efficiently, and discuss trade-offs between simplicity and scalability. Finally, write clean, modular code with error handling and explain your choices.

Pro tip: Mention that for very large JSON, loading the entire string into memory can cause out-of-memory errors, so a streaming approach is often necessary. Also, highlight that using a battle-tested library (e.g., Jackson for Java, ijson for Python) is usually better than writing a custom parser.

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 ensures you solve the right problem.

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 you're comfortable with and a suitable library. For example, Python with ijson for streaming, or Java with Jackson's streaming API. Justify your choice based on performance and ease of use.

4. Implement Extraction Logic

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

5. Discuss Trade-offs and Optimizations

Explain the trade-offs of your approach (e.g., memory vs. speed) and suggest possible optimizations like parallel processing or using a schema. This shows depth of understanding.

Key Points to Mention

  • Streaming vs. DOM parsing: when to use each and why streaming is better for large JSON.
  • Memory management: avoiding loading the entire JSON into memory to prevent OOM errors.
  • Error handling: dealing with malformed JSON, missing fields, and type mismatches.
  • Library choices: pros and cons of popular libraries (e.g., Jackson, Gson, ijson, json.loads).
  • Performance considerations: time complexity, I/O bottlenecks, and potential for parallelization.
  • Code clarity: writing maintainable, testable code with clear separation of concerns.

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? Walk through the tradeoffs between typed DTO classes and raw maps.

Data ModelingTechnical Trade-offs
Author's notes

This one I actually felt okay about.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the use case and data characteristics (e.g., schema stability, performance needs, team conventions). Then compare typed DTOs and raw maps across key dimensions like type safety, maintainability, and performance, and conclude with a recommendation tailored to the scenario.

Pro tip: Mention that you'd often start with raw maps for rapid prototyping and then refactor to typed DTOs as the schema stabilizes, showing pragmatism and awareness of technical debt.

1. Clarify requirements and context

Ask about the data source, schema stability, expected volume, and how the data will be used. This determines which approach is more suitable.

2. Define typed DTO approach

Explain how you would create classes/structs with fields matching the JSON schema, using serialization libraries to map JSON to objects.

3. Define raw map approach

Describe using generic maps (e.g., Map<String, Object> in Java, dict in Python) to hold parsed JSON without predefined structure.

4. Compare tradeoffs

Discuss pros and cons of each: type safety, compile-time checks, IDE support, refactoring ease vs. flexibility, less boilerplate, and handling dynamic schemas.

5. Recommend based on scenario

Conclude with a recommendation, such as using DTOs for stable, critical data and maps for exploratory or highly dynamic data, possibly with a hybrid approach.

Key Points to Mention

  • Type safety and compile-time error detection with DTOs
  • Flexibility and reduced boilerplate with raw maps
  • Performance considerations: serialization/deserialization overhead, memory footprint
  • Maintainability and refactoring: DTOs easier to refactor, maps require runtime checks
  • Schema evolution: DTOs need updates when schema changes, maps adapt more easily
  • Tooling and IDE support: DTOs provide autocompletion and documentation

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 or optional fields, type mismatches, and malformed JSON in your parsing logic?

Technical Trade-offsSystem Design
Author's notes

Answered this okay but I leaned too hard on library defaults.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by outlining a layered parsing strategy: validate JSON syntax first, then handle schema-level issues like missing fields and type mismatches. Emphasize defensive coding with clear error handling and logging, and discuss trade-offs between strict and lenient parsing based on context.

Pro tip: Mention that you log parsing errors with enough context to debug but avoid logging sensitive data, and that you use metrics to monitor parsing failures in production. This shows you think about observability and security, which is crucial for a travel platform like Expedia.

1. Validate JSON Syntax

Use a robust JSON parser to catch malformed JSON early. Handle syntax errors gracefully by returning a clear error response or logging the issue.

2. Define and Enforce Schema

Establish a schema (e.g., JSON Schema) to specify required fields, optional fields, and expected types. Validate incoming data against this schema to detect missing or mismatched fields.

3. Handle Missing/Optional Fields

For optional fields, provide sensible defaults or make them nullable. For required fields, fail fast with a descriptive error. Consider using a builder pattern or configuration to manage defaults.

4. Manage Type Mismatches

Attempt safe type coercion when appropriate (e.g., string to number) but reject incompatible types. Use strong typing in your language to catch issues at compile time where possible.

5. Log, Monitor, and Iterate

Log parsing errors with context (without sensitive data) and monitor metrics to identify frequent issues. Use this feedback to refine schema and parsing logic.

Key Points to Mention

  • Use of JSON Schema or similar validation libraries (e.g., Ajv, Marshmallow) to enforce structure and types.
  • Trade-offs between strict parsing (fail fast) and lenient parsing (best-effort) based on use case (e.g., internal vs. external APIs).
  • Strategies for optional fields: defaults, null handling, or conditional logic.
  • Type coercion techniques and when to avoid them (e.g., avoid coercing '123' to number if it could be a string ID).
  • Error handling patterns: try-catch blocks, Result types, or error monads to propagate parsing errors.
  • Observability: logging parsing errors with correlation IDs and monitoring failure rates to detect upstream issues.

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

Q4

Can you discuss streaming parsers versus full deserialization for very large JSON payloads, and when you'd choose one over the other?

System DesignTechnical Trade-offs
Author's notes

This is where I started sweating.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining both approaches and their core mechanics, then contrast them on memory usage, latency, and complexity. Use a concrete example like processing a multi-GB JSON response from a partner API, and explain when each is appropriate based on payload size, available memory, and whether you need the entire object. Conclude with a recommendation tied to Expedia's scale and real-time needs.

Pro tip: Mention that streaming parsers can still be used with full deserialization libraries like Jackson by enabling streaming mode, and that the real trade-off often comes down to whether you need random access to the data or can process it sequentially.

1. Define the two approaches

Briefly explain that full deserialization loads the entire JSON into memory as objects, while streaming parsers read and process tokens incrementally without building a full object graph.

2. Compare on key dimensions

Discuss memory footprint (O(n) vs O(1) or O(depth)), latency (startup vs total time), and complexity (ease of use vs manual token handling).

3. Give a concrete scenario

Use an example like processing a 5GB JSON log file or a large hotel availability response, and explain which approach you'd choose and why.

4. Address trade-offs and hybrid options

Mention that streaming can be combined with selective deserialization (e.g., using Jackson's streaming API to extract only needed fields) and that sometimes a full deserialization is fine if the payload fits in memory.

5. Tie back to Expedia's context

Relate to Expedia's need for scalability and real-time processing, suggesting streaming for large partner feeds or batch jobs, and full deserialization for smaller, interactive API responses.

Key Points to Mention

  • Memory efficiency: streaming avoids loading entire payload into memory, preventing OOM errors.
  • Latency: streaming can start processing sooner, but full deserialization may be faster for small payloads due to optimized libraries.
  • Complexity: streaming requires manual token handling and state management, increasing code complexity.
  • Use cases: streaming for large files, logs, or infinite streams; full deserialization for typical REST API responses under a few MB.
  • Hybrid approaches: using streaming parsers to extract specific fields without deserializing the whole object.
  • Error handling: streaming can fail mid-stream, requiring careful resource cleanup and partial processing strategies.

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

Q5

How would you implement a JSON parser from scratch using recursive descent, and what are the time and space complexity bounds?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Didn't see this coming.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by outlining the JSON grammar and the recursive descent parser structure, then walk through the parsing functions for each JSON element (objects, arrays, strings, numbers, literals). Finally, analyze the time and space complexity, emphasizing the linear bounds and the role of recursion depth.

Pro tip: Mention that while recursive descent is elegant, it can hit stack limits on deeply nested JSON; an iterative approach with an explicit stack or a depth limit can mitigate this, showing you consider real-world robustness.

1. Define the JSON Grammar

Briefly state the formal grammar for JSON (e.g., value → object | array | string | number | true | false | null) to set the foundation for the parser.

2. Design the Parser Structure

Explain that you'll write a recursive descent parser with functions like parseValue, parseObject, parseArray, parseString, parseNumber, each consuming tokens and advancing the input position.

3. Implement Parsing Functions

Walk through key functions: parseObject handles key-value pairs with commas and braces, parseArray handles elements, and parseString/parseNumber handle literals with proper escaping and number formats.

4. Handle Errors and Edge Cases

Discuss error handling for invalid syntax, unexpected tokens, and edge cases like empty objects/arrays, nested structures, and Unicode escapes.

5. Analyze Complexity

Conclude that time complexity is O(n) where n is input length, as each character is processed once; space complexity is O(d) for recursion depth d, which in worst case (deeply nested) is O(n).

Key Points to Mention

  • Recursive descent is a top-down parsing technique that directly mirrors the grammar.
  • Time complexity is linear O(n) because each character is consumed exactly once.
  • Space complexity is O(d) for the call stack, where d is the nesting depth; worst-case O(n) for deeply nested JSON.
  • Use of a tokenizer or lexer can simplify parsing, but a character-by-character approach is also common.
  • Handling of JSON specifics: string escapes (\n, \uXXXX), number formats (integers, floats, exponents), and whitespace.
  • Potential stack overflow with deep nesting; mitigation strategies include iterative parsing or depth limits.

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

Q6

How would you write tests for the JSON extraction logic?

Technical Trade-offs
Author's notes

Short answer: I covered happy path, missing fields, wrong types, empty input.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the JSON extraction logic's requirements and edge cases, then outline a layered testing strategy covering unit, integration, and property-based tests. Emphasize test data design, mocking external dependencies, and validating both success and failure paths.

Pro tip: Mention that you'd use contract tests or schema validation to ensure extracted JSON conforms to expected structure, and that you'd include performance tests for large payloads—this shows you think beyond basic correctness.

1. Clarify Requirements and Edge Cases

Ask questions to understand the extraction logic's inputs, outputs, and constraints, such as handling malformed JSON, nested structures, and missing fields.

2. Design Test Data and Scenarios

Create representative test cases including valid JSON, invalid JSON, empty responses, large payloads, and edge cases like duplicate keys or special characters.

3. Choose Testing Levels and Tools

Decide on unit tests for individual functions, integration tests for the extraction pipeline, and property-based tests for robustness; select appropriate frameworks (e.g., JUnit, pytest).

4. Implement Tests with Mocking

Write tests that mock external dependencies (e.g., HTTP calls) to isolate the extraction logic, and assert on both the extracted data and error handling.

5. Validate and Iterate

Run tests, measure coverage, and refine based on failures; consider adding contract tests to ensure compatibility with upstream services.

Key Points to Mention

  • Unit testing with parameterized inputs for various JSON structures
  • Mocking external dependencies to isolate the extraction logic
  • Testing error handling for malformed JSON, timeouts, and missing fields
  • Property-based testing to generate random valid/invalid JSON
  • Schema validation and contract testing for output structure
  • Performance testing with large JSON payloads

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