← Airbnb Interview Insights

Airbnb·Data Scientist·Technical Phone Screen·Senior

Senior
Jul 2026

Summary

Airbnb data scientist interview that was basically a full take-home disguised as a technical screen. One massive pandas question covering sessionization, funnel analysis, segment metrics, and statistical lift calculations. A lot to fit into one sitting.

Questions Asked (5)

Q1

Given a raw events table and a guests table, write idiomatic vectorized Pandas to: sessionize events per guest using a 30-minute inactivity timeout, filter bot traffic, then compute segment-level metrics (unique guests, sessions, session-level and guest-level conversion rates, average sessions-to-first-order, and median time from first page_view to first order_completed) broken out by traffic_source and device. Restrict the analysis to a 7-day window ending 2025-09-01.

Product Analytics & MetricsData Modeling
Author's notes

The sessionization part is where I spent most of my mental energy.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by loading and merging the events and guests tables, then filter to the 7-day window and remove bot traffic. Sort events by guest and timestamp, compute inter-event gaps, and flag new sessions when the gap exceeds 30 minutes. Use groupby and transform to assign session IDs, then aggregate to session and guest levels to compute the required metrics, finally grouping by traffic_source and device.

Pro tip: Always validate sessionization logic with a small sample and use vectorized operations like cumsum on boolean flags to avoid slow loops; also, be explicit about how you handle ties or missing timestamps to show rigor.

1. Data loading and filtering

Load the raw events and guests tables, merge them to enrich events with guest attributes, and filter to the 7-day window ending 2025-09-01. Remove bot traffic using a predefined flag or user-agent pattern.

2. Sessionization

Sort events by guest_id and event_timestamp, compute the time difference between consecutive events per guest, and create a new session flag when the gap exceeds 30 minutes. Use cumulative sum of this flag to assign a unique session ID per guest.

3. Session and guest level aggregation

For each session, determine if it contains an order_completed event and compute the time from first page_view to first order_completed. Aggregate to guest level to count sessions and identify converting guests.

4. Segment-level metrics

Group by traffic_source and device to compute unique guests, total sessions, session-level conversion rate (sessions with order / total sessions), guest-level conversion rate (guests with order / total guests), average sessions-to-first-order, and median time from first page_view to first order_completed.

Key Points to Mention

  • Vectorized sessionization using sort, diff, and cumsum to avoid loops
  • Handling bot traffic via a flag or user-agent filtering before analysis
  • Defining session-level and guest-level conversion rates precisely
  • Computing time-to-first-order as the difference between first page_view and first order_completed within the window
  • Using groupby with named aggregations for clarity and efficiency
  • Ensuring the 7-day window is inclusive and correctly applied to event timestamps

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

Q2

Using the same event data, build a de-duplicated guest funnel for page_view, add_to_cart, checkout_start, and order_completed over the 7-day window. Each guest should be counted once at their highest attained step. Report step-through rates and absolute drop-offs.

Product Analytics & MetricsData Modeling
Author's notes

Cleaner than the sessionization piece.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the event data schema and define the 7-day window and guest identifier. Then, for each guest, determine the highest funnel step they reached, ensuring de-duplication by counting each guest once at their furthest step. Finally, compute step-through rates and absolute drop-offs between consecutive steps.

Pro tip: Always confirm whether the funnel should be strictly sequential (e.g., a guest must complete page_view before add_to_cart) or if any occurrence of a later step counts; this affects de-duplication logic and results.

1. Clarify data and definitions

Confirm the event data structure, guest identifier, timestamp, and event types. Define the 7-day window and ensure events are filtered accordingly.

2. Determine highest step per guest

For each guest, find the maximum funnel step reached (e.g., page_view=1, add_to_cart=2, checkout_start=3, order_completed=4) within the window.

3. De-duplicate and count guests per step

Count each guest once at their highest attained step, ensuring no double-counting across steps.

4. Compute step-through rates and drop-offs

Calculate step-through rate as (guests at step N+1 / guests at step N) * 100, and absolute drop-off as guests at step N - guests at step N+1.

5. Validate and present results

Sanity-check numbers (e.g., monotonic decrease), and present the funnel with clear labels and insights.

Key Points to Mention

  • Definition of guest identifier and handling of null or missing IDs
  • Handling of multiple events per guest (e.g., multiple page_views) by taking the highest step
  • Assumption of sequential funnel steps and how to handle non-sequential events
  • Time window filtering: events must occur within the 7-day period
  • Calculation of step-through rates and absolute drop-offs
  • Potential edge cases: guests who skip steps, or events out of order

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

Q3

After filtering segments with fewer than 100 sessions, identify the top 5 segments by lift versus the sitewide guest-level conversion rate. Report both the lift and the 95% Wilson confidence interval for each segment's conversion rate.

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

I blanked for a second on the Wilson CI formula off the top of my head.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, compute the sitewide guest-level conversion rate as the baseline. Then, filter segments with at least 100 sessions, calculate each segment's conversion rate and lift relative to the baseline, and compute the 95% Wilson confidence interval for each segment's conversion rate. Finally, rank segments by lift and report the top 5 with their lift and confidence intervals.

Pro tip: When reporting lift, clarify whether it's absolute or relative, and consider the confidence interval overlap with the baseline to assess significance. Also, be prepared to discuss the trade-off between statistical significance and practical significance, especially with multiple comparisons.

1. Compute baseline conversion rate

Calculate the sitewide guest-level conversion rate by dividing total conversions by total sessions (or guests) across all segments. This serves as the reference for lift.

2. Filter segments

Remove any segment with fewer than 100 sessions to ensure sufficient sample size for reliable estimates.

3. Calculate segment metrics

For each remaining segment, compute the conversion rate, lift (absolute difference or relative percentage) versus the baseline, and the 95% Wilson confidence interval for the segment's conversion rate.

4. Rank and select top 5

Sort segments by lift in descending order and select the top 5. Report their lift and Wilson confidence intervals.

5. Interpret and communicate

Discuss the results, noting any segments where the confidence interval does not include the baseline rate, and consider practical implications and potential multiple comparison issues.

Key Points to Mention

  • Definition of lift: absolute (segment rate - baseline rate) or relative ((segment rate / baseline rate) - 1).
  • Wilson confidence interval is preferred over normal approximation for proportions, especially with small sample sizes or extreme proportions.
  • The 100-session threshold is a minimum sample size filter to reduce noise; consider if it's sufficient for detecting meaningful differences.
  • Multiple comparisons: with many segments, some may appear significant by chance; consider corrections like Bonferroni or false discovery rate.
  • Baseline conversion rate should be computed at the guest level, not session level, to match the segment metric.
  • Practical significance: a high lift may not be actionable if the segment is small or if the confidence interval is wide.

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

Q4

How do you handle guests who complete an order_completed event in the window but have no earlier events in the same window? Implement a specific rule: pull their first event from the prior 24 hours if available, otherwise treat them as a direct single-step conversion.

Data ModelingTechnical Trade-offs
Author's notes

Honestly the most interesting edge case in the whole problem.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the business context and data model, then outline a step-by-step algorithm that handles the edge case. Emphasize the trade-offs between attribution accuracy and data completeness, and propose validation metrics to ensure the rule works as intended.

Pro tip: When implementing the fallback to prior 24 hours, ensure you don't double-count events that might already be attributed to a previous conversion. Consider adding a flag to indicate when the fallback was used for transparency in analysis.

1. Clarify the problem and data model

Confirm the definition of 'window', 'order_completed event', and 'earlier events'. Understand the event schema and how sessions are typically attributed.

2. Design the attribution logic

For each order_completed in the window, check for earlier events in the same window. If none, look back 24 hours from the order_completed timestamp to find the first event. If found, attribute the conversion to that event; otherwise, treat as direct.

3. Handle edge cases and data quality

Address potential issues like multiple order_completed events, events exactly at the 24-hour boundary, and missing or malformed timestamps. Ensure the logic is deterministic and reproducible.

4. Implement and validate

Write efficient SQL or code to apply the rule, then validate with test cases and compare against a baseline. Monitor the impact on conversion metrics and attribution distribution.

5. Communicate trade-offs and recommendations

Discuss the trade-offs: increased attribution accuracy vs. potential complexity and bias. Recommend documenting the rule and considering A/B testing if feasible.

Key Points to Mention

  • Definition of the window and how it interacts with the 24-hour lookback
  • Handling of multiple order_completed events and ensuring no double-counting
  • Performance considerations when querying large event datasets
  • Impact on downstream metrics like conversion rate and channel attribution
  • Data quality checks for timestamps and event ordering
  • Documentation and transparency of the fallback rule for stakeholders

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

Q5

How would you adapt this Pandas pipeline to run at scale in PySpark? What are the key translation points?

System DesignTechnical Trade-offs
Author's notes

Sessionization is the hard part in Spark.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and constraints (data size, latency, cost) and the current Pandas pipeline's logic. Then systematically map each Pandas operation to its PySpark equivalent, highlighting differences in execution model (lazy vs eager), memory usage, and partitioning. Finally, discuss trade-offs and optimizations like broadcast joins, caching, and avoiding UDFs.

Pro tip: Emphasize that the biggest shift is from in-memory, single-node operations to distributed, lazy transformations—so you must think about data partitioning and shuffles upfront. Mention that you'd validate the PySpark pipeline against a Pandas sample to ensure correctness before scaling.

1. Clarify scale and requirements

Ask about data volume, growth rate, latency SLAs, and cost constraints to determine if PySpark is necessary and what optimizations matter.

2. Map Pandas operations to PySpark

Identify each Pandas step (e.g., read_csv, groupby, apply, merge) and translate to Spark equivalents (spark.read, groupBy, transform, join), noting semantic differences.

3. Address execution model differences

Explain how Spark's lazy evaluation, partitioning, and shuffling affect performance, and how to avoid collecting to driver or using Python UDFs unnecessarily.

4. Optimize for scale

Discuss techniques like broadcast joins for small tables, repartitioning, caching intermediate results, and using built-in functions over UDFs.

5. Validate and iterate

Propose testing the Spark pipeline on a sample against the Pandas output, then gradually scaling up while monitoring performance and cost.

Key Points to Mention

  • Lazy evaluation vs eager execution: Spark transformations are lazy, so actions trigger computation.
  • Partitioning and shuffling: groupBy and join cause shuffles; optimize by partitioning on join keys.
  • UDF performance: Python UDFs are slow; prefer Spark SQL functions or Pandas UDFs (vectorized).
  • Memory management: Pandas loads all data into memory; Spark distributes data across cluster.
  • Broadcast joins: use for small dimension tables to avoid shuffles.
  • Caching and persistence: cache intermediate DataFrames if reused multiple times.

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