← Disney Interview Insights

Disney·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Disney SWE interview with a meaty ad-targeting problem that was more nuanced than it looked on the surface. The question had a design component baked in, which I wasn't fully expecting going into what felt like a coding round.

Questions Asked (1)

Q1

You have a catalog of ads, each with attributes like target locations and age range. Given a targeting rule that has optional fields (target locations, min age, max age) and an AND/OR operator, return the IDs of ads that match. You need to decide how missing rule fields are handled and how the operator composes the per-field checks. Then discuss what data structures you'd use if this rule gets applied repeatedly against a static ad set.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

The missing-field part is where I fumbled first.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the semantics of missing rule fields and the operator, then walk through a straightforward per-ad evaluation algorithm. Finally, discuss how to optimize for repeated queries against a static ad set using indexing or precomputation.

Pro tip: Explicitly state your assumptions about missing fields (e.g., treat as wildcard) and the operator's scope (e.g., applies to all field checks), and mention that these should be configurable or documented. This shows you think about edge cases and maintainability.

1. Clarify requirements and assumptions

Ask about the meaning of missing fields (e.g., no constraint vs. must be absent) and how the AND/OR operator combines checks (e.g., all fields must pass for AND, any for OR). Confirm if the rule is applied once or repeatedly.

2. Design the matching logic

For each ad, evaluate each present rule field against the ad's attributes. Combine the boolean results using the operator. If a field is missing, treat it as always true (wildcard) unless specified otherwise.

3. Implement a naive solution

Iterate through all ads, apply the matching logic, and collect IDs of matching ads. This is O(N) per query and simple to implement.

4. Optimize for repeated queries

If the ad set is static and the rule is applied many times, consider indexing ads by attributes (e.g., location, age range) to quickly narrow candidates. Alternatively, precompute a decision tree or use a bitset representation for fast filtering.

5. Discuss trade-offs

Compare the naive approach (simple, flexible) with indexing (faster queries, but memory overhead and complexity). Mention that the choice depends on query frequency, ad set size, and update patterns.

Key Points to Mention

  • Handling of missing fields: treat as wildcard (always true) or as no constraint; be explicit about the assumption.
  • Operator semantics: AND requires all present field checks to pass; OR requires at least one to pass.
  • Naive algorithm: linear scan with per-field checks, O(N) time per query.
  • Indexing strategies: inverted index on locations, interval trees or sorted arrays for age ranges.
  • Bitset or bitmap indexing for fast set operations (AND/OR) across large ad sets.
  • Trade-offs: memory vs. speed, complexity vs. maintainability, and suitability for static vs. dynamic data.

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