Meta Data Scientist Interview Preparation Guide - Junior Level (1-2 Years)
Meta's Data Scientist interview process for junior-level candidates consists of a recruiter screening call followed by a technical phone screen, and then a full-day onsite interview with four distinct rounds: Technical Skills Assessment, Analytical Execution, Analytical Reasoning, and Behavioral. The process evaluates your ability to extract insights from data, write efficient SQL queries, perform statistical analysis, design experiments, and collaborate effectively across teams. The total timeline from application to offer typically spans 4-6 weeks.
Interview Rounds
Recruiter Screening
What to Expect
Your first conversation with Meta's recruiting team is a 30-minute phone call designed to verify basic qualifications, assess cultural fit, and understand your motivation for joining Meta. The recruiter will walk through your resume, ask about your background, and explain the interview process. This is also your opportunity to ask questions about the role, team structure, and growth opportunities.
Tips & Advice
Prepare a concise 2-3 minute summary of your background highlighting your most relevant data science projects. Research Meta's mission, products (Facebook, Instagram, WhatsApp, Threads), and recent AI/data initiatives. Practice answering 'Why Meta?' with specific, authentic reasons beyond 'it's a big tech company'—reference Meta's tech stack, specific products you use, or data challenges you find interesting. Be prepared to discuss your experience with data analysis, SQL, Python, and any machine learning projects. Clarify your understanding of the role and ask thoughtful questions. Keep your tone conversational and enthusiastic.
Focus Topics
Understanding of the Role and Team
Ask thoughtful questions about the specific data science team you'll be joining, the types of problems they solve, and the day-to-day responsibilities. This shows genuine interest and helps you understand what to expect.
Practice Interview
Study Questions
Logistics and Process Clarity
Confirm details about the interview timeline, number of rounds, what to prepare for, and what to expect. Ask about the team structure, reporting structure, and the types of projects you'd work on. Take notes.
Practice Interview
Study Questions
Career Goals and Growth Trajectory
Articulate your career aspirations as a data scientist. Where do you see yourself in 2-3 years? What skills do you want to develop? How does a junior role at Meta fit into your trajectory? Show ambition balanced with realistic expectations for a junior-level position.
Practice Interview
Study Questions
Key Technical Skills Overview
Be prepared to briefly discuss your proficiency with SQL, Python, statistics, and machine learning. Have specific examples ready: 'I used SQL to aggregate user engagement data on a project analyzing...' or 'I built a predictive model in Python using scikit-learn for...' At junior level, honesty about what you know well versus what you're learning is valued.
Practice Interview
Study Questions
Why Meta Motivation
Develop a genuine, specific answer to 'Why do you want to join Meta?' Go beyond generic reasons. Reference Meta's specific products, technical challenges, impact on billions of users, or recent initiatives in AI/ML. Connect Meta's mission to your career goals and values.
Practice Interview
Study Questions
Resume and Background Walkthrough
Be ready to discuss your previous roles, projects, and technical skills in a clear, organized manner. For a junior-level candidate, focus on relevant coursework, internships, or early-career projects that demonstrate data analysis, SQL, and basic machine learning skills. Highlight 2-3 projects you're proud of and can explain in 30 seconds each.
Practice Interview
Study Questions
Phone Screen - Technical Skills Assessment
What to Expect
This 60-90 minute technical phone screen is conducted by a senior data scientist or engineer from Meta. You'll typically face 1-2 SQL questions and possibly some basic Python/statistics questions or a coding challenge. The focus is on assessing your ability to write efficient, readable queries and solve analytical problems. You'll likely use a shared coding environment like CoderPad or Leetcode.
Tips & Advice
Before the call, test your internet connection and audio equipment. Verify you can access the coding environment. Request SQL before starting if you have a preference. Read each question carefully and ask clarifying questions—this is expected and shows good engineering practice. Walk through your approach before coding: explain your thought process, discuss the data schema, and outline your solution strategy. Write clean, readable SQL with proper indentation and comments. Optimize for correctness first, then efficiency. For SQL questions, consider edge cases and filtering logic. If you get stuck, communicate your thinking process—partial credit is given for approach. For coding questions, think about time and space complexity.
Focus Topics
Data Structures and Algorithms - Medium Difficulty
Be prepared for straightforward DSA questions at medium difficulty. Examples include: finding the longest increasing subsequence, two-sum problems, palindrome checking, or problems involving hash maps and arrays. These are less common for junior data scientists than for software engineers, but good to practice. Focus on clear logic and handling edge cases rather than optimized algorithms.
Practice Interview
Study Questions
Python/Statistics Fundamentals
You may be asked to write a simple Python function or answer basic statistics questions. Examples: implement a function to compute the mean or median, filter a list of integers for specific conditions, or explain distributions like normal or binomial. These are usually easier than SQL questions and assess baseline coding competency.
Practice Interview
Study Questions
Handling Ambiguity and Edge Cases
When a question is ambiguous, ask clarifying questions: What about NULL values? What's the scale of the data? Are there duplicate entries? For SQL, consider edge cases like empty result sets, ties, or data that doesn't meet criteria. This proactive thinking impresses interviewers.
Practice Interview
Study Questions
Problem-Solving and Communication
Communicate your thought process clearly as you solve problems. Explain what you're trying to do, why you're choosing a particular approach, and ask clarifying questions about edge cases or data assumptions. After solving, walk through your solution with test cases.
Practice Interview
Study Questions
SQL Query Optimization and Readability
Write SQL that is not just correct but efficient and maintainable. Use meaningful column aliases, avoid unnecessary nested queries where possible, and structure your code logically. Understand query complexity and how to write queries that will execute quickly on large datasets. Avoid inefficient patterns like multiple JOINs on non-indexed columns or excessive subqueries.
Practice Interview
Study Questions
SQL Query Writing - Joins and Aggregations
Write SQL queries involving JOINs, GROUP BY, HAVING, and aggregation functions (SUM, COUNT, AVG, MAX, MIN). Practice queries that analyze user engagement, retention, activity patterns, and feature usage. Understand different JOIN types (INNER, LEFT, RIGHT, FULL) and when to use them. Meta frequently asks questions like 'Find the top 100 users with the longest continuous streak of platform visits' or 'Calculate daily active users (DAU) by cohort.'
Practice Interview
Study Questions
Onsite - Technical Skills Deep Dive
What to Expect
This 60-90 minute onsite round is conducted by a data scientist or ML engineer and focuses on deeper technical assessment. You'll solve 1-2 more complex SQL problems, potentially a coding challenge, and may be asked about your approach to data analysis and modeling. The interviewer assesses your technical depth, problem-solving approach under time pressure, and ability to handle larger, more realistic datasets.
Tips & Advice
This round is more challenging than the phone screen. Expect multi-step problems that require joining multiple tables, complex aggregations, and possibly nested logic. Practice problems on platforms like LeetCode, HackerRank, or DataLemur. On the day, manage your time—if a solution isn't clear after 5-10 minutes, ask for hints or pivot your approach. Write your code in a code editor or whiteboard clearly. Explain your reasoning as you code. At the junior level, getting most of the way to a correct solution with good thinking process is often sufficient. Pay attention to the interviewer's feedback and hints—they're guiding you toward the right approach.
Focus Topics
Data Cleaning and Feature Engineering Concepts
Understand how to identify and handle missing data, outliers, and data quality issues in SQL. Be prepared to discuss your approach to feature engineering: selecting relevant columns, transforming variables, handling categorical data, and normalizing numerical data. While the technical round focuses on SQL, interviewers often ask about your process for preparing data for modeling.
Practice Interview
Study Questions
Coding in Python - Algorithms and Logic
If asked to code in Python, write clean, readable functions that solve the given problem. Practice medium-difficulty problems on LeetCode: two-pointer techniques, hash maps, sorting, and basic dynamic programming. For junior level, focus on correctness and clarity over optimal time complexity. Explain your approach before coding and walk through test cases after.
Practice Interview
Study Questions
Handling Feedback and Learning During the Interview
Interviewers often provide hints or feedback. Listen carefully, integrate the feedback, and adjust your approach. If the interviewer says 'Consider a different approach' or points out a flaw, acknowledge it gracefully and pivot. This demonstrates coachability—a key quality at junior level.
Practice Interview
Study Questions
SQL Window Functions and Advanced Techniques
Master window functions like ROW_NUMBER(), RANK(), DENSE_RANK(), LAG(), LEAD(), and aggregate window functions. These are frequently used in Meta interviews for solving problems like finding consecutive streaks, rank-based filtering, or computing period-over-period changes. Practice problems that require ranking, running totals, or comparing each row to previous/next rows.
Practice Interview
Study Questions
Statistical and Analytical Thinking
Be prepared to discuss your approach to analyzing a given dataset or solving a data problem. Questions might include: 'How would you find the most common values in a column?' or 'How would you determine if a feature had a positive impact on user engagement?' Demonstrate structured thinking: define the problem, outline your analytical approach, discuss what metrics matter, and explain how you'd validate your findings.
Practice Interview
Study Questions
Complex SQL - Multi-table Joins and Aggregations
Solve SQL problems involving multiple JOINs, complex WHERE conditions, window functions, and conditional aggregations. Example problems: calculate retention rates by cohort, find users who made purchases before and after a feature launch, identify churn signals, or compute rolling metrics like 7-day moving averages. Understand when to use subqueries, CTEs (Common Table Expressions), or window functions for efficiency.
Practice Interview
Study Questions
Onsite - Analytical Execution
What to Expect
This 60-90 minute round is led by a senior data scientist and focuses on your ability to transform data into insights through structured quantitative analysis. You'll be given product scenarios and asked to analyze data, form hypotheses, select appropriate metrics, perform statistical testing, and quantify trade-offs. The round tests your command of statistics, SQL for analysis, hypothesis testing, and ability to extract actionable conclusions from data.
Tips & Advice
This round is less about coding and more about analytical thinking and statistical reasoning. You'll often be given a scenario like 'How would you analyze the impact of a new feature on user engagement?' or 'Estimate how much fake news is on Facebook.' Start by clarifying the question: What are we trying to measure? What data do we have? Break down the problem into steps. Define relevant metrics (e.g., DAU, engagement rate, retention). Discuss your analytical approach: what SQL queries would you run? What statistical tests would you use? For junior level, demonstrating structured thinking and solid fundamentals is more important than perfect statistical knowledge. Ask clarifying questions about data availability and assumptions. Be prepared to discuss basics like mean, median, mode, percentiles, distributions, and how to identify statistical significance.
Focus Topics
Product Sense and User Understanding
Develop intuition about Meta's products and user behavior. Why do users engage? What drives retention? How do recommendations impact recommendations? Understand concepts like network effects, viral growth, and engagement loops. When discussing a product scenario, show that you think about users, not just numbers.
Practice Interview
Study Questions
Statistical Analysis and Significance Testing
Understand p-values, confidence intervals, and when to use different statistical tests (t-test for comparing means between groups, chi-square for categorical data, etc.). At junior level, you don't need deep statistical expertise, but demonstrate solid fundamentals. Know that you can't just compare two numbers and declare a 'winner'—you need statistical rigor. Practice thinking about sample size, effect size, and statistical power.
Practice Interview
Study Questions
Quantifying Trade-offs and Impact
Given data showing that Feature A increased engagement by 5% but decreased session duration by 3%, how do you evaluate if it's worth launching? Discuss how you'd quantify total impact—perhaps engagement is more important than duration. Practice translating metrics into business value (e.g., how many additional users, revenue impact). This is common in Meta analytical execution questions.
Practice Interview
Study Questions
Data-Driven Storytelling and Insights
Analyze data and extract clear, actionable insights. Don't just report numbers—explain what the data means for the business. Example: 'We found that retention drops significantly after day 3. This suggests users aren't finding sufficient value early. I'd recommend improving onboarding or initial content recommendations.' Combine quantitative analysis with business intuition.
Practice Interview
Study Questions
Hypothesis Formation and Testing
Learn to frame ambiguous business questions as testable hypotheses. Example: A product manager says 'We launched a new notification feature. Did it work?' Break this down: What does 'work' mean? Increase engagement? Increase time in app? Define your null and alternative hypotheses, decide on your statistical test (t-test, chi-square, etc.), and explain how you'd validate your hypothesis given the data.
Practice Interview
Study Questions
Metric Selection and KPI Definition
Understand how to choose appropriate metrics for different business objectives. For a feature launch, which metrics matter most? Daily Active Users (DAU), engagement rate, retention, revenue impact, virality coefficient? Discuss trade-offs: optimizing for DAU might not maximize revenue. For a junior data scientist, demonstrate understanding of common product metrics and why they matter.
Practice Interview
Study Questions
Onsite - Analytical Reasoning
What to Expect
This 60-90 minute round tests your ability to think strategically about research design, experiment methodology, and identifying biases in analysis. You'll be asked to design experiments, discuss how to test hypotheses rigorously, think about confounding variables and biases, and communicate complex findings to non-technical stakeholders. The interviewer assesses your research thinking, experimental design skills, and deeper understanding of causal inference.
Tips & Advice
This is the most challenging analytical round and requires conceptual depth. You'll often be asked open-ended questions like 'How would you design an experiment to test if users prefer Feature A over Feature B?' or 'If we observe a correlation between feature adoption and engagement, how do we know it's causal and not confounding?' Start by clarifying the question and underlying business objective. Then systematically outline your approach: define success metrics, discuss experimental design (A/B test, observational analysis, quasi-experiments), identify potential confounds and biases, discuss sample size, and explain how you'd communicate results. At junior level, you're not expected to be a research design expert, but demonstrate solid understanding of experimentation fundamentals, ability to identify obvious biases, and thoughtful reasoning. Use frameworks when helpful (e.g., the scientific method). Listen to the interviewer's questions carefully—they guide you toward deeper thinking.
Focus Topics
Quasi-Experimental Methods and Observational Analysis
Not every question can be answered with an experiment. Discuss alternatives when experimentation isn't feasible: propensity score matching, difference-in-differences, regression discontinuity, instrumental variables. At junior level, you don't need to implement these, but understand the concepts and when they're useful. Example: 'How would we measure the impact of a country-level launch when we can't randomize users across countries?'
Practice Interview
Study Questions
Statistical Validity and Threats to Validity
Understand threats to validity: internal (confounds, selection bias), external (generalizability), construct (measuring the right thing), and statistical (type I/II errors). Learn about heterogeneous treatment effects—a feature might work for some users but not others. Discuss how sample size affects precision and power.
Practice Interview
Study Questions
Network Effects and Interference in Experimentation
At Meta, users are connected in networks. A feature affecting one user can influence their friends, violating the typical independence assumption in experiments. Discuss how to design experiments when interference is present: randomizing at cluster level (network level) rather than user level, or randomizing geographies instead of individuals. This is a subtle but important concept in Meta's experimentation.
Practice Interview
Study Questions
Data Visualization and Communicating Complex Findings to Non-Technical Stakeholders
You'll likely be asked to explain how you'd present complex findings to a product manager or executive. Choose visualizations that clearly communicate key insights—avoid confusion and misinterpretation. Practice explaining statistical concepts in plain language: 'This result has a 95% confidence interval, meaning if we ran this experiment 100 times, we'd see similar results 95 of those times.' Tailor explanations to your audience's level of statistical literacy.
Practice Interview
Study Questions
Identifying Confounding Variables and Biases
Learn to spot confounds—variables that affect the outcome but aren't your treatment. Example: If you launch a feature on Monday and engagement drops, is it the feature or lower engagement on Mondays? Practice thinking through potential biases: selection bias, measurement bias, temporal biases, network effects. At junior level, demonstrate awareness of common pitfalls and ability to ask the right questions.
Practice Interview
Study Questions
A/B Testing and Experimental Design Fundamentals
Understand how to design an A/B test to evaluate a feature: randomization, treatment and control groups, sample size, duration, and statistical power. Know why randomization is critical (to avoid confounding variables). Discuss concepts like statistical significance, effect size, and multiple comparison correction. Practice designing experiments for realistic Meta scenarios: testing a new algorithm, a UI change, or a feature launch.
Practice Interview
Study Questions
Onsite - Behavioral
What to Expect
This 45-60 minute round is conducted by a senior data scientist or manager and assesses cultural fit, collaboration style, growth mindset, and how you work in teams. You'll be asked behavioral questions about past experiences, how you handle challenges, how you communicate with non-technical peers, and your alignment with Meta's values (often using the STAR method: Situation, Task, Action, Result). The interviewer evaluates your ability to work cross-functionally, learn from feedback, and thrive in Meta's fast-paced environment.
Tips & Advice
Prepare 4-5 concrete stories from your previous projects or experiences that illustrate key qualities: collaboration, handling ambiguity, overcoming challenges, learning from failures, taking initiative, and influencing others. Use the STAR framework: describe the Situation, your Task, the Actions you took, and the Results. For junior-level candidates, stories don't need to show leadership of large initiatives—they should show strong fundamentals: good communication, willingness to learn, ability to work with others, and taking ownership of your work. Research Meta's values and think about how your experiences align. Be authentic—interviewers can tell when you're giving rehearsed answers. Ask thoughtful questions about the team culture, how they support junior-level growth, and what success looks like in the first year.
Focus Topics
Questions for the Interviewer
Prepare thoughtful questions about the team, the role, growth opportunities, and Meta's culture. Examples: 'What does success look like for a junior data scientist in the first 6 months?' 'How does the team balance working on urgent ad-hoc requests versus longer-term strategic projects?' 'What's the mentorship approach for junior hires?' 'How do you approach professional development?' These questions show thoughtfulness and genuine interest.
Practice Interview
Study Questions
Taking Ownership and Initiative
Tell a story where you took ownership of a project or task beyond your initial assignment. What problem did you identify? How did you step up? What was the impact? At junior level, this might be smaller in scale—perhaps you noticed a data quality issue and fixed it, or suggested an analysis that led to insights—but it shows proactive thinking.
Practice Interview
Study Questions
Why Meta and Role Alignment
Be prepared to answer 'Why do you want to work at Meta specifically?' Reference Meta's scale, products, data challenges, or culture. Connect this to your career aspirations. Why is a data scientist role specifically appealing to you? What about the opportunity excites you? For junior level, authenticity is key—avoid generic answers.
Practice Interview
Study Questions
Handling Ambiguity and Complex Problems
Meta moves fast and problems are often ill-defined. Tell a story where you faced ambiguity—unclear requirements, conflicting opinions, incomplete data—and how you handled it. Did you ask clarifying questions? Break the problem into components? Propose multiple solutions? At junior level, demonstrating structured thinking and proactive problem-solving impresses interviewers.
Practice Interview
Study Questions
Learning from Failure and Growth Mindset
Prepare a story where a project didn't go as planned or you made a mistake. What went wrong? How did you respond? What did you learn? At junior level, humility and growth orientation are more important than flawless execution. Example: 'I built a predictive model that initially had poor performance. I initially blamed data quality, but my mentor helped me realize I was overfitting. I learned proper cross-validation and regularization techniques, and my next model performed much better.'
Practice Interview
Study Questions
Cross-Functional Collaboration and Communication
Tell a story where you worked with product managers, engineers, or other teams to solve a problem. How did you communicate findings? How did you handle disagreements about analysis or recommendations? At junior level, demonstrate respect for different perspectives, clarity in explaining data, and willingness to adjust your approach based on feedback. Example: 'I worked with the product team to analyze feature usage. They initially wanted to focus on one metric, but I showed data suggesting a different metric was more predictive of long-term engagement, and we collaborated to develop a new strategy.'
Practice Interview
Study Questions
Frequently Asked Data Scientist Interview Questions
How would you measure whether the insights and recommendations you communicate actually change decisions or behavior, rather than just being read and filed away? Define four to six concrete metrics you would track (for example the share of insights acted on, average time from delivery to a decision, and measured downstream business impact), how you would collect that data, who would own it, and how often you would report it.
Sample Answer
Direct answer
You measure whether your communication actually works the same way you'd measure any other process: define what 'acted on' looks like concretely, instrument it, and track it over time, rather than assuming a well-received presentation equals a changed decision.
Structured elaboration
1. Separate 'insight was delivered' from 'insight was acted on.'
Most teams only track the former (a deck was presented, a dashboard exists) because it's easy to observe. The real signal is whether a decision, a roadmap item, or a resourcing choice actually changed as a result. That requires deliberately logging each insight or recommendation as a discrete, trackable unit (a ticket, a decision-log entry, a recommendation ID) rather than letting it live only inside a slide deck that nobody revisits.
2. Define 4-6 concrete metrics that make actionability observable.
A reasonable, non-exhaustive set: (a) share of recommendations formally accepted, rejected, or deferred within a defined window (e.g. 30 days) - the acceptance rate; (b) average time from delivery to a decision being made on it - time-to-decision; (c) share of accepted recommendations that were actually implemented, not just approved - the follow-through rate, since approval without implementation is a common failure mode; (d) measured downstream business impact where an accepted recommendation included a predicted effect (did the metric move the way the insight predicted, and by how much); (e) a stakeholder-reported usefulness or trust score, gathered periodically, as a leading indicator; and (f) recurrence rate of the same insight being re-delivered because it was previously ignored, which is a strong negative signal.
3. Build the minimal data collection to make this trackable, not a large new system.
In practice this is a lightweight log: each insight gets an ID, a delivery date, an owner, a decision outcome, and (if applicable) a link to the metric it was supposed to move. This can live in an existing ticketing or decision-log tool rather than requiring new infrastructure; the discipline is in the LOGGING HABIT, not the tooling.
4. Assign ownership and a reporting cadence.
The team that produces insights (analytics, data science, BI) should own tracking whether insights were delivered and understood; the business owner who received the recommendation should own logging the decision outcome, since they are the one who knows whether it was actually acted on. Report the rollup on a cadence that matches how often recommendations are made (commonly monthly or quarterly) rather than in real time, since 'time to decision' for a nontrivial recommendation is naturally measured in weeks, not hours.
Worked example
A data science team delivers 40 recommendations over a quarter (for example: adjust a pricing tier, change an onboarding step, retire an underperforming feature). They log each with an ID and owner. At quarter end: 28 of 40 were formally decided within 30 days (70% decision rate), of which 19 were accepted, 6 rejected, and 3 deferred; of the 19 accepted, 14 were actually implemented within the quarter (a 74% follow-through rate on acceptances); and of those 14, 9 had a predicted metric attached, of which 6 moved in the predicted direction by at least half the predicted magnitude. The team also finds that 5 of the 40 recommendations were substantively the same insight delivered a second time because the first delivery was never decided on, a recurrence signal that prompts them to investigate why certain recommendation types stall (in this case, three of the five involved a cross-team dependency with no clear single decision-owner). That specific finding, a missing decision-owner for cross-team recommendations, becomes the actionable process fix, which is itself an example of the framework working as intended.
Trade-offs and pitfalls
- The biggest pitfall is conflating 'stakeholders liked the presentation' with 'a decision changed'; a positive reaction in the room is not evidence of actionability and should not substitute for the follow-through metrics above.
- Attributing a downstream metric move entirely to one recommendation is often overclaiming, since other changes happen concurrently; where possible, treat the predicted-impact check as a directional signal, not a rigorous causal claim, and say so.
- A high recurrence rate is more informative than a low acceptance rate; recommendations legitimately get rejected for good reasons, but a recommendation that keeps resurfacing because no one ever decided on it points to a process gap, not a communication gap.
- Do not build a heavy new tracking system before establishing the logging habit manually; teams that try to automate this before anyone consistently logs decisions end up with clean-looking dashboards over incomplete data.
What is statistical power and what is a Minimum Detectable Effect (MDE)? Explain how you would choose an MDE based on business context, how that choice drives required sample size and experiment duration, and walk through the levers you can pull to increase power without changing the significance level - with the trade-offs of each.
Sample Answer
Direct answer
Statistical power is the probability that an experiment will detect a true effect of a given size, i.e. correctly reject a false null hypothesis; it's commonly targeted at 80-90%. The minimum detectable effect (MDE) is the smallest effect size the experiment is designed to reliably detect at a chosen power and significance level. MDE should be set from the smallest effect that would actually change a business decision, not from what's convenient to detect; that choice then mechanically determines the required sample size, since a smaller MDE needs a disproportionately larger sample. Beyond sample size, the other levers for power are lowering variance, extending duration, and using a more efficient design, each with its own cost.
Structured elaboration
Choosing an MDE from business context
- Minimum actionable lift: pick the smallest effect that would be worth the engineering and rollout cost if it were real. Below that, even a confirmed effect isn't worth acting on.
- Baseline variability: high-variance metrics need a larger MDE to keep the sample size and test duration feasible; this is a real constraint, not just a preference.
- Traffic and time budget: if the team can only run the test for a fixed number of weeks at a fixed traffic volume, that budget effectively sets the smallest MDE the test can resolve. Work backward from the budget if the business's ideal MDE isn't affordable.
- Compounding effects: if small lifts stack across many surfaces or are running continuously, a smaller MDE can be worth the extra cost; a one-off feature test usually isn't.
How MDE drives sample size
For a two-proportion test, required sample size per arm scales as:
n∝(Δ)2p(1−p)where Δ is the MDE (absolute difference) being targeted. Because Δ is squared in the denominator, halving the MDE roughly quadruples the required sample, and therefore roughly quadruples the calendar time needed at fixed daily traffic.
Levers to raise power without changing alpha
| Lever | How it helps | Trade-off |
|---|---|---|
| Increase sample size / duration | Shrinks the standard error directly | Costs calendar time; delays the decision |
| Reduce outcome variance (better metric, trimming, log-transform) | Same effect is easier to detect against a quieter baseline | May change what the metric actually measures; needs care that it doesn't just hide real variance |
| Use covariate adjustment / CUPED-style pre-experiment covariates (CUPED: adjusting the metric using each user's own value of that same metric from before the experiment started, to strip out variance the treatment couldn't have caused) | Removes predictable variance unrelated to treatment, effectively growing the sample for free | Requires a good pre-period covariate; adds analysis complexity |
| Stratify or block the randomization | Balances known high-variance covariates across arms | Needs the covariate to be known before assignment |
| Widen the MDE (accept detecting only larger effects) | Immediately cuts the required sample, since it shrinks the denominator | Risks missing a real but smaller effect entirely |
Worked example
Baseline conversion p0=0.10, α=0.05 two-sided, power =0.80. Required sample size per arm at two different MDEs, using the standard two-proportion formula:
n=(p1−p0)2[z1−α/22pˉ(1−pˉ)+z1−βp0(1−p0)+p1(1−p1)]2| MDE (absolute) | p1 | Required n per arm |
|---|---|---|
| 0.01 (10% relative lift) | 0.110 | 14,751 |
| 0.02 (20% relative lift) | 0.120 | 3,841 |
(computed directly from the formula above with scipy.stats.norm for the critical values)
Halving the MDE from 0.02 to 0.01 multiplies the required sample by about 3.8x, consistent with the inverse-square relationship between Δ and n. If daily eligible traffic is 1,000 users per arm, the 0.01 MDE needs about 15 days; the 0.02 MDE needs about 4.
Trade-offs & pitfalls
- Picking the smallest MDE that "sounds rigorous" without checking the implied sample size and duration is a common planning mistake; always translate the MDE choice into a concrete number of days before committing to it.
- An MDE chosen after looking at early results (rather than fixed up front from the business case) turns the power calculation into after-the-fact justification, not a real design constraint.
- Reducing variance or adding covariates raises power "for free," but only if the adjustment is decided and validated before the experiment starts; adjusting for whatever covariate happens to make the result significant is a form of p-hacking.
- Accepting low power to launch faster is sometimes the right call for cheap, reversible changes, but it should be a stated decision (documented as "we are only powered to detect large effects"), not a silent consequence of an unexamined MDE.
Describe how you would mentor a less experienced engineer through writing and presenting their first postmortem. What specific feedback would you give on structure, tone, and the quality of proposed action items, and how would you make sure the postmortem stays blameless while still being genuinely useful?
Sample Answer
Direct answer
Mentoring someone through their first postmortem means pairing them with a real, ideally low-stakes incident, giving specific feedback on structure and tone rather than just 'good job,' and modeling the blameless framing yourself before expecting them to reproduce it independently.
Structured elaboration
- Pick the right first incident. A moderate-severity, reasonably contained incident is a better first assignment than either a trivial one (nothing to learn from) or a highly political, multi-team, high-visibility one (too much pressure for a first attempt).
- Give feedback on structure. Check whether the timeline is objective and evidence-backed rather than reconstructed from memory, whether root cause is separated from contributing factors, and whether action items are specific and owned rather than vague aspirations.
- Give feedback on tone, with concrete examples. Point out any sentence that names a person rather than a system gap, and show, don't just tell, how to rewrite it: 'the engineer forgot to run the checklist' becomes 'the checklist has no automated enforcement, so a required step could be skipped.' Seeing the before-and-after side by side teaches the skill faster than an abstract rule.
- Have them facilitate a real meeting, with you as backup, not the lead. Reading about facilitation and doing it live under mild pressure are different skills; be present to redirect gently if the discussion drifts toward blame, but let them run it.
- Follow up on whether the action items actually happened. Closing the loop on whether their first postmortem's action items got implemented and verified teaches the full lifecycle, not just the writing exercise.
Worked example
A junior engineer is assigned to lead the postmortem for a minor, contained caching bug that caused stale data for about ten minutes. Before the meeting, the mentor reviews their draft timeline and flags one sentence ('the developer pushed an untested change') to rewrite as a system-focused observation about the deploy process lacking a required test gate for cache-invalidation logic specifically. During the meeting, the junior engineer facilitates; the mentor stays quiet unless the discussion drifts, at one point gently redirecting a comment that started to focus on who wrote the original caching code. Afterward, feedback covers three things: the timeline was strong and evidence-based, the action item ('add a test for cache-invalidation edge cases') was specific and well-owned, but the root cause and contributing factors weren't clearly separated in the writeup, which is worth practicing next time. Three weeks later, the mentor checks whether the test was actually added and merged, closing the loop rather than treating the writing exercise as the end of the mentorship.
Trade-offs and pitfalls
The most common mistake is giving only high-level praise or criticism ('good postmortem' or 'needs work') without specific, actionable examples the person can apply next time. A second is the mentor taking over facilitation when things get slightly awkward instead of letting the mentee work through it with light support, which prevents them from actually building the skill.
A data scientist complains that your nightly transformations add latency that prevents timely model retraining, and reports the computations got slower after a recent refactor. Explain how you would investigate, profile and optimize the pipeline reproducibly, and validate that model accuracy and feature parity are unaffected by any performance-driven changes.
Sample Answer
Direct answer
Since this regression traces to a specific recent change, I'd treat it like any regression report: confirm it's real and locate it with profiling before touching code, fix it in a way I can prove is both faster and produces identical outputs, then explicitly validate that the model's accuracy and the feature values themselves are unaffected before calling it done.
Structured elaboration
Investigating
I'd first confirm the regression is real by comparing runtimes on the same input window before and after the refactor, since "feels slower" and "measurably slower on identical data" are different claims. If the refactor spans several commits, I'd bisect, test roughly half the remaining commits at a time to narrow down which one introduced the regression, rather than assuming it's the most recent or most visible one.
Profiling
Profiling, instrumenting the pipeline to measure where time is actually spent rather than guessing, tells you which stage is the real bottleneck. A common culprit after a refactor is a step that moved from a batched, vectorized operation to something effectively row-by-row, or a join or shuffle (data getting redistributed across workers or partitions for a join or aggregation) that got duplicated across stages that used to share one pass.
Optimizing reproducibly
Once the hot stage is identified, I'd fix it and pin the exact dataset version, configuration, and code revision used for the before and after comparison, so someone else could rerun the same comparison and see the same relative improvement. I'd describe the improvement in relative or algorithmic terms, for example moving an operation from row-wise to vectorized, or removing a redundant pass over the data, rather than a wall-clock number, since wall-clock timing depends on the machine it ran on and isn't something a reader can verify.
Validating accuracy and feature parity
Speed fixes can silently change what's computed, so I wouldn't call this done without a parity check: running the old and new pipeline on the same historical window and diffing the resulting feature values row by row within a defined tolerance. Only after that diff is clean would I re-run the downstream model's evaluation metric on the same holdout set to confirm nothing shifted before declaring the optimization safe.
Worked example
Suppose the refactor replaced a single grouped aggregation with a loop that recomputes the same aggregation per row. Profiling shows almost all the added time sitting inside that loop. The fix is reverting to the grouped, vectorized form. Before shipping it, I'd diff the feature output of the old and new code on last week's data. If a handful of rows disagree, that's a sign the "fix" isn't actually equivalent yet, not something to wave away, since silently changing a feature's value is worse than the pipeline being slow.
Trade-offs and pitfalls
The biggest pitfall is optimizing for speed without a parity check and shipping a pipeline that's fast but subtly wrong, which is far more expensive to catch later than a known latency problem. A second pitfall is reporting the win as a wall-clock claim, "cut runtime from X to Y seconds," that nobody else can verify, instead of describing what changed algorithmically and letting the parity and accuracy checks stand as the real evidence.
Write a query that computes the time between two related events per entity, for example the average time from a user's first visit to their first purchase, or a support ticket's time from creation to first response.
Sample Answer
Find each entity's earliest occurrence of the first event and earliest occurrence of the second event with two separate MIN() aggregations grouped by the entity key, then LEFT JOIN them together and take the date difference. The LEFT JOIN direction matters: entities that never reached the second event (a visitor who never purchased, a ticket that never got a response) must still appear, with a NULL delta, or an average silently reflects only the entities that converted.
Approach
first_visit:MIN(visit_time)per entity (here, per user and channel, since the business question is time-to-purchase by channel).first_purchase:MIN(purchase_time)per user.LEFT JOIN first_purchaseontofirst_visit, never the reverse, so unconverted entities remain in the result.- Take the date difference with the engine's date-diff mechanism. SQLite's
julianday()subtraction gives fractional days directly;AVG()grouped by channel gives the answer per channel. - Report
COUNT(*)(everyone seen) alongsideCOUNT(days_to_purchase)(everyone who actually converted), so the average is never shown without its own denominator.
Worked example
CREATE TABLE visits (
user_id INTEGER,
channel TEXT,
visit_time TEXT
);
CREATE TABLE purchases (
user_id INTEGER,
purchase_time TEXT
);
INSERT INTO visits VALUES
(1, 'organic', '2026-01-01'),
(2, 'paid', '2026-01-02'),
(2, 'paid', '2026-01-03'),
(3, 'organic', '2026-01-05'),
(4, 'paid', '2026-01-01');
INSERT INTO purchases VALUES
(1, '2026-01-04'),
(2, '2026-01-10'),
(4, '2026-01-01');
WITH first_visit AS (
SELECT user_id, channel, MIN(visit_time) AS first_visit_time
FROM visits
GROUP BY user_id, channel
),
first_purchase AS (
SELECT user_id, MIN(purchase_time) AS first_purchase_time
FROM purchases
GROUP BY user_id
),
joined AS (
SELECT
fv.user_id,
fv.channel,
fv.first_visit_time,
fp.first_purchase_time,
julianday(fp.first_purchase_time) - julianday(fv.first_visit_time) AS days_to_purchase
FROM first_visit fv
LEFT JOIN first_purchase fp ON fv.user_id = fp.user_id
)
SELECT
channel,
COUNT(*) AS users,
COUNT(days_to_purchase) AS converters,
ROUND(AVG(days_to_purchase),2) AS avg_days_to_purchase
FROM joined
GROUP BY channel
ORDER BY channel;
Result:
┌─────────┬───────┬────────────┬──────────────────────┐
│ channel │ users │ converters │ avg_days_to_purchase │
├─────────┼───────┼────────────┼──────────────────────┤
│ organic │ 2 │ 1 │ 3.0 │
│ paid │ 2 │ 2 │ 4.0 │
└─────────┴───────┴────────────┴──────────────────────┘
Organic's one converter (user 1) took 3 days (Jan 1 to Jan 4). Paid has two converters: user 2 took 8 days (Jan 2 to Jan 10) and user 4 took 0 days (visited and purchased same day, Jan 1), averaging to (8 + 0) / 2 = 4.0, matching the shown result exactly. User 3 (organic, no purchase) is still counted in users but correctly excluded from converters and from the average.
Trade-offs & pitfalls
- Complexity: two
GROUP BYaggregations (a linear scan each) plus one join; cheap even at scale. Table size, not this technique, is the real cost driver. - Edge case: an entity with the second event but no logged first event (a purchase from a user whose visit was never recorded, a data-quality gap) won't appear at all when the query starts
FROMthe first-event table. Decide upfront whether the base of the query should be the union of both event tables' entity keys, not just one side. - Edge case: a second event that predates the recorded first event (a backfilled or duplicated visit row inserted after the purchase) produces a negative delta. Validate for negative deltas rather than trusting
AVG()to average them away unnoticed. - A mean over a skewed delay distribution (a handful of very slow converters) is easily dominated by outliers; a median or percentile is often the better headline number for a stakeholder, which is a natural extension of this query, not part of the base version.
- Common wrong turn: using
INNER JOINinstead ofLEFT JOIN. That drops every never-converted entity and quietly turns "average time to convert, overall" into "average time to convert, among the subset who already converted," two different numbers wearing the same label.
After a release with repeated friction between design and engineering, how would you run the retrospective, and what would you want to come out of it that actually changes how the two teams work together going forward?
Sample Answer
Direct answer
A retro after a release with repeated design-engineering friction should produce two things: an honest, specific account of where the handoff actually broke down, not a vague 'communication issues,' and a small number of concrete process changes, each with an owner and a way to tell in a quarter whether it worked. Running it well means separating fact-finding from diagnosis, and diagnosis from blame.
Structured elaboration
Design principles for the session
- Facts before diagnosis: start from a timeline of what actually happened (spec dates, handoff dates, bug counts, points where implementation and design diverged), not from opinions about who was at fault.
- Root cause, not the nearest symptom: 'engineering didn't follow the spec' is a symptom; the root cause might be that the spec didn't capture edge-case states, or that both sides were working from different versions of a shared design system mid-migration.
- Few, high-leverage commitments: two or three process changes people will actually do beat ten action items that quietly get dropped.
- Everyone leaves with the same understanding of what changed, not just what went wrong.
A workable structure
One illustrative shape, adaptable to a team's own rhythm:
| Segment | Goal |
|---|---|
| Shared timeline | Ground the room in what happened, not opinions |
| Perspective mapping | Small mixed groups surface where the handoff broke, from each side's view |
| Root-cause discussion | Push past the first symptom to the structural cause |
| Prioritize and commit | Pick a small number of changes, each with an owner and a way to check later whether it worked |
What 'actually changes how the two teams work' looks like
The output isn't a list of intentions, it's a specific artifact or habit that exists after the meeting and didn't before: a shared checklist embedded in the handoff process, an automated check that catches a class of mismatch before it ships, or a standing short sync during implementation windows. Whatever it is, it needs a way to tell if it worked, not just that it happened.
Worked example
One team's root cause turned out to be that design tokens (colors, spacing values) were maintained in the design tool but hand-copied into code, so drift was inevitable and nobody could tell which side was 'correct' when they disagreed. The concrete fix was an automated export from the design tool into the codebase, checked by both a design reviewer and a frontend reviewer before merge, plus a short recurring sync during active implementation. A quarter later, the team had a real signal that it worked: noticeably fewer visual-mismatch comments on pull requests and less late-stage rework than the release that triggered the retro. The same root-cause pattern shows up in other domains as a hand-copied data contract or config value instead of a design token, so the same fix shape (automate the handoff, add a lightweight check, add a short sync during the risky window) generalizes well beyond design and engineering specifically.
Trade-offs and pitfalls
- A retro that produces ten action items usually produces zero completed ones; prioritizing ruthlessly matters more than being thorough.
- If the room jumps straight to solutions or blame instead of facts first, the real root cause, often structural or tooling-related rather than a person's failure, never surfaces.
- A retro that isn't revisited becomes theater. Put the check-in on the calendar before the room disperses, not as a vague intention afterward.
- Watch for a fix that only addresses this specific release's symptom (a one-off manual double-check) rather than the structural cause; it holds for one cycle and then quietly stops happening.
Design a fuzz-testing harness for your inference API that detects crashes, hangs and logical failures when given unexpected inputs (malformed JSON, extra fields, very long strings, extreme numeric values, wrong types). Describe mutation strategies (bit flips, boundary values), generation vs mutation fuzzers, how to measure coverage of code paths, how to reduce flakiness, and how to integrate the harness into CI.
Sample Answer
Direct answer
A fuzz-testing harness for an ML (machine learning) inference API applies the same generic edge-case-discovery technique as parser fuzzing (mutation, coverage feedback, crash triage) to the API's REQUEST SURFACE rather than its model weights, targeting three failure classes the question names explicitly: hard crashes (the process dies), hangs (a request that never returns, e.g. a pathological input driving an unbounded loop in preprocessing), and logical failures (the request completes and returns 200, but produces a nonsensical or unsafely-formed response), using malformed JSON, extra fields, very long strings, extreme numeric values, and wrong types as the mutation dimensions.
Structured elaboration
- Generation vs mutation fuzzers: a mutation-based fuzzer starts from real, valid request payloads (captured from production logs or hand-written examples) and perturbs them; a generation-based fuzzer builds requests from a schema (e.g. the API's OpenAPI/JSON-schema definition) without needing real seed examples, which is the more practical starting point for an inference API, because the request schema is usually well-defined even before real traffic exists, and generation naturally produces the "extra fields" and "wrong types" cases the question names by construction (generate a request, then add an undeclared field, or substitute a field's declared type for an incompatible one).
- Mutation strategies (bit flips, boundary values) mapped onto the five named request-shape categories: malformed JSON is produced by bit-flipping a byte inside an otherwise valid payload, or by truncating it at a random offset, or by corrupting a structural character (a brace, a comma); extra fields are produced by injecting undeclared keys into an otherwise valid payload, testing whether the API's deserializer strictly rejects unknown fields or silently (and possibly dangerously) passes them through to downstream logic; very long strings and extreme numeric values are boundary-value mutations applied specifically to fields the model consumes (e.g. a text field mutated to megabytes of repeated tokens, or a numeric feature field mutated to
1e308,-1,0, orNaN-equivalent JSON representations); wrong types substitutes a string where a number is expected and vice versa, which is the case most likely to reveal whether the API validates against its schema BEFORE invoking the model or lets a type-confused value flow into featurization code that assumes a specific type. - Measuring coverage of code paths: instrument the request-handling and preprocessing/featurization code (not the model's internal weights, which are not meaningfully "covered" by input fuzzing in the traditional sense) with the same line/branch coverage tooling used for any Python service (e.g.
coverage.py), and track which validation and preprocessing branches a growing corpus of mutated requests has exercised; a mutation corpus that only ever reaches the "happy path" featurization code and never the type-mismatch or out-of-range handling branches indicates the fuzzer's mutation strategy needs to be more aggressive on those specific fields, not that the API is well-tested. - Reducing flakiness in the harness itself (a harness-design concern here, not diagnosing an already-flaky test suite): pin the inference call's non-determinism sources before fuzzing (fix random seeds in any stochastic decoding path, disable GPU-nondeterministic kernels or pin to CPU execution for the harness run, and add an explicit request timeout so a hang is detected deterministically rather than the harness itself hanging indefinitely), so that a crash or hang found by the fuzzer reproduces reliably when replayed, which is a prerequisite for the crash to be triage-able at all.
- CI (continuous integration) integration: run a short, time-boxed fuzzing pass (a fixed number of mutated requests, not a fixed wall-clock duration, so the check is reproducible across CI runners of different speeds) against every change to the request-handling or featurization code, and separately run the full campaign continuously as a longer-lived background job rather than gating every commit, mirroring how coverage-guided fuzzing is normally integrated for any parser or request-handling surface.
Worked example: malformed JSON feature payload
For a concrete inference endpoint accepting {"features": {"age": 34, "income": 52000.0, "region": "west"}}, the mutation corpus would include: {"features": {"age": "34"}} (wrong type: string where a number is expected, testing whether the schema validator rejects it before it reaches feature encoding); {"features": {"age": 34, "income": 52000.0, "region": "west", "__proto__": "x"}} (an extra, potentially dangerous field name, testing that unknown keys are rejected or ignored rather than passed to an unsafe deserializer); {"features": {"age": 999999999999, "income": -1e308}} (extreme numeric values, testing whether featurization clamps, rejects, or silently produces a garbage prediction on out-of-distribution numeric input); and a truncated payload {"features": {"age": 34, "inc (malformed JSON, testing that the API returns a clean 400-class error rather than a 500 or a hang). Each of these targets a different point in the request pipeline: schema validation, key allow-listing, feature-range validation, and JSON parsing itself, so a single fuzzing pass that only exercises one of these four is not exercising the full pipeline the question asks about.
Trade-offs and pitfalls
The most common wrong turn is fuzzing only the JSON structure (malformed JSON, extra fields) and never the semantic content of well-formed-but-extreme values, which misses the logical-failure class the question explicitly names: a request that is syntactically perfect JSON with a region value the model was never trained on, or an income value far outside the training distribution, will not crash or hang, but can produce a confidently wrong prediction, which is arguably the most dangerous of the three failure classes because nothing in the API's error handling signals it. The other pitfall is fuzzing the LIVE model in a way that is not reproducible (letting decoding randomness vary run to run), which makes every "logical failure" finding impossible to confirm was actually caused by the mutated input rather than ordinary model stochasticity; pinning determinism in the harness, as described above, is a prerequisite for the whole exercise to produce trustworthy findings.
Define Lifetime Value (LTV), Average Revenue Per User (ARPU), and Customer Acquisition Cost (CAC). For each, give the typical formula, a recommended evaluation window for a subscription product, and one common pitfall when using it for prioritization. Then work a quick example: CAC = $100, monthly ARPU = $15, gross margin = 70%, monthly churn = 5%; compute payback period and a simple LTV.
Sample Answer
Direct answer
Lifetime Value (LTV) is the forecasted net revenue a customer generates over their relationship with the business; Average Revenue Per User (ARPU) is monetization efficiency per active user in a period; Customer Acquisition Cost (CAC) is what it costs to acquire one paying customer. All three only mean something together: LTV compared against CAC tells you whether acquisition spend pays back, and ARPU is the input that makes that comparison possible.
Structured elaboration
| Metric | Typical formula | Recommended window (subscription) | Common pitfall |
|---|---|---|---|
| Lifetime Value (LTV) | Monthly gross margin per user divided by monthly churn rate (a steady-state approximation) | 12 to 36 months, or matched to the CAC payback horizon | Using a single blended, undiscounted average that hides fast-improving or worsening cohorts |
| Average Revenue Per User (ARPU) | Total revenue in a period divided by average active users in that period | Monthly, aligned to the billing cycle | Ignoring cost-to-serve; a high-ARPU segment can still be unprofitable |
| Customer Acquisition Cost (CAC) | Total sales and marketing spend in a period divided by new customers acquired in that period | Monthly or quarterly, matched to the campaign cycle | Blending all channels together hides that some channels cost far more per acquired customer than others |
Related metric comparators
ARPU is a per-user rate. Monthly Recurring Revenue (MRR) is the aggregate monthly total across every active subscriber, and Annual Recurring Revenue (ARR) is simply MRR multiplied by 12 for annualized reporting, not a separately measured figure. Dividing MRR by ARPU recovers the active-subscriber count, so conflating the three usually means mixing a per-user efficiency metric with two aggregate scale metrics that move for different reasons (ARPU changes with pricing or mix, MRR and ARR change with both pricing and subscriber count).
LTV itself comes in three common variants: gross LTV (ARPU times expected lifetime, ignoring cost-to-serve entirely), margin-adjusted LTV (the version computed below, which multiplies by gross margin to reflect actual profit rather than raw revenue), and discounted LTV (which additionally applies a discount rate to future months to reflect the time value of money, more relevant for multi-year enterprise contracts than for a monthly self-serve subscription). The worked example below uses margin-adjusted LTV without discounting, appropriate for a short, monthly-churn-driven horizon.
Worked example
Given CAC = $100, monthly ARPU = $15, gross margin = 70%, monthly churn = 5%.
Monthly gross margin per user=$15×0.70=$10.50 Payback period=Monthly gross margin per userCAC=$10.50$100≈9.5 months Expected customer lifetime=monthly churn rate1=0.051=20 months (under a constant-churn assumption) LTV=Monthly gross margin per user×Expected lifetime=$10.50×20=$210 LTV:CAC ratio=$100$210=2.1Both routes to LTV agree: dividing monthly gross margin by the churn rate directly ($10.50 / 0.05 = $210) gives the same answer as multiplying by the reciprocal-of-churn expected lifetime (20 months), because they are algebraically the same formula.
Trade-offs & pitfalls
- The 1/churn expected-lifetime formula assumes constant, cohort-independent monthly churn (a geometric, constant-hazard model); real cohorts often show churn that declines with tenure, so this LTV is a steady-state approximation, not a cohort-specific forecast. Use a cohort survival-curve model when that assumption clearly doesn't hold.
- A 2.1 LTV:CAC ratio with a 9.5-month payback is workable but tight; a commonly cited heuristic target in subscription businesses is an LTV:CAC ratio of 3 or higher with payback under 12 months. Treat that as a rule of thumb to discuss, not a universal pass/fail threshold.
- Blended CAC across channels hides that some channels have far worse unit economics than others; always segment CAC by channel and cohort before using it for a budget-allocation decision.
- ARPU on its own ignores cost-to-serve (support, infrastructure, payment processing); the gross-margin adjustment above exists specifically to correct for that.
Users increasingly interact with a product across multiple devices and login states, which creates duplicate identities: for example, web experiment assignment is cookie-based while the mobile app uses a device id, and after backend identity merging many users turn out to have been placed into both variants. Explain how cross-device identity resolution and deduplication affect experiment assignment and analysis, and propose practical strategies to minimize the bias from duplicate counting and cross-variant contamination.
Sample Answer
Direct answer
When assignment happens per-device (a cookie on web, a device id on the app) but the real unit of interest is the person, users who touch the product on multiple devices get assigned independently on each device, so some of them land in both control and treatment at once. That breaks the assumption that each experimental unit receives exactly one arm: it dilutes the measured treatment effect, since a "contaminated" user's behavior is influenced by both arms, and it can double count outcomes if the same person's actions are logged and analyzed once per device-identity rather than once per person. The fix is to randomize and log at the most persistent identity you actually have, then dedupe and correct for the identities you had to resolve after the fact rather than at assignment time.
Structured elaboration
Where the bias enters
- Assignment stage: a user with a web cookie and a mobile device id gets two independent coin flips. If both land the same way, no harm; if they split, that person is exposed to treatment and control simultaneously, a violation of SUTVA (the assumption that one unit's outcome does not depend on another instance of its own assignment).
- Analysis stage: if the analysis unit is "device" rather than "resolved person," a contaminated person's activity appears once in each arm's numerator, and the two rows are not independent observations even though the analysis code treats them as such, which understates the true variance.
- Coverage bias: identity resolution itself makes mistakes (false merges linking two different people, false splits treating one person as two); if those errors are not random with respect to treatment, they introduce their own bias on top of the contamination.
Practical strategies
- Randomize at the most stable identity you have. Prefer a logged-in account id over a device id or cookie whenever the user is authenticated; fall back to a deterministic device hash only for logged-out traffic, and treat that population as a separate, lower-confidence stratum in reporting.
- Log everything needed to resolve identity after the fact. Persist device id, cookie id, and account id (hashed, respecting privacy) on every assignment and every outcome event, even when the assignment itself was made at device level, so contamination can be measured and corrected during analysis rather than discovered too late.
- Define the primary analysis on the resolved (canonical) identity, not the raw assignment record: after backend identity merge, collapse a contaminated user into a single row and apply an explicit, pre-registered rule for what arm they count as, for example "any-device-treatment counts as treated," reported alongside a stricter "single-device-only" rule as a sensitivity check.
- Quantify and bound the bias rather than ignore it. Report the primary result plus at least two sensitivity analyses: one restricted to users seen on exactly one device (removes contamination but shrinks the sample), and one using the any-device-treatment rule (keeps the full sample but is a diluted estimate of the true per-exposure effect).
- Use cluster-robust standard errors at the resolved-identity level so that outcomes from the same person are not treated as independent observations even after collapsing to one row per person, since a person can still contribute multiple sessions or events.
Worked example
Assume 20% of users are active on exactly two devices (web and app) and 80% are single-device (an illustrative, stated split). Assignment happens independently per device with probability 0.5 to treatment. For a two-device user, the four equally likely device-pair outcomes are (control, control), (control, treatment), (treatment, control), (treatment, treatment), each with probability 0.25:
P(both control)=P(both treatment)=0.25,P(split, i.e. contaminated)=0.5
So among the 20% of users who are two-device, half get split across arms, which is 10% of the total user base. If a contaminated user's outcome is counted in both the treatment and control totals rather than resolved to one arm, then 10% of the treatment-arm numerator and 10% of the control-arm numerator are contributed by the exact same set of people, which both understates the between-arm difference and violates the independence assumption behind the standard error calculation. Restricting the primary analysis to the 90% of users who are single-device or resolve cleanly to one arm removes the contamination at the cost of 10% of the sample, which should be reflected directly in the power calculation for the corrected analysis.
Trade-offs and pitfalls
- The "any-device-treatment" rule is conservative and interpretable but structurally dilutes the estimated effect toward zero for contaminated users, since they experienced a mix of both arms; don't present it as an unbiased estimate of the pure per-exposure effect.
- Restricting to single-device users is cleaner statistically but changes who the estimate applies to: if multi-device users differ systematically (often more engaged, higher-value), the single-device estimate may not generalize to the full user base.
- Identity resolution is itself a model with false-merge and false-split error rates; a resolution pipeline retrained or changed mid-experiment can shift the contamination rate over time and should be monitored, not assumed constant.
- Logging every identifier needed for later resolution has real privacy and storage cost; agree on hashing and retention policy with the privacy function before instrumenting, not after a contamination investigation is already underway.
Given a list of intervals, merge every pair that overlaps and return the resulting set of non-overlapping intervals. What is the key step that makes an O(n log n) solution possible, and what would you need to change if intervals could arrive one at a time instead of all at once?
Sample Answer
Direct answer
Sort the intervals by start time, then make a single linear pass, extending a running merged interval whenever the next interval's start is at or before its current end, and starting a new merged interval otherwise. The sort is what makes O(nlogn) possible: once intervals are ordered by start, every pair that can possibly overlap is adjacent in that order, so a single linear scan is enough to find every merge. If intervals arrive one at a time instead of all at once, you need a data structure that supports ordered insertion and neighbor lookup, such as a balanced binary search tree (BST, a tree that keeps keys ordered so lookup, insertion, and neighbor queries are all logarithmic) keyed by start time, rather than a one-shot sort.
Structured elaboration
Why sorting is the key step
Without an order, deciding whether interval A overlaps interval B requires comparing it against every other interval, an O(n2) scan overall. Sorting by start time establishes an invariant: once you have processed intervals in start order, the only interval that can still extend or overlap the one you are currently building is the very next one in the sorted order. That invariant is what collapses the overlap check from "compare against everything" to "compare against one neighbor," turning the merge itself into an O(n) linear pass after the O(nlogn) sort.
Batch algorithm (steps)
- Handle the empty-input case.
- Sort intervals by start time.
- Walk the sorted list, keeping a current interval: if the next interval's start is ≤ the current interval's end, extend the current end to the max of the two ends; otherwise, close out the current interval and start a new one from the next interval.
- Return the closed-out intervals.
Streaming variant
If intervals arrive one at a time and you must always be able to answer "what are the merged intervals so far," a one-shot sort no longer applies, since new intervals keep appearing. Two practical designs:
- Keep the current merged intervals in a balanced BST (or an ordered structure with the same guarantees) keyed by start time. On each new arrival, locate its insertion point in O(logn), check the neighbor(s) on both sides for overlap, and merge in place, splicing at most a bounded number of neighboring intervals per insertion.
- If you only need periodic snapshots rather than an always-current answer, buffer arrivals and re-run the batch algorithm on a schedule, trading immediacy for simplicity.
Worked example
def merge_intervals(intervals: list[list[int]]) -> list[list[int]]:
"""
Merge overlapping intervals. O(n log n) time (sort), O(n) space.
Assumes each interval is [start, end] with start <= end.
"""
if not intervals:
return []
ordered = sorted(intervals, key=lambda pair: pair[0])
merged = [ordered[0][:]]
for start, end in ordered[1:]:
last = merged[-1]
if start <= last[1]:
last[1] = max(last[1], end)
else:
merged.append([start, end])
return merged
if __name__ == "__main__":
sample = [[1, 3], [2, 6], [8, 10], [15, 18]]
print(merge_intervals(sample))
touching = [[1, 2], [2, 3]]
print(merge_intervals(touching))
Running this prints:
[[1, 6], [8, 10], [15, 18]]
[[1, 3]]
For [[1,3],[2,6],[8,10],[15,18]]: after sorting (already sorted here), [1,3] and [2,6] overlap since 2 <= 3, merging to [1,6]; [8,10] does not overlap [1,6] since 8 > 6, so it starts a new group; likewise [15,18]. For the touching pair [[1,2],[2,3]], 2 <= 2 counts as an overlap (touching intervals are treated as mergeable here), giving the single interval [1,3].
Complexity
Time: O(nlogn), dominated by the sort; the scan itself is O(n). Space: O(n) for the sorted copy and the output list (or O(1) extra if sorting and merging in place and the output does not count as extra space).
Edge cases
- Empty input returns an empty list.
- A single interval returns that interval unchanged.
- Touching intervals (end of one equals start of the next) are merged here; whether touching counts as overlapping is a modeling choice to state explicitly, since flipping the comparison from
<=to<changes the answer. - Intervals given with start greater than end (an inverted pair) should be rejected or normalized before sorting, since the algorithm assumes start <= end.
Trade-offs & pitfalls
The most common mistake is forgetting to sort at all, or sorting by end time instead of start time; the linear-scan step only works because sorting by start establishes the adjacency invariant above. A second common gap is not deciding, and stating, whether touching intervals count as overlapping: interviewers frequently probe exactly this boundary condition. For the streaming follow-up, the wrong turn is proposing to re-sort and re-scan the entire collection on every new arrival: that is correct but throws away the point of the question, which is to avoid O(n) work per insertion by using an ordered structure that supports local overlap checks near the insertion point.
Recommended Additional Resources
- DataLemur (datalemur.com) - SQL and data science interview questions with company-specific problems
- LeetCode (leetcode.com) - Algorithm and SQL problems, Meta-specific tagged problems
- InterviewQuery (interviewquery.com) - Data science interview guides with company breakdowns
- Mode Analytics SQL Tutorial - Free SQL education to strengthen query writing skills
- Coursera - Statistics for Data Analysis courses for hypothesis testing and experimental design
- Book: 'Lean Analytics' by Alistair Croll and Benjamin Yoskovitz - Understanding metrics and KPIs
- Book: 'Experimentation in Product Development' - Deep dive into A/B testing and experimental design
- Causal Inference Reading List - Resources on causal inference and quasi-experimental methods
- Meta Engineering Blog (engineering.fb.com) - Insights into Meta's technical challenges and solutions
- Blind (teamblind.com) - Crowdsourced Meta interview experiences and company culture insights
- Levels.fyi - Salary, interview process, and detailed interview question summaries from Meta
- Harvard's CS50 for Data Science - Fundamentals course covering Python, SQL, and statistics
Search Results
Essential Meta Data Scientist interview guide in 2025
Relevant Interview Questions · What techniques would you use to mitigate the effects of an imbalanced dataset? ML Knowledge · Can you talk about probability ...
Meta Data Scientist Interview (questions, process, prep)
You should expect typical behavioral and resume questions like, "Tell me about yourself," "Why do you want to work at Meta?", or "Tell me about your current day ...
Meta Data Scientist Interview Guide: Process, Questions & ...
Prepare for your Meta data scientist interview with this 2025 guide—featuring real interview questions, process breakdowns, salary ranges, ...
Meta Data Science Interview Guide [31 LEAKED Questions ...
Meta Data Science Interview Guide [31 LEAKED Questions from 2025] · Stages of the Interview Process · 6 Analytical Execution Questions · Preparing ...
Meta Data Scientist Interview in 2025 (Leaked Questions)
3.4 Data Analysis · What are the hypotheses that would lead to a decision? How would you prove a hypothesis is true? · Can you translate ...
Meta (Facebook) Data Scientist Interview Guide
Sample Questions · Tell me about a time you influenced a stakeholder who disagreed with you. · Describe a project that didn't go as planned. What did you learn?
Top 35 Questions to Expect in a Meta Data Science ...
Top 35 Questions to Expect in a Meta Data Science Interview in 2025. This guide covers Meta's data science interview process, key topics, and tips for success.
This interview preparation guide was generated using AI-powered research from the sources listed above. While we strive for accuracy, we recommend verifying critical information from official company sources.
Want to create your own tailored preparation guide using our deep research?
Get Started for FreeInterview-Ready Courses
Visual-first, interactive, structured learning paths