← Airbnb Interview Insights

Airbnb·Data Scientist·Take-home Assignment·Senior

Senior
May 2026

Summary

Airbnb DS interview that was basically one big SQL/Python case study disguised as a take-home. The problem looked manageable at first glance until I actually read the attribution rules and edge cases, then it became a whole thing.

Questions Asked (3)

Q1

Given a visits table and a bookings table, deduplicate visits within a 60-second window per user (keep only the latest), then attribute each confirmed booking to the most recent visit by the same user within the prior 24 hours. Compute control vs treatment metrics by day and variant for a 7-day window, including visits, unique users, attributed bookings, conversion rate, total revenue, revenue per visit, cancellation counts, and unattributed confirmed booking counts. Provide SQL or Python and explain your assumptions.

A/B Testing & ExperimentationProduct Analytics & MetricsData Modeling
Author's notes

The deduplication step is where I stumbled first.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the business context and assumptions (e.g., timezone, definition of confirmed booking, cancellation handling). Then outline a step-by-step data pipeline: deduplicate visits, attribute bookings, and compute metrics. Finally, provide SQL or Python code with clear comments and discuss trade-offs.

Pro tip: Mention that you would validate the deduplication logic by checking the distribution of visit intervals and ensuring no legitimate visits are dropped, and consider using window functions for efficiency.

1. Clarify requirements and assumptions

Ask clarifying questions about timezone, definition of confirmed booking, cancellation handling, and whether the 7-day window is rolling or fixed. State assumptions explicitly.

2. Deduplicate visits

Use a window function to rank visits per user ordered by timestamp descending, and keep only the latest visit within each 60-second window. Ensure that deduplication is done per user and that the window is based on the visit timestamp.

3. Attribute bookings to visits

For each confirmed booking, find the most recent visit by the same user within the prior 24 hours. Use a lateral join or window function to match bookings to visits based on user ID and time difference.

4. Compute metrics by day and variant

Aggregate data by day and variant (control/treatment) for the 7-day window. Calculate visits, unique users, attributed bookings, conversion rate (attributed bookings / unique users), total revenue, revenue per visit, cancellation counts, and unattributed confirmed booking counts.

5. Provide code and explain

Write SQL or Python code with clear comments, explaining each step. Discuss potential pitfalls such as timezone conversions, data volume, and performance optimization.

Key Points to Mention

  • Handling of timezones and timestamp precision
  • Definition of 'confirmed booking' and how cancellations are treated
  • Use of window functions (e.g., ROW_NUMBER, LAG) for deduplication and attribution
  • Edge cases: multiple visits within 60 seconds, bookings without prior visits, visits without bookings
  • Metric definitions: conversion rate (per user or per visit?), revenue per visit
  • Performance considerations for large datasets (indexing, partitioning)

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

Q2

Produce a daily line plot of conversion rate for control and treatment with 95% Wilson confidence intervals.

A/B Testing & ExperimentationProduct Analytics & Metrics
Author's notes

Knew Wilson CIs were the right call for proportions with small samples, but I had to look up the exact formula mid-session which was a bit embarrassing.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the metric definition and data granularity, then outline the computation of daily conversion rates and Wilson confidence intervals for each group. Describe the visualization approach, emphasizing clear distinction between control and treatment with error bars, and discuss how to interpret trends and significance over time.

Pro tip: Mention that Wilson intervals are more reliable for proportions, especially with small daily sample sizes, and consider applying multiple comparison corrections or using sequential testing if daily significance is a concern.

1. Clarify metric and data

Confirm the definition of conversion rate (e.g., bookings per session) and ensure data is aggregated daily for each group. Check for missing days or anomalies.

2. Compute daily rates and intervals

For each day and group, calculate the conversion rate and the 95% Wilson confidence interval using the number of successes and trials.

3. Create the line plot

Plot the daily conversion rates for control and treatment as lines, with shaded error bands or error bars representing the Wilson intervals. Use distinct colors and a legend.

4. Interpret and annotate

Highlight any days where intervals do not overlap, indicating potential significant differences. Discuss trends, seasonality, and practical significance.

Key Points to Mention

  • Wilson score interval formula and its advantages over normal approximation for proportions
  • Daily aggregation and handling of varying sample sizes
  • Visualization best practices: error bars, confidence bands, clear labels
  • Interpretation of overlapping vs non-overlapping intervals
  • Potential issues: multiple comparisons, sequential testing, and novelty effects
  • Consideration of practical significance vs statistical significance

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

Q3

How do you handle edge cases like a user appearing in both control and treatment within the same 7-day window, multiple bookings following a single visit, or a booking that falls just outside the 24-hour attribution window?

A/B Testing & ExperimentationAdaptability & AmbiguityRoot Cause Analysis
Author's notes

They basically embedded this into the problem statement rather than asking it outright.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging that edge cases are inevitable in experimentation and must be handled systematically to maintain validity. Then walk through a structured framework: define clear rules for each edge case, apply them consistently, and validate the impact on results. Emphasize the importance of pre-registration and sensitivity analysis to ensure robustness.

Pro tip: Proactively mention that you would document these edge cases and their handling in the experiment design doc, and run a sensitivity analysis to show results are robust to different handling choices. This demonstrates rigor and prevents post-hoc debates.

1. Define clear assignment and attribution rules upfront

Specify how users are assigned to variants (e.g., first exposure wins) and how events are attributed (e.g., 24-hour window from first exposure). Document these rules before the experiment starts.

2. Handle user overlap with deterministic assignment

If a user appears in both control and treatment within the window, use a deterministic rule like first exposure or a hash-based assignment to ensure they are consistently assigned to one variant.

3. Address multiple bookings from a single visit

Decide whether to count all bookings or only the first. Consider the business context: if the goal is to measure incremental bookings, counting all may be appropriate, but if it's to measure conversion, the first booking might be more relevant.

4. Manage bookings outside the attribution window

Apply the pre-defined attribution window strictly. If a booking falls outside, exclude it from the primary analysis but consider a sensitivity analysis with a longer window to check robustness.

5. Validate and communicate impact

Quantify how many users/bookings are affected by each edge case, run sensitivity analyses, and communicate any assumptions or limitations to stakeholders.

Key Points to Mention

  • Deterministic assignment to avoid contamination (e.g., first exposure wins, or hash-based).
  • Pre-registration of analysis plan including edge case handling to avoid p-hacking.
  • Sensitivity analysis to test robustness of results under different edge case handling.
  • Business context: align edge case handling with the experiment's goal (e.g., incremental bookings vs. conversion).
  • Documentation and communication of assumptions and limitations.
  • Use of intent-to-treat (ITT) vs. per-protocol analysis as appropriate.

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