<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Feng Zhang</title>
    <description>The latest articles on DEV Community by Feng Zhang (@feng_zhang_cedb4581bee881).</description>
    <link>https://dev.to/feng_zhang_cedb4581bee881</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3875738%2Fd8a58adf-1466-4b32-9d75-041250f25bda.png</url>
      <title>DEV Community: Feng Zhang</title>
      <link>https://dev.to/feng_zhang_cedb4581bee881</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/feng_zhang_cedb4581bee881"/>
    <language>en</language>
    <item>
      <title>Product Diagnostics And Root Cause Analysis Explained — Tech Interview Concept (2026)</title>
      <dc:creator>Feng Zhang</dc:creator>
      <pubDate>Wed, 12 Aug 2026 14:28:02 +0000</pubDate>
      <link>https://dev.to/feng_zhang_cedb4581bee881/product-diagnostics-and-root-cause-analysis-explained-tech-interview-concept-2026-11n3</link>
      <guid>https://dev.to/feng_zhang_cedb4581bee881/product-diagnostics-and-root-cause-analysis-explained-tech-interview-concept-2026-11n3</guid>
      <description>&lt;p&gt;Product diagnostics interview questions often sound simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Ads revenue dropped 5%. How would you investigate?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A weak answer turns into a checklist: check seasonality, segment by country, look at app version, maybe inspect experiments. A strong answer has an order. Clarify the metric, rule out measurement failure, break down the movement, find the biggest contributors, then decide what evidence would prove or disprove each cause.&lt;/p&gt;

&lt;p&gt;This is a common Meta-style data science and product analytics interview pattern. PracHub covers this in more detail in its &lt;a href="https://prachub.com/concepts/product-diagnostics-and-root-cause-analysis?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;Product Diagnostics and Root Cause Analysis concept guide&lt;/a&gt;, but this post focuses on the interview version of the mental model.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the interviewer is really testing
&lt;/h2&gt;

&lt;p&gt;The interviewer wants to know if you can debug a product metric when the prompt is vague.&lt;/p&gt;

&lt;p&gt;You need to separate a few possibilities:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A broken metric or logging pipeline&lt;/li&gt;
&lt;li&gt;A real user behavior change&lt;/li&gt;
&lt;li&gt;A business or marketplace change outside the product itself&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;They are not looking for a memorized list of slices. They want to see if you understand metric definitions, logging systems, experiments, user identity, funnels, and business mechanics like ads auctions or retention cohorts.&lt;/p&gt;

&lt;p&gt;A good answer also separates speed from certainty. Some checks belong in the first hour. Some need a day of analysis. Some need a rollback, holdout, or quasi-experiment before you can call them causal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the metric definition
&lt;/h2&gt;

&lt;p&gt;Before diagnosing anything, pin down what moved.&lt;/p&gt;

&lt;p&gt;"Actives dropped 5%" is incomplete. You need to ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is this DAU, WAU, sessions, logged-in users, device-level users, or a rolling 7-day active metric?&lt;/li&gt;
&lt;li&gt;Is the 5% drop absolute or relative?&lt;/li&gt;
&lt;li&gt;What is the comparison baseline?&lt;/li&gt;
&lt;li&gt;Is it statistically meaningful compared with historical variance?&lt;/li&gt;
&lt;li&gt;What is the grain: user, account, device, session, event, or cohort?&lt;/li&gt;
&lt;li&gt;Is the metric computed from raw logs, curated tables, billing systems, or experiment dashboards?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Small definition changes can completely alter the diagnosis. A user-level active metric can fall while device-level activity stays flat if identity resolution changes. A rate can move because the denominator changed, even if the numerator is stable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule out instrumentation before product theories
&lt;/h2&gt;

&lt;p&gt;Do not start with "users dislike the new feature." First, check whether the data is trustworthy.&lt;/p&gt;

&lt;p&gt;Look at:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Raw event volume&lt;/li&gt;
&lt;li&gt;Null rates&lt;/li&gt;
&lt;li&gt;Schema changes&lt;/li&gt;
&lt;li&gt;Client-side versus server-side logging&lt;/li&gt;
&lt;li&gt;ETL delays&lt;/li&gt;
&lt;li&gt;Backfills&lt;/li&gt;
&lt;li&gt;Bot filtering&lt;/li&gt;
&lt;li&gt;Deduplication logic&lt;/li&gt;
&lt;li&gt;Timezone boundaries&lt;/li&gt;
&lt;li&gt;Event time versus ingestion time&lt;/li&gt;
&lt;li&gt;App version or SDK logging changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A useful pattern is to compare raw facts with derived aggregates. If raw logs look stable but a dashboard metric moved, the issue may be pipeline logic. If both raw events and aggregates moved together, a real product or user behavior change is more likely.&lt;/p&gt;

&lt;p&gt;For SQL validation, start close to the source:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;
  &lt;span class="n"&gt;DATE_TRUNC&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'hour'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event_time&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;hour&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;event_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;platform&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;app_version&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;country&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;raw_events&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;event_time&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="k"&gt;CURRENT_DATE&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;INTERVAL&lt;/span&gt; &lt;span class="s1"&gt;'3 days'&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At very large scale, exact &lt;code&gt;COUNT(DISTINCT)&lt;/code&gt; may be too expensive. Approximate sketches such as HyperLogLog can be acceptable when you need a directional answer quickly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decompose the metric
&lt;/h2&gt;

&lt;p&gt;After basic data checks, break the metric into mechanical drivers.&lt;/p&gt;

&lt;p&gt;For ads revenue, a simple decomposition is:&lt;/p&gt;

&lt;p&gt;$$&lt;br&gt;
\text{Revenue} =&lt;br&gt;
\text{Users}&lt;br&gt;
\times&lt;br&gt;
\text{Sessions/User}&lt;br&gt;
\times&lt;br&gt;
\text{Ad Impressions/Session}&lt;br&gt;
\times&lt;br&gt;
\text{Fill Rate}&lt;br&gt;
\times&lt;br&gt;
\text{CPM}/1000&lt;br&gt;
$$&lt;/p&gt;

&lt;p&gt;Revenue can fall because fewer users visited, users had fewer sessions, ad opportunities dropped, fill rate fell, CPM dropped, advertiser budgets changed, or auction quality shifted.&lt;/p&gt;

&lt;p&gt;For retention, the definition may be:&lt;/p&gt;

&lt;p&gt;$$&lt;br&gt;
D7 = P(\text{return on day 7} \mid \text{new user on day 0})&lt;br&gt;
$$&lt;/p&gt;

&lt;p&gt;That points you toward cohort entry, return event definition, delayed logging, acquisition mix, app quality, onboarding, and engagement.&lt;/p&gt;

&lt;p&gt;This decomposition prevents random guessing. First identify which component drove the movement. Then investigate that component.&lt;/p&gt;
&lt;h2&gt;
  
  
  Segment by contribution, not just percent change
&lt;/h2&gt;

&lt;p&gt;Segmentation matters, but many candidates do it poorly.&lt;/p&gt;

&lt;p&gt;A tiny segment can drop 80% and explain almost none of the total decline. A huge segment can drop 2% and explain most of it.&lt;/p&gt;

&lt;p&gt;For each segment, compute contribution:&lt;/p&gt;

&lt;p&gt;$$&lt;br&gt;
\frac{\Delta_i}{\Delta_{\text{total}}}&lt;br&gt;
$$&lt;/p&gt;

&lt;p&gt;or:&lt;/p&gt;

&lt;p&gt;$$&lt;br&gt;
\frac{\Delta_i}{\sum_i \Delta_i}&lt;br&gt;
$$&lt;/p&gt;

&lt;p&gt;Useful slices often include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Country&lt;/li&gt;
&lt;li&gt;Platform&lt;/li&gt;
&lt;li&gt;App version&lt;/li&gt;
&lt;li&gt;Product surface&lt;/li&gt;
&lt;li&gt;Acquisition source&lt;/li&gt;
&lt;li&gt;New versus returning users&lt;/li&gt;
&lt;li&gt;Experiment group&lt;/li&gt;
&lt;li&gt;Device class&lt;/li&gt;
&lt;li&gt;Advertiser vertical or campaign objective, for ads&lt;/li&gt;
&lt;li&gt;Cohort date, for retention&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Watch for Simpson's paradox. Aggregate trends can reverse when mix shifts across countries, platforms, or user types.&lt;/p&gt;
&lt;h2&gt;
  
  
  Use the right time-series baseline
&lt;/h2&gt;

&lt;p&gt;A metric drop only matters relative to a baseline.&lt;/p&gt;

&lt;p&gt;Compare against:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Same day of week&lt;/li&gt;
&lt;li&gt;Recent historical variance&lt;/li&gt;
&lt;li&gt;Holidays&lt;/li&gt;
&lt;li&gt;Product launch calendars&lt;/li&gt;
&lt;li&gt;Market events&lt;/li&gt;
&lt;li&gt;Country-specific events&lt;/li&gt;
&lt;li&gt;Prior seasonal patterns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For anomaly detection, avoid treating every dashboard wiggle like an incident. Depending on the metric, you can use confidence intervals, binomial approximations for rates, bootstrap intervals for non-normal metrics, or control limits such as:&lt;/p&gt;

&lt;p&gt;$$&lt;br&gt;
\mu \pm 3\sigma&lt;br&gt;
$$&lt;/p&gt;

&lt;p&gt;At Meta-scale volume, tiny differences can be statistically significant while still being practically small. Interviewers like candidates who say this out loud.&lt;/p&gt;
&lt;h2&gt;
  
  
  Localize through the funnel
&lt;/h2&gt;

&lt;p&gt;A product metric is often the output of a user journey. Break the journey into steps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;exposure -&amp;gt; click/open -&amp;gt; load -&amp;gt; action -&amp;gt; success
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For actives or account switching, inspect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Login success&lt;/li&gt;
&lt;li&gt;Session creation&lt;/li&gt;
&lt;li&gt;Identity resolution&lt;/li&gt;
&lt;li&gt;Account merge or split behavior&lt;/li&gt;
&lt;li&gt;Logout rates&lt;/li&gt;
&lt;li&gt;Cross-device activity&lt;/li&gt;
&lt;li&gt;Shared-device patterns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A rise in account switching could mean product friction, fraud, shared device usage, or a measurement reclassification. Localization tells you where to look next. It does not prove the root cause by itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check launches, experiments, and external factors
&lt;/h2&gt;

&lt;p&gt;Once you know what moved and where, compare the break point against known changes.&lt;/p&gt;

&lt;p&gt;Internal causes may include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Experiment ramps&lt;/li&gt;
&lt;li&gt;Feature flags&lt;/li&gt;
&lt;li&gt;App releases&lt;/li&gt;
&lt;li&gt;Ranking model pushes&lt;/li&gt;
&lt;li&gt;Ads auction changes&lt;/li&gt;
&lt;li&gt;Policy changes&lt;/li&gt;
&lt;li&gt;Outages&lt;/li&gt;
&lt;li&gt;Notification or email sends&lt;/li&gt;
&lt;li&gt;Logging SDK updates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;External causes may include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Holidays&lt;/li&gt;
&lt;li&gt;Competitor launches&lt;/li&gt;
&lt;li&gt;Macro ad demand shifts&lt;/li&gt;
&lt;li&gt;OS changes&lt;/li&gt;
&lt;li&gt;Carrier outages&lt;/li&gt;
&lt;li&gt;Country-specific regulation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Experiments need special handling. If the drop is isolated to treatment, inspect ramp timing, guardrails, exposure logging, and heterogeneous treatment effects. If treatment and control drop at the same time, suspect external factors, shared infrastructure, or logging. In social products, interference can complicate interpretation because one user's treatment can affect another user's experience.&lt;/p&gt;

&lt;p&gt;If you want more practice with these interview pivots, PracHub has related &lt;a href="https://prachub.com/interview-questions?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;data science and product analytics interview questions&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worked example: diagnosing an ads revenue drop
&lt;/h2&gt;

&lt;p&gt;Suppose the prompt is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Total ads revenue dropped yesterday. How would you diagnose it?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Start with clarifying questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How large is the drop?&lt;/li&gt;
&lt;li&gt;When did it start?&lt;/li&gt;
&lt;li&gt;Is it global or limited to a surface?&lt;/li&gt;
&lt;li&gt;Is "revenue" booked revenue, estimated revenue, or logged auction revenue?&lt;/li&gt;
&lt;li&gt;What baseline are we comparing against?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then state your plan:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Verify measurement&lt;/li&gt;
&lt;li&gt;Decompose revenue&lt;/li&gt;
&lt;li&gt;Localize the biggest contributors&lt;/li&gt;
&lt;li&gt;Compare against launches, incidents, and external signals&lt;/li&gt;
&lt;li&gt;Validate the most likely causes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For measurement, compare ad impression logs, auction logs, billing records, ETL freshness, currency conversion, and schema changes.&lt;/p&gt;

&lt;p&gt;For decomposition, check users, sessions per user, ad impressions per session, fill rate, bid density, CPM, click quality, conversion quality, and advertiser budget behavior.&lt;/p&gt;

&lt;p&gt;For segmentation, inspect country, platform, placement, advertiser vertical, campaign objective, new versus returning users, app version, and auction type.&lt;/p&gt;

&lt;p&gt;For validation, align the break point with product launches, ads ranking changes, policy enforcement, outages, and seasonality. If unaffected geos or placements exist, use them as controls.&lt;/p&gt;

&lt;p&gt;If the revenue drop aligns exactly with a ramped ads ranking launch, you might recommend a rollback during incident triage. But you should still quantify contribution and guard against confounding from weekends, holidays, or macro ad demand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Second example: low retention for a lightweight app
&lt;/h2&gt;

&lt;p&gt;Retention diagnostics are different because the metric is cohort-based.&lt;/p&gt;

&lt;p&gt;First define:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Retention window, such as D1, D7, or D28&lt;/li&gt;
&lt;li&gt;Cohort entry event&lt;/li&gt;
&lt;li&gt;Return event&lt;/li&gt;
&lt;li&gt;Whether users are new installs, reactivations, or first successful logins&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then decompose the funnel:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;install -&amp;gt; open -&amp;gt; signup/login -&amp;gt; feed load -&amp;gt; meaningful interaction -&amp;gt; return
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a lightweight Android app in emerging markets, useful segments include device RAM, OS version, network quality, app version, country, language, acquisition channel, crash rate, and cold-start latency.&lt;/p&gt;

&lt;p&gt;Retention analysis also needs care with right-censoring and delayed events. Recent cohorts may appear to have poor D7 retention simply because day 7 has not fully arrived or logs arrived late. Acquisition mix can also distort retention if a campaign brings in lower-intent users.&lt;/p&gt;

&lt;p&gt;A common product decision is whether to use D1 retention as an early signal or wait for D7 or D28 to avoid reacting to noise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common mistakes to avoid
&lt;/h2&gt;

&lt;p&gt;The first mistake is jumping to a favorite cause before checking instrumentation. A better answer explicitly rules out logging, pipelines, denominators, and event delays before discussing user sentiment.&lt;/p&gt;

&lt;p&gt;The second mistake is listing segments without priority. Do not dump "country, platform, age, gender, app version" as a flat list. Explain your ordering: verify the metric, find the component that moved, segment the largest contributor, then test hypotheses against known changes.&lt;/p&gt;

&lt;p&gt;The third mistake is treating localization as causation. "The drop is mostly Android in India" is a finding, not a root cause. The next question is what changed for that segment: app release adoption, crash spikes, network latency, ranking rollout, carrier outage, ad demand shock, or logging SDK version.&lt;/p&gt;

&lt;h2&gt;
  
  
  A simple interview structure to remember
&lt;/h2&gt;

&lt;p&gt;Use this sequence:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Define the metric precisely.&lt;/li&gt;
&lt;li&gt;Check data quality and instrumentation.&lt;/li&gt;
&lt;li&gt;Decompose the metric into drivers.&lt;/li&gt;
&lt;li&gt;Segment by contribution.&lt;/li&gt;
&lt;li&gt;Compare against time-series baselines.&lt;/li&gt;
&lt;li&gt;Map the movement to funnel steps.&lt;/li&gt;
&lt;li&gt;Check launches, incidents, experiments, and external events.&lt;/li&gt;
&lt;li&gt;Use causal methods or rollbacks when correlation is not enough.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That structure keeps your answer practical. It shows speed, but it also shows that you know when fast diagnosis is not the same as proof.&lt;/p&gt;

&lt;p&gt;For a fuller version of this framework, including Meta-style prompts and edge cases, read the PracHub guide on &lt;a href="https://prachub.com/concepts/product-diagnostics-and-root-cause-analysis?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;Product Diagnostics and Root Cause Analysis&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>career</category>
      <category>programming</category>
      <category>tech</category>
    </item>
    <item>
      <title>TikTok Data Scientist Interview Cheatsheet 2026</title>
      <dc:creator>Feng Zhang</dc:creator>
      <pubDate>Wed, 05 Aug 2026 14:27:01 +0000</pubDate>
      <link>https://dev.to/feng_zhang_cedb4581bee881/tiktok-data-scientist-interview-cheatsheet-2026-2b6d</link>
      <guid>https://dev.to/feng_zhang_cedb4581bee881/tiktok-data-scientist-interview-cheatsheet-2026-2b6d</guid>
      <description>&lt;p&gt;TikTok Data Scientist interviews usually test product sense, causal reasoning, SQL, experiment design, and statistics. The tricky part is that the prompts can sound basic: calculate retention, analyze a funnel, design an A/B test, explain a metric tradeoff. Strong answers go past the query or formula and explain what decision the analysis supports.&lt;/p&gt;

&lt;p&gt;This guide adapts PracHub's &lt;a href="https://prachub.com/interview-prep/tiktok-data-scientist-interview-prep?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;TikTok Data Scientist interview prep cheatsheet&lt;/a&gt; into a standalone study plan for developer-community readers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the interview is really testing
&lt;/h2&gt;

&lt;p&gt;A TikTok-style Data Scientist interview is rarely about memorizing definitions. You are being tested on whether you can reason from messy event data to a product decision.&lt;/p&gt;

&lt;p&gt;Expect questions across these areas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SQL and Python data manipulation&lt;/li&gt;
&lt;li&gt;Cohort, retention, funnel, and product metrics&lt;/li&gt;
&lt;li&gt;A/B testing and experiment design&lt;/li&gt;
&lt;li&gt;Power, diagnostics, and inference under noisy data&lt;/li&gt;
&lt;li&gt;Causal inference methods like matching and difference-in-differences&lt;/li&gt;
&lt;li&gt;Recommendation, ads ranking, and marketplace objectives&lt;/li&gt;
&lt;li&gt;Classification thresholds and imbalanced learning&lt;/li&gt;
&lt;li&gt;Communication with product and engineering partners&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The onsite rounds often combine several of these. A question about DAU and ad revenue, for example, is also a question about metric decomposition, segmentation, causal inference, and launch tradeoffs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cohorts, retention, funnels, and product metrics
&lt;/h2&gt;

&lt;p&gt;For product analytics questions, start by defining the unit and denominator. Many weak answers fail before the SQL starts because they count the wrong thing.&lt;/p&gt;

&lt;p&gt;A cohort groups users by a shared starting point, such as signup date, first app open, first post, first purchase, or first experiment exposure. Always clarify which one applies.&lt;/p&gt;

&lt;p&gt;A common cohort key is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="nb"&gt;DATE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;MIN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event_ts&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;cohort_date&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;partitioned by &lt;code&gt;user_id&lt;/code&gt;, but the meaning depends on the product question.&lt;/p&gt;

&lt;p&gt;For day-N retention, the basic definition is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;day-N retention =
users active on cohort_date + N / users in cohort
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You still need to define "active." It could mean opening the app, watching a video, posting, liking, purchasing, or some other qualifying event.&lt;/p&gt;

&lt;p&gt;Also separate exact retention from rolling retention:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Day-7 exact retention: user was active exactly on day 7&lt;/li&gt;
&lt;li&gt;7-day rolling retention: user was active at least once from day 1 through day 7&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These answer different questions. Exact retention is closer to a habit signal. Rolling retention captures less frequent usage.&lt;/p&gt;

&lt;p&gt;Funnels have the same issue. A funnel such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;video_view -&amp;gt; profile_visit -&amp;gt; follow
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;can be measured at the user level, session level, or item level. The conversion rate can change a lot based on that choice.&lt;/p&gt;

&lt;p&gt;Temporal order matters. If you count unordered events, you will overstate conversion. Require each step to happen after the previous one, often with window functions such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;ROW_NUMBER&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="n"&gt;OVER&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;PARTITION&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product_id&lt;/span&gt;
  &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;event_ts&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That lets you deduplicate repeated actions and enforce the sequence.&lt;/p&gt;

&lt;h2&gt;
  
  
  The DAU vs ad revenue question
&lt;/h2&gt;

&lt;p&gt;A common interview prompt is some version of: "DAU increased, but ad revenue decreased. How would you analyze it?"&lt;/p&gt;

&lt;p&gt;Do not jump straight to "optimize for growth" or "optimize for revenue." Break the metric apart.&lt;/p&gt;

&lt;p&gt;A useful decomposition is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Revenue =
DAU
x sessions per user
x impressions per session
x fill rate
x eCPM
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can ask better questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Did traffic grow, but from lower-monetizing regions?&lt;/li&gt;
&lt;li&gt;Did sessions per user fall?&lt;/li&gt;
&lt;li&gt;Did ad impressions per session decrease?&lt;/li&gt;
&lt;li&gt;Did auction pricing change?&lt;/li&gt;
&lt;li&gt;Did fill rate drop?&lt;/li&gt;
&lt;li&gt;Did new users retain worse than existing users?&lt;/li&gt;
&lt;li&gt;Did ad load changes affect watch time or churn?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A strong answer includes both objective metrics and guardrails. Objective metrics might include DAU, ad revenue, ARPDAU, retention, watch time, and ad impressions per user. Guardrails might include day-7 retention, session length, ad fatigue signals, and creator-side metrics if the feature affects posting supply.&lt;/p&gt;

&lt;p&gt;Segmentation is part of the core answer, not an optional add-on. Break results down by geography, acquisition source, user maturity, device, content vertical, and engagement level. A flat average can hide a traffic mix shift.&lt;/p&gt;

&lt;p&gt;Also watch for censoring. If today is May 23, users who joined on May 20 cannot have day-7 retention yet. Exclude immature cohorts or mark them incomplete. Do not treat missing future activity as churn.&lt;/p&gt;

&lt;h2&gt;
  
  
  A/B testing: design before math
&lt;/h2&gt;

&lt;p&gt;For experimentation questions, do not start with "randomize users 50/50." Start with the causal question.&lt;/p&gt;

&lt;p&gt;A good structure is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Objective&lt;/li&gt;
&lt;li&gt;Hypothesis&lt;/li&gt;
&lt;li&gt;Unit of randomization&lt;/li&gt;
&lt;li&gt;Eligibility and exposure&lt;/li&gt;
&lt;li&gt;Primary metric&lt;/li&gt;
&lt;li&gt;Guardrail metrics&lt;/li&gt;
&lt;li&gt;Power and minimum detectable effect&lt;/li&gt;
&lt;li&gt;Validity risks&lt;/li&gt;
&lt;li&gt;Analysis plan&lt;/li&gt;
&lt;li&gt;Decision rule&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The unit of randomization is a design choice. User-level randomization works when one user's treatment does not affect another user's outcome. That assumption can break in recommendation systems, creator ecosystems, and ad auctions.&lt;/p&gt;

&lt;p&gt;If treatment affects shared inventory, creator exposure, feed composition, or advertiser competition, consider cluster, geo, advertiser-level, or switchback designs.&lt;/p&gt;

&lt;p&gt;Eligibility and exposure rules also matter. For a For You feed experiment, assigned users are not the same as exposed users. A user may be assigned to treatment but never open the app or never see the new ranking behavior. Define both assignment and treatment exposure.&lt;/p&gt;

&lt;p&gt;Your metric hierarchy should match the decision:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Recommendation experiments: watch time per user, retention, sessions, like rate, hide rate, content diversity&lt;/li&gt;
&lt;li&gt;Monetization experiments: revenue per user, RPM, cost per conversion, advertiser ROAS&lt;/li&gt;
&lt;li&gt;Guardrails: report rate, crash rate, latency, not-interested rate, retention, creator concentration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Power should be discussed before launch. A common two-sample approximation is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;n ≈ 2σ²(z(1-α/2) + z(1-β))² / δ²
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where &lt;code&gt;δ&lt;/code&gt; is the minimum detectable effect. If you want to detect an effect half as large, you need roughly four times the sample size.&lt;/p&gt;

&lt;p&gt;Ratio metrics need care. Metrics like cost per conversion or watch time per session have random denominators. Look at numerator and denominator separately, or use methods like the delta method or bootstrap.&lt;/p&gt;

&lt;p&gt;CUPED can reduce variance by adjusting for pre-experiment behavior:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Y_adj = Y - θ(X - X_bar)
θ = Cov(Y, X) / Var(X)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works best when pre-period behavior predicts post-period outcomes, such as historical watch time predicting future watch time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Interference, seasonality, and sequential peeking
&lt;/h2&gt;

&lt;p&gt;TikTok-style experiments often have interference. One user's treatment may change what content creators make, how inventory is allocated, or what untreated users see. If that risk is present, say so directly.&lt;/p&gt;

&lt;p&gt;Cluster randomization can reduce contamination, but it lowers power. The effective sample size depends on intra-cluster correlation. A common design effect is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DE = 1 + (m - 1)ρ
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where &lt;code&gt;m&lt;/code&gt; is average cluster size and &lt;code&gt;ρ&lt;/code&gt; is intra-cluster correlation.&lt;/p&gt;

&lt;p&gt;Seasonality also needs a real plan. Run treatment and control concurrently, cover full weekly cycles, and account for region, day of week, time zone, device, and traffic source when those affect the baseline.&lt;/p&gt;

&lt;p&gt;Sequential monitoring is another common trap. If you check results every day and stop as soon as &lt;code&gt;p &amp;lt; 0.05&lt;/code&gt;, your false positive rate is higher than 5%. Use a pre-planned monitoring rule, alpha spending, group sequential tests, or mark interim reads as exploratory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Statistics that come up often
&lt;/h2&gt;

&lt;p&gt;For binary outcomes like conversion, activation, or retention, the standard difference-in-proportions test is common:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SE = sqrt(
  pT(1 - pT) / nT +
  pC(1 - pC) / nC
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then compare:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(pT - pC) / SE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;against a normal approximation.&lt;/p&gt;

&lt;p&gt;For one-sample proportion tests, compare an observed rate against a benchmark. For example, if a campaign must exceed 60% conversion, test the observed conversion rate against &lt;code&gt;p0 = 0.60&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;With clustered randomization, do not pretend millions of events are millions of independent observations. The unit of analysis should line up with the unit of randomization. You may need cluster-level aggregation or cluster-robust standard errors. With too few clusters, be cautious and consider small-sample corrections or randomization inference.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to answer in the interview
&lt;/h2&gt;

&lt;p&gt;For metric questions, use this pattern:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Clarify the product setup.
Define the unit, denominator, and time window.
Write the metric logic.
Segment the result.
Check causality and bias.
Discuss decision and guardrails.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For experiment questions, use this pattern:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Define the hypothesis.
Choose the randomization unit.
Define eligibility and exposure.
Pick primary and guardrail metrics.
Plan power and duration.
Call out interference and seasonality.
State the analysis and launch rule.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want more targeted prompts, PracHub has a bank of &lt;a href="https://prachub.com/interview-questions?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;data science interview practice questions&lt;/a&gt; that pairs well with this study plan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final prep advice
&lt;/h2&gt;

&lt;p&gt;The best TikTok Data Scientist answers are precise. Define the metric before calculating it. Be explicit about correlation versus causation. Talk through tradeoffs without hand-waving. A statistically significant lift can still be a bad launch if guardrails move the wrong way.&lt;/p&gt;

&lt;p&gt;For the full version of the cheatsheet, including the original topic map and interview framing, use PracHub's &lt;a href="https://prachub.com/interview-prep/tiktok-data-scientist-interview-prep?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;TikTok Data Scientist interview prep guide&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>career</category>
      <category>tiktok</category>
      <category>datascientist</category>
    </item>
    <item>
      <title>Multi-Tenant Isolation And Sandboxing Explained — Tech Interview Concept (2026)</title>
      <dc:creator>Feng Zhang</dc:creator>
      <pubDate>Wed, 29 Jul 2026 14:26:55 +0000</pubDate>
      <link>https://dev.to/feng_zhang_cedb4581bee881/multi-tenant-isolation-and-sandboxing-explained-tech-interview-concept-2026-50d4</link>
      <guid>https://dev.to/feng_zhang_cedb4581bee881/multi-tenant-isolation-and-sandboxing-explained-tech-interview-concept-2026-50d4</guid>
      <description>&lt;p&gt;Multi-tenant sandboxing questions are about boundaries. Can you run code, jobs, sessions, or agents for many customers on shared infrastructure without data leaks, secret exposure, or one tenant eating all the capacity?&lt;/p&gt;

&lt;p&gt;That is the core idea behind the original PracHub note on &lt;a href="https://prachub.com/concepts/multi-tenant-isolation-and-sandboxing?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;multi-tenant isolation and sandboxing&lt;/a&gt;. In interviews, this topic usually shows up as a system design prompt:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Design a cloud IDE&lt;/li&gt;
&lt;li&gt;Design a CI/CD runner&lt;/li&gt;
&lt;li&gt;Design a multi-tenant workspace app&lt;/li&gt;
&lt;li&gt;Design a sandbox for user-submitted code&lt;/li&gt;
&lt;li&gt;Design a tool execution layer for AI agents&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A weak answer says, "Add &lt;code&gt;tenant_id&lt;/code&gt; everywhere." A strong answer explains which boundary protects against which risk.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the threat model
&lt;/h2&gt;

&lt;p&gt;Before picking Kubernetes, Firecracker, or VMs, say what you are defending against.&lt;/p&gt;

&lt;p&gt;For a cloud IDE or CI/CD platform, assume user code is hostile. It may try to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read files from another tenant&lt;/li&gt;
&lt;li&gt;Escape the filesystem sandbox&lt;/li&gt;
&lt;li&gt;Abuse CPU or memory for crypto-mining&lt;/li&gt;
&lt;li&gt;Steal credentials from environment variables&lt;/li&gt;
&lt;li&gt;Call cloud metadata endpoints such as &lt;code&gt;169.254.169.254&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Scan internal services&lt;/li&gt;
&lt;li&gt;Poison a shared dependency cache&lt;/li&gt;
&lt;li&gt;Exploit a kernel or container runtime bug&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a normal SaaS workspace app, the threat model is different. You may care more about authorization bugs, stolen tokens, misconfigured admin access, and data leakage through logs or search indexes.&lt;/p&gt;

&lt;p&gt;Do not treat those as the same problem. That leads to bad designs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tenant isolation has layers
&lt;/h2&gt;

&lt;p&gt;Tenant isolation is not one control. It is a stack of controls across several layers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identity: who is the caller?&lt;/li&gt;
&lt;li&gt;Authorization: what can the caller do?&lt;/li&gt;
&lt;li&gt;Data: which rows, objects, indexes, and backups can be accessed?&lt;/li&gt;
&lt;li&gt;Compute: where does code run?&lt;/li&gt;
&lt;li&gt;Network: what can the runtime connect to?&lt;/li&gt;
&lt;li&gt;Secrets: which credentials are available?&lt;/li&gt;
&lt;li&gt;Observability: what appears in logs, traces, metrics, and audits?&lt;/li&gt;
&lt;li&gt;Billing and quotas: who pays for the work, and who can consume capacity?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;tenant_id&lt;/code&gt; filtering in &lt;code&gt;Postgres&lt;/code&gt; helps with logical data isolation. It does not sandbox a build script. It does not stop SSRF. It does not cap CPU usage. It does not redact a secret from logs.&lt;/p&gt;

&lt;p&gt;Good interview answers make that distinction clear.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose the right isolation primitive
&lt;/h2&gt;

&lt;p&gt;Isolation primitives sit on a spectrum.&lt;/p&gt;

&lt;p&gt;Processes are cheap and fast, but they are weak for untrusted code. Containers add Linux namespaces and cgroups. MicroVMs, such as &lt;code&gt;Firecracker&lt;/code&gt;, reduce host kernel sharing compared with containers. Full VMs provide stronger separation, but startup time and memory overhead are higher.&lt;/p&gt;

&lt;p&gt;A practical answer often compares them like this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Primitive&lt;/th&gt;
&lt;th&gt;Strength&lt;/th&gt;
&lt;th&gt;Cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Process&lt;/td&gt;
&lt;td&gt;Low isolation&lt;/td&gt;
&lt;td&gt;Very low overhead&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Container&lt;/td&gt;
&lt;td&gt;Namespaces, cgroups, image packaging&lt;/td&gt;
&lt;td&gt;Fast startup, shared kernel&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MicroVM&lt;/td&gt;
&lt;td&gt;Stronger kernel boundary&lt;/td&gt;
&lt;td&gt;More overhead than containers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Full VM&lt;/td&gt;
&lt;td&gt;Strong separation&lt;/td&gt;
&lt;td&gt;Higher startup and memory cost&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For an interactive cloud IDE, containers may give better startup latency and density. For arbitrary public workloads, microVMs may be worth the extra overhead. For regulated or high-risk tenants, full VMs or separate cloud accounts may be justified.&lt;/p&gt;

&lt;p&gt;Tie the primitive back to the product constraint. Think about latency, cost, workload duration, risk level, and tenant value.&lt;/p&gt;

&lt;h2&gt;
  
  
  Know what namespaces and cgroups do
&lt;/h2&gt;

&lt;p&gt;If you mention containers, be ready to name the underlying controls.&lt;/p&gt;

&lt;p&gt;Linux namespaces isolate what a process can see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;pid&lt;/code&gt;: process tree&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;net&lt;/code&gt;: network interfaces and routing&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mnt&lt;/code&gt;: filesystem mounts&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;uts&lt;/code&gt;: hostname and domain name&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ipc&lt;/code&gt;: interprocess communication&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;user&lt;/code&gt;: user and group IDs&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cgroup&lt;/code&gt;: cgroup hierarchy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;cgroups limit what a process can consume:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CPU shares&lt;/li&gt;
&lt;li&gt;Memory&lt;/li&gt;
&lt;li&gt;Process count&lt;/li&gt;
&lt;li&gt;I/O bandwidth&lt;/li&gt;
&lt;li&gt;Device access&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A simple way to say it: namespaces hide resources, cgroups limit resources.&lt;/p&gt;

&lt;p&gt;For sandboxed execution, add hardening:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run as non-root&lt;/li&gt;
&lt;li&gt;Drop Linux capabilities such as &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Use a deny-by-default &lt;code&gt;seccomp&lt;/code&gt; profile&lt;/li&gt;
&lt;li&gt;Apply &lt;code&gt;AppArmor&lt;/code&gt; or &lt;code&gt;SELinux&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Mount filesystems read-only where possible&lt;/li&gt;
&lt;li&gt;Reject privileged containers&lt;/li&gt;
&lt;li&gt;Avoid host mounts unless there is a very specific reason&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Saying "each job runs in a pod" is not enough. Pods share the host kernel, and unsafe pod settings can break your isolation model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resource fairness needs admission control
&lt;/h2&gt;

&lt;p&gt;Multi-tenant systems can fail even without an attacker. One tenant can start too many builds or keep too many IDE sessions open.&lt;/p&gt;

&lt;p&gt;You need admission control before scheduling work. A simple capacity model is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;concurrent_jobs &amp;lt;= floor(total_safe_capacity / per_job_reservation)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then add:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Per-tenant quotas&lt;/li&gt;
&lt;li&gt;Global queues&lt;/li&gt;
&lt;li&gt;Priority classes&lt;/li&gt;
&lt;li&gt;Burst limits&lt;/li&gt;
&lt;li&gt;Timeouts and TTLs&lt;/li&gt;
&lt;li&gt;Eviction rules for idle sessions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;CI/CD systems care heavily about queue fairness. Cloud IDEs care about interactive latency and idle cleanup. Both need limits, or one tenant can become a noisy neighbor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data isolation is physical, logical, or hybrid
&lt;/h2&gt;

&lt;p&gt;There are three common data tenancy models.&lt;/p&gt;

&lt;p&gt;Separate databases per tenant reduce blast radius and can simplify deletion or export. The tradeoff is operational overhead.&lt;/p&gt;

&lt;p&gt;Shared tables with &lt;code&gt;tenant_id&lt;/code&gt; are easier to operate at scale, but every query and authorization path must be correct. Use composite indexes such as &lt;code&gt;(tenant_id, object_id)&lt;/code&gt;, and consider &lt;code&gt;Postgres&lt;/code&gt; row-level security as defense in depth.&lt;/p&gt;

&lt;p&gt;A hybrid model may put large or high-risk tenants in dedicated storage while smaller tenants share tables.&lt;/p&gt;

&lt;p&gt;The interview signal is not that one model is always best. The signal is that you can explain the tradeoff and add safeguards.&lt;/p&gt;

&lt;h2&gt;
  
  
  Authorization should fail closed
&lt;/h2&gt;

&lt;p&gt;Never trust a client-supplied &lt;code&gt;tenant_id&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Derive tenant context from one of these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Session data&lt;/li&gt;
&lt;li&gt;Token claims&lt;/li&gt;
&lt;li&gt;Server-side membership lookup&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then check permissions centrally. Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;workspace:read&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;workspace:write&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;runner:execute&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;artifact:download&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;admin:invite_user&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every request should carry an authenticated principal and tenant context. If the system cannot determine either one, deny the request.&lt;/p&gt;

&lt;p&gt;Cross-tenant authorization bugs are common because teams scatter permission checks across handlers. A central authorization layer reduces that risk.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use ephemeral runtimes for code execution
&lt;/h2&gt;

&lt;p&gt;Mutable shared workers are dangerous for CI/CD and cloud IDE workloads.&lt;/p&gt;

&lt;p&gt;A safer lifecycle looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a fresh runtime from a known image&lt;/li&gt;
&lt;li&gt;Attach only the credentials needed for this job or session&lt;/li&gt;
&lt;li&gt;Run the workload&lt;/li&gt;
&lt;li&gt;Stream logs and terminal output&lt;/li&gt;
&lt;li&gt;Persist declared artifacts or workspace changes&lt;/li&gt;
&lt;li&gt;Tear down the sandbox&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Warm pools can reduce startup time, but they must be scrubbed carefully before reuse. If you cannot prove cleanup is correct, prefer fresh environments.&lt;/p&gt;

&lt;p&gt;A useful state machine is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Queued -&amp;gt; Provisioning -&amp;gt; Running -&amp;gt; Stopping -&amp;gt; Persisting -&amp;gt; Terminated
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add retries and cleanup for every transition. Orphaned sandboxes cost money and create risk, so use heartbeats, leases, TTLs, and a janitor process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Secrets are often the breach path
&lt;/h2&gt;

&lt;p&gt;Many sandbox escapes start with boring credential leakage.&lt;/p&gt;

&lt;p&gt;Do not bake secrets into images, dependency caches, or shared volumes. Inject short-lived credentials at runtime from &lt;code&gt;Vault&lt;/code&gt;, a cloud IAM system, or a secret manager.&lt;/p&gt;

&lt;p&gt;Scope credentials as tightly as possible:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tenant&lt;/li&gt;
&lt;li&gt;Repository&lt;/li&gt;
&lt;li&gt;Branch&lt;/li&gt;
&lt;li&gt;Job&lt;/li&gt;
&lt;li&gt;Environment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Redact secrets in logs. Treat terminal output, build logs, traces, and error reports as possible exfiltration channels.&lt;/p&gt;

&lt;h2&gt;
  
  
  Network isolation needs egress control
&lt;/h2&gt;

&lt;p&gt;A sandbox should not have broad network access by default.&lt;/p&gt;

&lt;p&gt;Use per-sandbox network namespaces, Kubernetes network policy, security groups, service mesh policy, or egress proxies. Block access to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cloud metadata endpoints such as &lt;code&gt;169.254.169.254&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Internal admin services&lt;/li&gt;
&lt;li&gt;Other tenants' private networks&lt;/li&gt;
&lt;li&gt;Control plane APIs unless explicitly allowed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ingress matters too, but egress is where many sandbox designs fail. If arbitrary code can reach internal services, SSRF becomes a real incident path.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cache carefully
&lt;/h2&gt;

&lt;p&gt;Caches are great for build speed and infrastructure cost. They are also a common isolation footgun.&lt;/p&gt;

&lt;p&gt;Key dependency caches and Docker layer caches by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tenant&lt;/li&gt;
&lt;li&gt;Repository&lt;/li&gt;
&lt;li&gt;Lockfile hash&lt;/li&gt;
&lt;li&gt;Architecture&lt;/li&gt;
&lt;li&gt;Trust level&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cross-tenant read-only public caches can be acceptable. Writable shared caches are risky because one tenant may poison dependencies or artifacts used by another.&lt;/p&gt;

&lt;p&gt;For CI/CD platforms, artifact integrity should be part of the design. Signed artifacts and strict cache keys are stronger than "we have a shared cache directory."&lt;/p&gt;

&lt;h2&gt;
  
  
  A strong cloud IDE answer
&lt;/h2&gt;

&lt;p&gt;For "Design a sandboxed cloud IDE," start with clarifying questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Are users running arbitrary code?&lt;/li&gt;
&lt;li&gt;Do sessions need internet access?&lt;/li&gt;
&lt;li&gt;Which languages must be supported?&lt;/li&gt;
&lt;li&gt;Is the home directory persistent?&lt;/li&gt;
&lt;li&gt;What startup latency target matters, such as &lt;code&gt;p95 &amp;lt; 5s&lt;/code&gt;?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then structure the design:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Control plane: authenticates users, maps users to tenants and workspaces, schedules sessions, stores metadata in &lt;code&gt;Postgres&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Execution plane: runs containers or microVMs on isolated node pools with cgroups, seccomp, non-root users, per-session networking, and TTL cleanup&lt;/li&gt;
&lt;li&gt;Persistence and streaming: stores workspace files on per-tenant volumes or object storage snapshots, streams terminal I/O through &lt;code&gt;WebSocket&lt;/code&gt; or server-sent events&lt;/li&gt;
&lt;li&gt;Operations: quotas, warm pools, autoscaling, audit logs, metrics, and janitor jobs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Call out the container versus microVM tradeoff. Containers are faster and denser. MicroVMs reduce kernel-sharing risk for arbitrary code. A tiered model is often the cleanest answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  A strong CI/CD answer
&lt;/h2&gt;

&lt;p&gt;For "Design a multi-tenant CI/CD platform," the same principles apply, but the workload is batch-oriented.&lt;/p&gt;

&lt;p&gt;Focus on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ephemeral runners&lt;/li&gt;
&lt;li&gt;Per-job credentials&lt;/li&gt;
&lt;li&gt;Tenant-scoped queues&lt;/li&gt;
&lt;li&gt;Fair scheduling&lt;/li&gt;
&lt;li&gt;Cache keys tied to lockfiles and trust boundaries&lt;/li&gt;
&lt;li&gt;Signed artifacts&lt;/li&gt;
&lt;li&gt;Strict teardown after each pipeline step&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The risks are malicious build scripts, dependency cache poisoning, secret exfiltration, and queue starvation.&lt;/p&gt;

&lt;p&gt;If you want more prompts in this area, PracHub has related &lt;a href="https://prachub.com/interview-questions?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;software engineering interview questions&lt;/a&gt; that pair well with this topic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common mistakes
&lt;/h2&gt;

&lt;p&gt;The biggest mistake is treating &lt;code&gt;tenant_id&lt;/code&gt; as the full isolation story. It only covers part of data access.&lt;/p&gt;

&lt;p&gt;The second mistake is jumping to Kubernetes without naming the real security boundary. A pod is not automatically safe.&lt;/p&gt;

&lt;p&gt;The third mistake is choosing maximum isolation without product context. A full VM per request may be too slow or expensive for an IDE. A shared container may be too weak for hostile public code.&lt;/p&gt;

&lt;p&gt;A good answer layers controls and explains tradeoffs. Start with the threat model, pick the isolation primitive, lock down data and secrets, add quotas, restrict networking, and design cleanup as part of the system.&lt;/p&gt;

&lt;p&gt;For a more interview-focused version of this breakdown, see the original PracHub guide to &lt;a href="https://prachub.com/concepts/multi-tenant-isolation-and-sandboxing?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;multi-tenant isolation and sandboxing&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>career</category>
      <category>systemdesign</category>
      <category>programming</category>
    </item>
    <item>
      <title>DoorDash Data Scientist Interview Cheatsheet 2026</title>
      <dc:creator>Feng Zhang</dc:creator>
      <pubDate>Wed, 22 Jul 2026 14:26:03 +0000</pubDate>
      <link>https://dev.to/feng_zhang_cedb4581bee881/doordash-data-scientist-interview-cheatsheet-2026-25fi</link>
      <guid>https://dev.to/feng_zhang_cedb4581bee881/doordash-data-scientist-interview-cheatsheet-2026-25fi</guid>
      <description>&lt;p&gt;DoorDash Data Scientist interviews usually test two things at the same time: can you write clean analytical code, and can you reason about a messy three-sided marketplace without acting like the data is cleaner than it is.&lt;/p&gt;

&lt;p&gt;If you are preparing for the 2026 cycle, the full &lt;a href="https://prachub.com/interview-prep/doordash-data-scientist-interview-prep?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;DoorDash Data Scientist interview prep cheatsheet on PracHub&lt;/a&gt; is a useful reference. This post condenses the main patterns into a standalone guide you can use while studying.&lt;/p&gt;

&lt;p&gt;The core areas are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SQL and Python data manipulation&lt;/li&gt;
&lt;li&gt;Window functions&lt;/li&gt;
&lt;li&gt;A/B testing&lt;/li&gt;
&lt;li&gt;Causal inference&lt;/li&gt;
&lt;li&gt;Marketplace metric design&lt;/li&gt;
&lt;li&gt;Delivery quality diagnostics&lt;/li&gt;
&lt;li&gt;Switchback experiments&lt;/li&gt;
&lt;li&gt;Unit economics, pricing, and power analysis&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The main theme across all of them: DoorDash questions are rarely pure syntax questions. They are business analytics questions where the hard part is often defining the metric correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQL: treat business definitions as part of the problem
&lt;/h2&gt;

&lt;p&gt;DoorDash SQL questions usually involve orders, customers, restaurants, Dashers, events, cities, and time. You may be asked to calculate monthly spend, identify top restaurants, compare customer behavior across periods, or derive delivery-quality metrics.&lt;/p&gt;

&lt;p&gt;The interviewer is checking whether you can turn vague business language into correct query logic.&lt;/p&gt;

&lt;p&gt;Before writing code, clarify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What counts as a completed order?&lt;/li&gt;
&lt;li&gt;Which timestamp should be used: created, confirmed, picked up, delivered, canceled?&lt;/li&gt;
&lt;li&gt;What timezone should reporting use?&lt;/li&gt;
&lt;li&gt;Are canceled or refunded orders included?&lt;/li&gt;
&lt;li&gt;Is the metric order-level, customer-level, restaurant-level, or market-level?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Common SQL patterns include:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;DATE_TRUNC&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'month'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;for monthly metrics,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;CASE&lt;/span&gt; &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;condition&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;ELSE&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;for rates, and &lt;code&gt;ROW_NUMBER&lt;/code&gt;, &lt;code&gt;RANK&lt;/code&gt;, or &lt;code&gt;DENSE_RANK&lt;/code&gt; for top-N queries.&lt;/p&gt;

&lt;p&gt;The mistake I see most often is row inflation after joins. If you join an order table to item-level or event-level data, &lt;code&gt;COUNT(*)&lt;/code&gt; may no longer mean number of orders. Use &lt;code&gt;COUNT(DISTINCT order_id)&lt;/code&gt; when the grain requires it.&lt;/p&gt;

&lt;p&gt;Also be careful with &lt;code&gt;LEFT JOIN&lt;/code&gt;. A filter in the &lt;code&gt;WHERE&lt;/code&gt; clause on the right-side table can turn it into an inner join and remove customers, restaurants, or cities with zero activity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Window functions: know the grain before ranking or comparing
&lt;/h2&gt;

&lt;p&gt;Window functions come up often because marketplace data is sequential. Customers reorder, Dashers receive dispatches, orders move through statuses, and restaurants have performance trends over time.&lt;/p&gt;

&lt;p&gt;You should be comfortable with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;LAG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;OVER&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;PARTITION&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;
  &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;order_ts&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;for prior-order comparisons,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;LEAD&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;OVER&lt;/span&gt; &lt;span class="p"&gt;(...)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;for what happened after an event, and&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;ROW_NUMBER&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="n"&gt;OVER&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;PARTITION&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;city_id&lt;/span&gt;
  &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;restaurant_id&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;for deterministic top-N logic.&lt;/p&gt;

&lt;p&gt;A good answer explains tie behavior. If the interviewer asks for one top restaurant per city, &lt;code&gt;RANK()&lt;/code&gt; may return multiple rows. &lt;code&gt;ROW_NUMBER()&lt;/code&gt; with a stable tie-breaker is safer.&lt;/p&gt;

&lt;p&gt;For rolling or cumulative metrics, distinguish row-based windows from calendar-based windows. A "7-day rolling order count" is not the same as "last 7 rows." If the table has missing days, that difference matters.&lt;/p&gt;

&lt;p&gt;A reliable workflow is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Aggregate to the right grain first, such as restaurant-day or customer-month.&lt;/li&gt;
&lt;li&gt;Apply window functions after that.&lt;/li&gt;
&lt;li&gt;Filter top-N results in an outer query or CTE.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That prevents mixing raw order rows with grouped metrics, which can duplicate revenue or distort rates.&lt;/p&gt;

&lt;h2&gt;
  
  
  A/B testing: user-level randomization is often wrong
&lt;/h2&gt;

&lt;p&gt;Many DoorDash experimentation questions are traps for people who default to "split users 50/50 and compare conversion."&lt;/p&gt;

&lt;p&gt;That can work for independent consumer UI changes. It can fail badly for marketplace interventions.&lt;/p&gt;

&lt;p&gt;If a change affects dispatch, batching, fees, delivery radius, Dasher incentives, or restaurant availability, one treated unit can affect untreated units. A treated order can change Dasher supply, merchant wait time, ETA accuracy, and customer experience nearby.&lt;/p&gt;

&lt;p&gt;That is interference, and it violates the usual assumption that one unit's treatment does not affect another unit's outcome.&lt;/p&gt;

&lt;p&gt;For marketplace changes, consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Geo-level randomization&lt;/li&gt;
&lt;li&gt;Market-level randomization&lt;/li&gt;
&lt;li&gt;Zone-level randomization&lt;/li&gt;
&lt;li&gt;Time-block randomization&lt;/li&gt;
&lt;li&gt;Geo-time switchback experiments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A switchback design might randomize treatment by &lt;code&gt;zone × time_block&lt;/code&gt;, such as 2-hour or 4-hour blocks. This is useful when market conditions differ across cities or zones, but the policy can alternate over time.&lt;/p&gt;

&lt;p&gt;A common analysis equation is:&lt;/p&gt;

&lt;p&gt;$$Y_{g,t}=\alpha_g+\gamma_t+\beta T_{g,t}+\epsilon_{g,t}$$&lt;/p&gt;

&lt;p&gt;where geography fixed effects control for persistent market differences, time fixed effects control for common time shocks, and treatment estimates the policy effect.&lt;/p&gt;

&lt;p&gt;Use clustered standard errors at the assignment level. If treatment was assigned by zone-hour, raw order count alone does not tell you the true amount of independent evidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Power: millions of orders can still be underpowered
&lt;/h2&gt;

&lt;p&gt;Clustered experiments reduce effective sample size. If you randomize across 10 markets, you do not magically have millions of independent experimental units just because millions of orders occurred.&lt;/p&gt;

&lt;p&gt;A simple design effect is:&lt;/p&gt;

&lt;p&gt;$$DE = 1 + (m-1)\rho$$&lt;/p&gt;

&lt;p&gt;where &lt;code&gt;m&lt;/code&gt; is cluster size and &lt;code&gt;ρ&lt;/code&gt; is intra-cluster correlation.&lt;/p&gt;

&lt;p&gt;That means power depends on the number of independent clusters and the variance at that level. For switchbacks, use historical variance at the market-time or zone-time level.&lt;/p&gt;

&lt;p&gt;For a two-sample mean comparison, a rough sample size formula is:&lt;/p&gt;

&lt;p&gt;$$n \approx \frac{2\sigma^2(z_{1-\alpha/2}+z_{1-\beta})^2}{\delta^2}$$&lt;/p&gt;

&lt;p&gt;For proportions, replace variance with &lt;code&gt;p(1-p)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In an interview, you do not need to compute every value perfectly. You do need to say what minimum detectable effect matters, what variance estimate you would use, and how clustering changes the calculation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Metrics: pick one decision metric and guardrails
&lt;/h2&gt;

&lt;p&gt;DoorDash experiments often involve tradeoffs. A batching algorithm may raise orders per Dasher hour but hurt food quality. A promotion may improve D7 retention but increase refunds. A dispatch change may reduce delivery time while lowering Dasher earnings.&lt;/p&gt;

&lt;p&gt;A strong metric setup has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One primary decision metric&lt;/li&gt;
&lt;li&gt;Guardrail metrics&lt;/li&gt;
&lt;li&gt;Diagnostic metrics&lt;/li&gt;
&lt;li&gt;Pre-planned segments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For logistics changes, primary metrics might include delivery time, on-time rate, or contribution profit per order. Guardrails might include cancellation rate, merchant wait time, Dasher idle time, customer rating, refund rate, or reorder rate.&lt;/p&gt;

&lt;p&gt;Segments matter because effects can differ by market density, peak versus off-peak, new versus existing customers, restaurant category, distance band, Dasher mode, and supply-demand balance.&lt;/p&gt;

&lt;p&gt;Do not claim success from an aggregate lift if suburban zones degrade while dense urban zones improve. That is exactly the kind of marketplace reasoning interviewers expect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Causal inference: start with the estimand
&lt;/h2&gt;

&lt;p&gt;Causal inference questions usually start with a metric change or a proposed rollout: late deliveries increased, a merchant variety launch changed retention, a new incentive changed Dasher behavior.&lt;/p&gt;

&lt;p&gt;Do not jump straight to a model. Start by defining the causal question.&lt;/p&gt;

&lt;p&gt;Are you estimating:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Average treatment effect?&lt;/li&gt;
&lt;li&gt;Treatment effect on treated?&lt;/li&gt;
&lt;li&gt;Segment-specific effect?&lt;/li&gt;
&lt;li&gt;Local effect for compliers?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then choose the method.&lt;/p&gt;

&lt;p&gt;Randomized experiments are best when feasible. If not, DoorDash-style questions often point toward difference-in-differences, matched controls, synthetic control, or staggered rollout analysis.&lt;/p&gt;

&lt;p&gt;For difference-in-differences:&lt;/p&gt;

&lt;p&gt;$$\hat{\tau} = (Y_{treated,post} - Y_{treated,pre}) - (Y_{control,post} - Y_{control,pre})$$&lt;/p&gt;

&lt;p&gt;The key assumption is parallel trends. You should say you would check pre-period trends, run placebo tests, and compare against matched markets.&lt;/p&gt;

&lt;p&gt;Regression adjustment can improve precision, but it does not remove bias by itself. Use pre-treatment covariates only. Controlling for post-treatment variables, such as actual delivery time, can block part of the treatment effect you are trying to measure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example: diagnosing late deliveries
&lt;/h2&gt;

&lt;p&gt;A good answer starts with definitions.&lt;/p&gt;

&lt;p&gt;"Late" could mean late relative to quoted ETA, promised delivery window, or food-ready time. The business may care about order-level lateness, customer perception, merchant SLA, or retention.&lt;/p&gt;

&lt;p&gt;Then decompose total delivery time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Merchant prep time&lt;/li&gt;
&lt;li&gt;Dasher assignment latency&lt;/li&gt;
&lt;li&gt;Travel to merchant&lt;/li&gt;
&lt;li&gt;Pickup wait&lt;/li&gt;
&lt;li&gt;Travel to customer&lt;/li&gt;
&lt;li&gt;Batching delay&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Compare affected and unaffected markets, dayparts, merchant types, weather conditions, and distance bands. Once you have a leading hypothesis, choose the design.&lt;/p&gt;

&lt;p&gt;If prep-time estimates look wrong, test merchant-facing prep prompts or adjusted buffers. If Dasher supply is the issue, a zone-hour switchback test of incentives may fit better than customer-level randomization.&lt;/p&gt;

&lt;p&gt;The final recommendation should tie back to launch criteria: reduce late rate without hurting Dasher earnings, merchant wait, cancellations, refunds, or contribution margin.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to practice
&lt;/h2&gt;

&lt;p&gt;For SQL, practice joins, conditional aggregation, date grouping, ranking, rolling metrics, and percentiles. For experimentation, practice explaining why user-level randomization may fail and how switchbacks work. For causal inference, practice turning a vague metric movement into a clear estimand, method, and decision.&lt;/p&gt;

&lt;p&gt;You can find related DoorDash-style and marketplace analytics prompts in the &lt;a href="https://prachub.com/interview-questions?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;PracHub interview questions library&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you want the full structured version with topic-by-topic practice cards, use the &lt;a href="https://prachub.com/interview-prep/doordash-data-scientist-interview-prep?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;DoorDash Data Scientist interview prep cheatsheet&lt;/a&gt; as your study checklist.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>career</category>
      <category>doordash</category>
      <category>datascientist</category>
    </item>
    <item>
      <title>Supervised ML Fundamentals, Evaluation And Feature Engineering Explained — Tech Interview Concept (2026)</title>
      <dc:creator>Feng Zhang</dc:creator>
      <pubDate>Wed, 15 Jul 2026 14:25:45 +0000</pubDate>
      <link>https://dev.to/feng_zhang_cedb4581bee881/supervised-ml-fundamentals-evaluation-and-feature-engineering-explained-tech-interview-concept-3g90</link>
      <guid>https://dev.to/feng_zhang_cedb4581bee881/supervised-ml-fundamentals-evaluation-and-feature-engineering-explained-tech-interview-concept-3g90</guid>
      <description>&lt;p&gt;Supervised ML interview questions usually are not about reciting definitions. The better signal is whether you can pick a model, design the evaluation, explain tradeoffs, and tie the choice to business cost.&lt;/p&gt;

&lt;p&gt;If you want the original interview-focused version, PracHub has a concise concept page on &lt;a href="https://prachub.com/concepts/supervised-ml-fundamentals-evaluation-and-feature-engineering?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;supervised ML fundamentals, evaluation, and feature engineering&lt;/a&gt;. This post rewrites the same ideas as a practical guide for developer and data science readers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the decision context
&lt;/h2&gt;

&lt;p&gt;Before comparing algorithms, ask what the model output is used for.&lt;/p&gt;

&lt;p&gt;Are you optimizing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Probability accuracy?&lt;/li&gt;
&lt;li&gt;Ranking quality?&lt;/li&gt;
&lt;li&gt;Forecast accuracy?&lt;/li&gt;
&lt;li&gt;A hard business action, such as block, approve, alert, or reorder?&lt;/li&gt;
&lt;li&gt;Interpretability for product, operations, or compliance teams?&lt;/li&gt;
&lt;li&gt;Low-latency scoring?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That question changes the model and the evaluation.&lt;/p&gt;

&lt;p&gt;A fraud model with a rare positive class should not be judged by raw accuracy. A demand forecast should not use random cross-validation if time order matters. A conversion model used for bidding may need calibrated probabilities, while a search relevance model may care more about ranking metrics.&lt;/p&gt;

&lt;p&gt;A good interview answer often starts with: "I would first clarify whether we need calibrated probabilities, ranking quality, forecast accuracy, or an action threshold tied to business cost."&lt;/p&gt;

&lt;h2&gt;
  
  
  Linear and logistic regression are still worth knowing well
&lt;/h2&gt;

&lt;p&gt;Linear regression estimates coefficients by minimizing squared error:&lt;/p&gt;

&lt;p&gt;$$&lt;br&gt;
\min_\beta \sum_i (y_i - x_i^\top\beta)^2&lt;br&gt;
$$&lt;/p&gt;

&lt;p&gt;The classic assumptions are linearity, independent errors, homoscedasticity, no perfect multicollinearity, and exogeneity:&lt;/p&gt;

&lt;p&gt;$$&lt;br&gt;
E[\epsilon \mid X]=0&lt;br&gt;
$$&lt;/p&gt;

&lt;p&gt;Breaking these assumptions does not automatically make predictions useless. It does affect inference, confidence intervals, and how much you should trust coefficient interpretation.&lt;/p&gt;

&lt;p&gt;Logistic regression models class probability as:&lt;/p&gt;

&lt;p&gt;$$&lt;br&gt;
P(y=1 \mid x)=\sigma(x^\top\beta)&lt;br&gt;
$$&lt;/p&gt;

&lt;p&gt;It minimizes log loss, not squared error. In tabular classification, logistic regression is often a strong baseline, especially with sparse high-dimensional features. It is also easier to explain and often better calibrated than many complex models out of the box.&lt;/p&gt;

&lt;p&gt;Do not skip the baseline. If a boosted tree barely beats regularized logistic regression but is harder to explain, slower to score, and poorly calibrated, the simpler model may be the better production choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Regularization is about controlling variance
&lt;/h2&gt;

&lt;p&gt;Regularization penalizes model complexity to reduce overfitting.&lt;/p&gt;

&lt;p&gt;Common forms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;L2 regularization adds $\lambda|\beta|_2^2$. It shrinks coefficients smoothly and works well with correlated predictors.&lt;/li&gt;
&lt;li&gt;L1 regularization adds $\lambda|\beta|_1$. It can set coefficients to zero, which makes it useful for sparse feature selection.&lt;/li&gt;
&lt;li&gt;Elastic Net combines L1 and L2. It is useful when groups of correlated predictors are present.&lt;/li&gt;
&lt;li&gt;L0 regularization counts nonzero coefficients, $|\beta|_0$. It directly targets subset selection, but exact optimization is usually combinatorial.&lt;/li&gt;
&lt;li&gt;L∞ regularization constrains the maximum absolute coefficient. It is less common in applied interviews, but it tests whether you understand norm geometry and constraints.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feature scaling matters here. If one feature is measured in cents and another in years, a regularization penalty treats their coefficients differently unless you scale the inputs. Scaling is also needed for distance-based models and many gradient-based linear models.&lt;/p&gt;

&lt;p&gt;Tree models such as Random Forests, Gradient Boosted Trees, &lt;code&gt;XGBoost&lt;/code&gt;, and &lt;code&gt;LightGBM&lt;/code&gt; are mostly invariant to monotonic scaling. Transformations can still help with outliers or skewed distributions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Random Forests vs Gradient Boosting
&lt;/h2&gt;

&lt;p&gt;This is a common interview comparison because both are tree ensembles, but they behave differently.&lt;/p&gt;

&lt;p&gt;Random Forests reduce variance through bagging. They train many decorrelated trees on bootstrap samples and random subsets of predictors. They are stable, parallelizable, and less sensitive to hyperparameter settings. They are often a safe first model when labels are noisy or you need a benchmark that does not take much tuning.&lt;/p&gt;

&lt;p&gt;Gradient Boosting trains trees sequentially. Each new tree fits residuals or gradients from the current model. This tends to reduce bias and often works very well on structured tabular data. &lt;code&gt;XGBoost&lt;/code&gt; and &lt;code&gt;LightGBM&lt;/code&gt; are common examples.&lt;/p&gt;

&lt;p&gt;The tradeoff is tuning. Boosted trees need careful control of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learning rate&lt;/li&gt;
&lt;li&gt;Number of trees&lt;/li&gt;
&lt;li&gt;Max depth&lt;/li&gt;
&lt;li&gt;Subsampling&lt;/li&gt;
&lt;li&gt;Column sampling&lt;/li&gt;
&lt;li&gt;Early stopping&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If trees are too deep or boosting rounds run too long, boosted models can overfit label noise.&lt;/p&gt;

&lt;p&gt;A solid answer sounds like this:&lt;/p&gt;

&lt;p&gt;"Random Forests mainly reduce variance through bagging, while Gradient Boosted Trees reduce bias through sequential additive learning. I would compare them based on predictive performance, sensitivity to noisy data, tuning cost, calibration, and the business metric. Boosted trees may win on &lt;code&gt;PR-AUC&lt;/code&gt; or lift, but Random Forests may be easier to tune and less brittle."&lt;/p&gt;

&lt;p&gt;That answer is much better than "Gradient Boosting is more accurate" or "Random Forests avoid overfitting."&lt;/p&gt;

&lt;h2&gt;
  
  
  Class imbalance changes the metric
&lt;/h2&gt;

&lt;p&gt;Accuracy is a trap when positives are rare.&lt;/p&gt;

&lt;p&gt;If the positive class rate is 0.5%, a classifier that always predicts negative gets 99.5% accuracy. That number is useless.&lt;/p&gt;

&lt;p&gt;For imbalanced classification, consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;precision&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;recall&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;F1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PR-AUC&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Top-k lift&lt;/li&gt;
&lt;li&gt;Recall at fixed precision&lt;/li&gt;
&lt;li&gt;Cost-weighted metrics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;ROC-AUC&lt;/code&gt; can also mislead when positives are extremely rare. A model can have a strong &lt;code&gt;ROC-AUC&lt;/code&gt; while precision is too low for production use.&lt;/p&gt;

&lt;p&gt;Sampling and class weights can help training, but they do not replace a good evaluation plan. You still need to choose a decision threshold based on cost.&lt;/p&gt;

&lt;p&gt;For example, a fraud model might optimize:&lt;/p&gt;

&lt;p&gt;$$&lt;br&gt;
EV(t)=TP(t)\cdot B - FP(t)\cdot C - FN(t)\cdot L&lt;br&gt;
$$&lt;/p&gt;

&lt;p&gt;Here, $t$ is the threshold, $B$ is the benefit of catching fraud, $C$ is the cost of a false positive, and $L$ is the loss from a false negative.&lt;/p&gt;

&lt;p&gt;The model produces scores or probabilities. The threshold is a business policy layered on top.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calibration matters when probabilities drive decisions
&lt;/h2&gt;

&lt;p&gt;Ranking quality and probability accuracy are different.&lt;/p&gt;

&lt;p&gt;A model can rank cases well but produce poorly calibrated probabilities. That may be fine for a top-k review queue. It is a problem if probabilities feed expected-value calculations, capacity planning, pricing, or downstream decision systems.&lt;/p&gt;

&lt;p&gt;Logistic regression is often reasonably calibrated. Boosted trees may need Platt scaling or isotonic regression.&lt;/p&gt;

&lt;p&gt;Useful calibration checks include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Calibration curves&lt;/li&gt;
&lt;li&gt;Brier score&lt;/li&gt;
&lt;li&gt;Observed vs predicted rates by score bucket&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a bucket of users predicted at 20% conversion actually converts at 8%, that model may still rank users well, but its probabilities are not reliable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Time-series forecasting needs temporal validation
&lt;/h2&gt;

&lt;p&gt;Forecasting has a different data-generating process from ordinary tabular classification.&lt;/p&gt;

&lt;p&gt;Random train/test splits leak future information. They can make a weak model look strong, especially when seasonality, promotions, customer behavior shifts, or inventory effects are present.&lt;/p&gt;

&lt;p&gt;Use temporal validation, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A simple holdout from a later time period&lt;/li&gt;
&lt;li&gt;Rolling-origin evaluation&lt;/li&gt;
&lt;li&gt;Backtesting across several forecast windows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before using complex models, compare against simple baselines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Seasonal naive&lt;/li&gt;
&lt;li&gt;Moving average&lt;/li&gt;
&lt;li&gt;Simple exponential smoothing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then test models such as &lt;code&gt;ARIMA&lt;/code&gt;, &lt;code&gt;Prophet&lt;/code&gt;, tree models with lagged variables, or sequence models if the problem calls for them.&lt;/p&gt;

&lt;p&gt;Metrics should match the operational decision. For demand forecasting, common choices include &lt;code&gt;WAPE&lt;/code&gt;, &lt;code&gt;sMAPE&lt;/code&gt;, pinball loss, or a service-level cost tied to stockouts and overstock.&lt;/p&gt;

&lt;h2&gt;
  
  
  Feature engineering without leakage
&lt;/h2&gt;

&lt;p&gt;Feature engineering should encode signal available at prediction time. That last phrase matters.&lt;/p&gt;

&lt;p&gt;Common tabular features include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lagged demand&lt;/li&gt;
&lt;li&gt;Rolling means&lt;/li&gt;
&lt;li&gt;Customer tenure&lt;/li&gt;
&lt;li&gt;Frequency counts&lt;/li&gt;
&lt;li&gt;Recency&lt;/li&gt;
&lt;li&gt;Price bands&lt;/li&gt;
&lt;li&gt;Target encodings for categoricals&lt;/li&gt;
&lt;li&gt;Missingness indicators&lt;/li&gt;
&lt;li&gt;Log-transformed monetary values&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The risk is leakage. If you compute a rolling average using data after the prediction timestamp, you have leaked future information. If you use target encoding without proper out-of-fold or time-aware computation, the model may learn the answer indirectly.&lt;/p&gt;

&lt;p&gt;For repeated entities, grouped splits may be needed. For time-dependent data, temporal holdouts are safer than random splits. Segment-level error checks can also reveal that a model works overall but fails for a product category, region, or customer group.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to answer this in an interview
&lt;/h2&gt;

&lt;p&gt;A strong structure is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clarify the target and decision use.&lt;/li&gt;
&lt;li&gt;Describe the data conditions: size, sparsity, label noise, missingness, class balance, time dependence.&lt;/li&gt;
&lt;li&gt;Pick baselines first.&lt;/li&gt;
&lt;li&gt;Compare model families conditionally.&lt;/li&gt;
&lt;li&gt;Choose metrics tied to business cost.&lt;/li&gt;
&lt;li&gt;Discuss calibration, thresholds, and validation design.&lt;/li&gt;
&lt;li&gt;Name leakage risks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;"I would start with regularized logistic regression as a baseline because it is interpretable and often well calibrated. I would compare Random Forests and Gradient Boosted Trees using a temporally held-out set if time matters. Since positives are rare, I would use &lt;code&gt;PR-AUC&lt;/code&gt;, recall at fixed precision, and expected cost rather than accuracy. If probabilities drive actions, I would check calibration and apply Platt scaling or isotonic regression if needed."&lt;/p&gt;

&lt;p&gt;That answer shows model knowledge, evaluation judgment, and production awareness.&lt;/p&gt;

&lt;p&gt;For more interview prompts around these topics, PracHub has a set of &lt;a href="https://prachub.com/interview-questions?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;technical interview practice questions&lt;/a&gt; you can use to test your reasoning under pressure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common mistakes to avoid
&lt;/h2&gt;

&lt;p&gt;Using accuracy by default.&lt;br&gt;&lt;br&gt;
Accuracy is often the wrong metric for imbalanced classification.&lt;/p&gt;

&lt;p&gt;Comparing models without conditions.&lt;br&gt;&lt;br&gt;
"XGBoost is better" is not enough. Better for what data, what metric, what latency limit, and what decision?&lt;/p&gt;

&lt;p&gt;Ignoring validation design.&lt;br&gt;&lt;br&gt;
Random splits can leak information in time-series and repeated-entity problems.&lt;/p&gt;

&lt;p&gt;Forgetting calibration.&lt;br&gt;&lt;br&gt;
A high-ranking model may still produce bad probabilities.&lt;/p&gt;

&lt;p&gt;Treating feature engineering as harmless.&lt;br&gt;&lt;br&gt;
Rolling features, target encodings, and aggregations can leak future or label information if computed incorrectly.&lt;/p&gt;

&lt;p&gt;If you want the original concept-card version with the compact interview framing, see PracHub's post on &lt;a href="https://prachub.com/concepts/supervised-ml-fundamentals-evaluation-and-feature-engineering?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;supervised ML fundamentals, evaluation, and feature engineering&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>career</category>
      <category>machinelearning</category>
      <category>programming</category>
    </item>
    <item>
      <title>Amazon Data Scientist Interview Cheatsheet 2026</title>
      <dc:creator>Feng Zhang</dc:creator>
      <pubDate>Wed, 08 Jul 2026 14:25:57 +0000</pubDate>
      <link>https://dev.to/feng_zhang_cedb4581bee881/amazon-data-scientist-interview-cheatsheet-2026-3e7m</link>
      <guid>https://dev.to/feng_zhang_cedb4581bee881/amazon-data-scientist-interview-cheatsheet-2026-3e7m</guid>
      <description>&lt;p&gt;Amazon Data Scientist interviews test whether you can turn messy data into a product decision you can defend. You need SQL or pandas fluency, experiment design, metric judgment, ML fundamentals, and clear communication when the prompt is underspecified.&lt;/p&gt;

&lt;p&gt;This post is a condensed, blog-friendly version of the &lt;a href="https://prachub.com/interview-prep/amazon-data-scientist-interview-prep?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;PracHub Amazon Data Scientist interview cheatsheet&lt;/a&gt;, focused on the parts that tend to separate candidates who have done real analysis from candidates who only know textbook definitions.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Amazon is usually testing
&lt;/h2&gt;

&lt;p&gt;The interview loop can cover several areas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data manipulation with SQL and Python&lt;/li&gt;
&lt;li&gt;Product analytics and root-cause analysis&lt;/li&gt;
&lt;li&gt;A/B testing and statistical inference&lt;/li&gt;
&lt;li&gt;Machine learning fundamentals and evaluation&lt;/li&gt;
&lt;li&gt;Applied ML system thinking, including RAG&lt;/li&gt;
&lt;li&gt;Behavioral answers mapped to Amazon Leadership Principles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The bar is not "can you recite a formula?" It is closer to: can you define the right metric, compute it correctly, explain your assumptions, catch validity problems, and recommend an action?&lt;/p&gt;

&lt;h2&gt;
  
  
  Python and pandas: show that your metrics are trustworthy
&lt;/h2&gt;

&lt;p&gt;For pandas questions, interviewers want analysis-grade data manipulation. Expect messy inputs, duplicate rows, mixed date formats, joins across tables, missing values, and business logic hidden in the prompt.&lt;/p&gt;

&lt;p&gt;Common pattern:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;groupby&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;agg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;revenue&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;revenue&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sum&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;order_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;nunique&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;customer_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;nunique&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That code is easy. The interview is about whether the aggregation is valid.&lt;/p&gt;

&lt;p&gt;Before grouping, ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is the row grain?&lt;/li&gt;
&lt;li&gt;Are there duplicate events or repeated order lines?&lt;/li&gt;
&lt;li&gt;Are timestamps in the same timezone?&lt;/li&gt;
&lt;li&gt;Are we joining many-to-one, one-to-many, or many-to-many?&lt;/li&gt;
&lt;li&gt;Do we need currency normalization before summing revenue?&lt;/li&gt;
&lt;li&gt;How should ties be handled in rankings?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A good answer sounds like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I would first validate the grain. If this table is order-line level, I should not count rows as orders. I would count distinct order IDs, normalize currency through the exchange-rate table, then aggregate by customer and month."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That shows you know metric code can be syntactically correct and still wrong.&lt;/p&gt;

&lt;p&gt;Useful pandas tools to have ready:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;pd.to_datetime()&lt;/code&gt; for date cleanup&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.dt.date&lt;/code&gt;, &lt;code&gt;.dt.to_period("M")&lt;/code&gt; for time buckets&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;merge()&lt;/code&gt; for lookup joins&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;drop_duplicates()&lt;/code&gt; for business-key dedupe&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rank()&lt;/code&gt;, &lt;code&gt;sort_values()&lt;/code&gt;, &lt;code&gt;cumcount()&lt;/code&gt; for within-group ranking&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;np.where()&lt;/code&gt;, &lt;code&gt;pd.cut()&lt;/code&gt;, boolean masks for segments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The biggest mistake is aggregating before fixing grain. Once duplicate rows flow into your metric table, every chart and model downstream inherits the error.&lt;/p&gt;

&lt;h2&gt;
  
  
  A/B testing: do not jump straight to p-values
&lt;/h2&gt;

&lt;p&gt;Amazon-style experimentation questions usually ask you to design or analyze an online controlled experiment. The interviewer is testing causal reasoning, metric design, statistical mechanics, and judgment.&lt;/p&gt;

&lt;p&gt;Start with clarification:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is the randomization unit: user, session, product, request?&lt;/li&gt;
&lt;li&gt;What is the primary metric?&lt;/li&gt;
&lt;li&gt;What are the guardrails?&lt;/li&gt;
&lt;li&gt;Is the assignment stable?&lt;/li&gt;
&lt;li&gt;Is the analysis window long enough for delayed outcomes?&lt;/li&gt;
&lt;li&gt;Are users counted once or multiple times?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a binary metric, such as conversion, you may compute:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Control rate: &lt;code&gt;x_c / n_c&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Treatment rate: &lt;code&gt;x_t / n_t&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Absolute lift: &lt;code&gt;p_t - p_c&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Relative lift: &lt;code&gt;(p_t - p_c) / p_c&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Confidence interval for the difference&lt;/li&gt;
&lt;li&gt;Two-proportion z-test, if sample size assumptions are reasonable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But a better interview answer does not stop there.&lt;/p&gt;

&lt;p&gt;Before inference, check validity:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sample ratio mismatch&lt;/li&gt;
&lt;li&gt;Exposure logging gaps&lt;/li&gt;
&lt;li&gt;Duplicate users&lt;/li&gt;
&lt;li&gt;Bot or internal traffic&lt;/li&gt;
&lt;li&gt;Pre-period balance&lt;/li&gt;
&lt;li&gt;Metric denominator consistency&lt;/li&gt;
&lt;li&gt;Unit mismatch between randomization and analysis&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A weak answer is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Treatment conversion is higher and p &amp;lt; 0.05, so launch."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A better answer is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I would first verify the planned traffic split and user-level assignment. Then I would estimate absolute and relative lift with a confidence interval. I would launch only if the lift is statistically and practically meaningful, guardrails such as latency and refund rate are neutral, and the result is stable across major pre-specified cohorts."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That last part matters. At Amazon scale, a tiny lift can be statistically significant. It still may not be worth shipping if it harms customer trust, latency, complaints, or downstream outcomes.&lt;/p&gt;

&lt;p&gt;For sample size questions, ask for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Baseline conversion rate&lt;/li&gt;
&lt;li&gt;Minimum detectable effect&lt;/li&gt;
&lt;li&gt;Alpha&lt;/li&gt;
&lt;li&gt;Desired power&lt;/li&gt;
&lt;li&gt;Number of variants&lt;/li&gt;
&lt;li&gt;Metric type: binary, continuous, ratio-based, clustered&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then define the decision rule before the data arrives. For example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Ship if the 95% confidence interval excludes zero, the lower bound is above the practical threshold, and guardrail metrics stay within agreed limits."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Product metrics and root-cause analysis: build the metric tree
&lt;/h2&gt;

&lt;p&gt;Product analytics questions often start with a vague movement:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Revenue dropped."&lt;/li&gt;
&lt;li&gt;"CTR is down."&lt;/li&gt;
&lt;li&gt;"Search conversion changed."&lt;/li&gt;
&lt;li&gt;"A dashboard metric spiked."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not start with random theories. Start by defining the metric and decomposing it.&lt;/p&gt;

&lt;p&gt;For revenue, a simple tree might be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Revenue = Traffic × Conversion Rate × Average Order Value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then break each branch down:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Traffic:
- visits
- unique customers
- channel mix
- device mix

Conversion:
- product views
- add-to-cart rate
- checkout start rate
- order completion rate

Average Order Value:
- item price
- units per order
- discounts
- shipping or fees
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Good root-cause analysis usually follows this flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Confirm the metric definition.&lt;/li&gt;
&lt;li&gt;Check data quality and pipeline changes.&lt;/li&gt;
&lt;li&gt;Compare time windows correctly.&lt;/li&gt;
&lt;li&gt;Segment by product, geography, device, customer type, traffic source, or cohort.&lt;/li&gt;
&lt;li&gt;Separate correlation from causal claims.&lt;/li&gt;
&lt;li&gt;Use visualizations that match the question.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Dashboard tooling can mislead if joins, filters, and aggregation grain are wrong. If a Tableau chart says revenue dropped, you still need to know whether it uses order date or shipment date, whether canceled orders are included, and whether currency conversion happened before or after aggregation.&lt;/p&gt;

&lt;h2&gt;
  
  
  RAG questions: treat it as an ML system, not "add a vector database"
&lt;/h2&gt;

&lt;p&gt;Retrieval-augmented generation is now fair game for Data Scientist interviews. The DS angle is less about serving infrastructure and more about evaluation, tradeoffs, and risk.&lt;/p&gt;

&lt;p&gt;A typical RAG pipeline has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Document selection&lt;/li&gt;
&lt;li&gt;Chunking&lt;/li&gt;
&lt;li&gt;Embeddings&lt;/li&gt;
&lt;li&gt;Vector retrieval&lt;/li&gt;
&lt;li&gt;Optional lexical retrieval such as BM25&lt;/li&gt;
&lt;li&gt;Reranking&lt;/li&gt;
&lt;li&gt;Prompt construction&lt;/li&gt;
&lt;li&gt;Generation&lt;/li&gt;
&lt;li&gt;Post-generation validation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If asked to design or evaluate a RAG system, frame the use case first:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What corpus are we answering from? How fresh is it? What is the cost of a wrong answer? Do we need citations? Are out-of-scope questions common?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then split evaluation into retrieval quality and answer quality.&lt;/p&gt;

&lt;p&gt;Retrieval metrics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Recall@k&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Precision@k&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;MRR&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;nDCG@k&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Answer metrics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Correctness&lt;/li&gt;
&lt;li&gt;Faithfulness to retrieved context&lt;/li&gt;
&lt;li&gt;Citation accuracy&lt;/li&gt;
&lt;li&gt;Coverage&lt;/li&gt;
&lt;li&gt;Refusal quality&lt;/li&gt;
&lt;li&gt;Helpfulness&lt;/li&gt;
&lt;li&gt;Latency and cost per query&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A key distinction: an answer can be true but unsupported by the retrieved context. For factual systems, that is still a failure.&lt;/p&gt;

&lt;p&gt;Know the RAG vs fine-tuning tradeoff:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use RAG when facts change often, citations matter, or the corpus is large.&lt;/li&gt;
&lt;li&gt;Use fine-tuning for tone, output format, intent classification, or consistent task behavior.&lt;/li&gt;
&lt;li&gt;A strong system may use RAG for grounding and fine-tuning for behavior.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Amazon-like catalogs, policies, seller docs, and support content, hybrid retrieval often makes sense. Dense retrieval handles semantic similarity. BM25 helps with exact product IDs, policy names, rare entities, and error codes. A reranker can improve the final passage list, though it adds latency and cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  Behavioral answers still matter
&lt;/h2&gt;

&lt;p&gt;For Amazon, technical strength is not enough. Prepare STAR stories tied to Leadership Principles. Your stories should be specific: what you owned, what tradeoff you made, what data you used, what changed because of your work.&lt;/p&gt;

&lt;p&gt;Avoid generic claims like "I am customer obsessed." Show the decision.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"We had a metric discrepancy between two dashboards. I traced it to different order-date logic, aligned the definition with finance, backfilled the metric table, and added validation checks so the issue would not recur."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That kind of story connects ownership, data quality, and business impact.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to practice
&lt;/h2&gt;

&lt;p&gt;Use timed practice. For each question, force yourself to produce:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clarifying questions&lt;/li&gt;
&lt;li&gt;Assumptions&lt;/li&gt;
&lt;li&gt;A clean solution path&lt;/li&gt;
&lt;li&gt;Edge cases&lt;/li&gt;
&lt;li&gt;A recommendation or decision rule&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find related prompts in the &lt;a href="https://prachub.com/interview-questions?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;PracHub interview question bank&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you want the full topic map, examples, and practice cards for this role, use the &lt;a href="https://prachub.com/interview-prep/amazon-data-scientist-interview-prep?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;Amazon Data Scientist interview cheatsheet on PracHub&lt;/a&gt; as your prep checklist.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>career</category>
      <category>amazon</category>
      <category>datascientist</category>
    </item>
    <item>
      <title>Product Metric Design And Diagnostic Deep Dives Explained — Tech Interview Concept (2026)</title>
      <dc:creator>Feng Zhang</dc:creator>
      <pubDate>Wed, 01 Jul 2026 14:25:38 +0000</pubDate>
      <link>https://dev.to/feng_zhang_cedb4581bee881/product-metric-design-and-diagnostic-deep-dives-explained-tech-interview-concept-2026-50p8</link>
      <guid>https://dev.to/feng_zhang_cedb4581bee881/product-metric-design-and-diagnostic-deep-dives-explained-tech-interview-concept-2026-50p8</guid>
      <description>&lt;p&gt;A product metric design interview is usually a test of judgment, not memorization. You get an ambiguous product or integrity problem, then you need to turn it into a measurement plan a real team could act on.&lt;/p&gt;

&lt;p&gt;The interviewer is checking whether you can keep these separate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What the product should optimize&lt;/li&gt;
&lt;li&gt;What the data can reliably observe&lt;/li&gt;
&lt;li&gt;What might be biased, gamed, or misleading&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This article adapts the main ideas from PracHub's guide to &lt;a href="https://prachub.com/concepts/product-metric-design-and-diagnostic-deep-dives?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;product metric design and diagnostic investigations&lt;/a&gt;, with a focus on how to structure your answer in a Data Scientist interview.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the product goal, not the metric
&lt;/h2&gt;

&lt;p&gt;A weak answer starts with a list:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DAU&lt;/li&gt;
&lt;li&gt;posts&lt;/li&gt;
&lt;li&gt;clicks&lt;/li&gt;
&lt;li&gt;retention&lt;/li&gt;
&lt;li&gt;reports&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That sounds busy, but it does not explain what success means.&lt;/p&gt;

&lt;p&gt;A stronger answer starts by clarifying how the product is supposed to work. For example, if the prompt is "Define success metrics for a Circles feature," you might say:&lt;/p&gt;

&lt;p&gt;"I will treat Circles as a community product meant to deepen meaningful interaction among smaller groups. Success should be sustained, high-quality engagement without safety issues or notification fatigue."&lt;/p&gt;

&lt;p&gt;That short framing does a lot of work. It tells the interviewer you will not blindly optimize raw activity. A feature can create more posts and still make the product worse if those posts are low quality, spammy, or annoying.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pick a north-star metric that maps to durable value
&lt;/h2&gt;

&lt;p&gt;A north-star metric should capture product value, not surface activity.&lt;/p&gt;

&lt;p&gt;For a community product like Circles, raw joins or raw posts are easy to inflate. Users may join once and never return. Creators may post low-effort content. Spam accounts may create noisy groups.&lt;/p&gt;

&lt;p&gt;A better primary metric could be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;weekly active circle members with meaningful two-sided interactions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then normalize it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;meaningful interactions / eligible circle members
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;meaningful interactions / eligible impressions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The denominator matters because each version answers a different question.&lt;/p&gt;

&lt;p&gt;Per-member metrics ask whether members are getting value. Per-impression metrics ask whether exposed content creates useful engagement. Per-session metrics ask whether Circles changes behavior during active use. Raw counts hide these differences.&lt;/p&gt;

&lt;p&gt;For a B2B chat product, the north-star metric might be qualified conversation starts, not total messages. A qualified conversation could require both parties to participate, or require that the conversation passes a basic quality threshold.&lt;/p&gt;

&lt;p&gt;Define the unit of value before you define the count.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build a metric tree
&lt;/h2&gt;

&lt;p&gt;A metric tree helps you avoid treating metric design as a bag of unrelated numbers.&lt;/p&gt;

&lt;p&gt;A useful structure is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Outcome metric&lt;/li&gt;
&lt;li&gt;Input metrics&lt;/li&gt;
&lt;li&gt;Diagnostic metrics&lt;/li&gt;
&lt;li&gt;Guardrails&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For B2B chat, that might look like:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Example metrics&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Outcome&lt;/td&gt;
&lt;td&gt;Qualified conversation starts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inputs&lt;/td&gt;
&lt;td&gt;Response rate, time-to-first-response&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Diagnostics&lt;/td&gt;
&lt;td&gt;Exposure rate, click-through rate, reply depth&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Guardrails&lt;/td&gt;
&lt;td&gt;Blocks, spam reports, opt-outs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This structure lets you explain why a metric moved.&lt;/p&gt;

&lt;p&gt;If qualified conversations dropped, maybe fewer users saw the entry point. Maybe users clicked but did not send messages. Maybe messages were sent, but businesses stopped responding. Each diagnosis points to a different product issue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use guardrails to block bad launches
&lt;/h2&gt;

&lt;p&gt;A positive primary metric does not mean the launch is safe.&lt;/p&gt;

&lt;p&gt;Guardrail metrics protect user experience, integrity, and ecosystem health. Common guardrails include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;hide rate&lt;/li&gt;
&lt;li&gt;report rate&lt;/li&gt;
&lt;li&gt;block rate&lt;/li&gt;
&lt;li&gt;unfollow rate&lt;/li&gt;
&lt;li&gt;session length&lt;/li&gt;
&lt;li&gt;notification opt-outs&lt;/li&gt;
&lt;li&gt;harmful-content prevalence&lt;/li&gt;
&lt;li&gt;advertiser complaints&lt;/li&gt;
&lt;li&gt;support contacts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Circles, guardrails might include mute rate, leave rate, reports, blocks, notification opt-outs, and displacement from broader feed engagement.&lt;/p&gt;

&lt;p&gt;That last one is easy to miss. A feature may increase activity inside Circles while reducing healthy engagement elsewhere. If the new product fragments the social graph or pushes spammy invites, the top-line metric may look good while the broader product gets worse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cohort before you trust the average
&lt;/h2&gt;

&lt;p&gt;Averages can hide the real story.&lt;/p&gt;

&lt;p&gt;Cut the results by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;new vs existing users&lt;/li&gt;
&lt;li&gt;market&lt;/li&gt;
&lt;li&gt;device class&lt;/li&gt;
&lt;li&gt;language&lt;/li&gt;
&lt;li&gt;creator size&lt;/li&gt;
&lt;li&gt;business type&lt;/li&gt;
&lt;li&gt;group size&lt;/li&gt;
&lt;li&gt;spam-risk tier&lt;/li&gt;
&lt;li&gt;prior engagement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In a Meta-style interview, you should ask whether gains are broad-based or concentrated in a small segment. For example, Circles may help highly connected users while doing little for new users. A B2B chat change may help large businesses but hurt smaller ones that cannot respond quickly.&lt;/p&gt;

&lt;p&gt;This is also where fairness and integrity concerns enter the answer. A harmful-content system that reduces measured prevalence overall may still perform poorly for a language group with weaker labels or lower reviewer coverage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Match attribution windows to the product mechanism
&lt;/h2&gt;

&lt;p&gt;The time window should match how value appears.&lt;/p&gt;

&lt;p&gt;A chat product may need same-day response metrics and 7-day retention. A community product may need 14-day or 28-day return behavior. Harmful-content outcomes may need delayed labels because review, appeals, and classifier updates take time.&lt;/p&gt;

&lt;p&gt;A window that is too short misses downstream value. A window that is too long adds noise and confounding.&lt;/p&gt;

&lt;p&gt;Say this explicitly in the interview. It shows that you understand measurement as a product decision, not just a query.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose the right randomization unit
&lt;/h2&gt;

&lt;p&gt;Experiment design starts with the unit of randomization.&lt;/p&gt;

&lt;p&gt;User-level randomization works when the experience is isolated. Networked products are harder. For communities, pages, advertisers, threads, or circles, users interact with each other. One user's treatment can affect another user's experience.&lt;/p&gt;

&lt;p&gt;That means you may need community-level, page-level, advertiser-level, or thread-level randomization.&lt;/p&gt;

&lt;p&gt;You should also define the estimand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;direct effect&lt;/li&gt;
&lt;li&gt;spillover effect&lt;/li&gt;
&lt;li&gt;total ecosystem effect&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, if some Circle members receive a new invite flow and others do not, their behavior may interact. A user-level A/B test may underestimate or distort the effect if treated and control users are in the same groups.&lt;/p&gt;

&lt;p&gt;If randomization is not possible, you can propose a retrospective cohort design with matching or difference-in-differences. Keep the caveat clear: observational methods need stronger assumptions about confounding.&lt;/p&gt;

&lt;h2&gt;
  
  
  Think about power, especially for rare events
&lt;/h2&gt;

&lt;p&gt;Rare events are hard to measure. Spam exposure, harmful-content reports, severe abuse, and appeals may have very low base rates.&lt;/p&gt;

&lt;p&gt;A rough minimum detectable effect relationship is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MDE ≈ (z_alpha/2 + z_beta) * sqrt(2 * sigma^2 / n)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The takeaway is that smaller effects, noisier metrics, and rare events need more data.&lt;/p&gt;

&lt;p&gt;For low base-rate outcomes, you can consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;aggregated exposure units&lt;/li&gt;
&lt;li&gt;longer test duration&lt;/li&gt;
&lt;li&gt;stratification&lt;/li&gt;
&lt;li&gt;higher-signal proxy labels&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not promise that a short test can detect rare harm reliably. That is exactly the kind of overconfidence interviewers watch for.&lt;/p&gt;

&lt;h2&gt;
  
  
  Treat proxy metrics with suspicion
&lt;/h2&gt;

&lt;p&gt;Proxy metrics are useful because they are often fast and available. They are also dangerous.&lt;/p&gt;

&lt;p&gt;For harmful content, user reports are visible and timely. But reports are biased by user awareness, culture, language, and reporting propensity. More reports could mean more harm, better reporting UX, higher user awareness, or more total usage.&lt;/p&gt;

&lt;p&gt;Reports are not ground truth.&lt;/p&gt;

&lt;p&gt;A stronger harmful-content evaluation combines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;user reports&lt;/li&gt;
&lt;li&gt;human review labels&lt;/li&gt;
&lt;li&gt;classifier scores&lt;/li&gt;
&lt;li&gt;prevalence estimates&lt;/li&gt;
&lt;li&gt;severity-weighted harm metrics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Severity matters. Counting all violations equally treats mild spam and severe abuse as the same kind of event.&lt;/p&gt;

&lt;p&gt;A better metric is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;severity-weighted prevalence =
sum(exposures_i * severity_i) / total eligible exposures
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The severity buckets should be transparent, and calibration checks should verify that labels are consistent enough to support decisions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use a diagnostic funnel for investigations
&lt;/h2&gt;

&lt;p&gt;When a metric moves, avoid guessing. Use a funnel:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;exposure -&amp;gt; action -&amp;gt; quality -&amp;gt; retention -&amp;gt; harm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a product metric drops, ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Did fewer users become eligible?&lt;/li&gt;
&lt;li&gt;Did fewer users see the surface?&lt;/li&gt;
&lt;li&gt;Did fewer users act after exposure?&lt;/li&gt;
&lt;li&gt;Did the quality of actions change?&lt;/li&gt;
&lt;li&gt;Did retention move?&lt;/li&gt;
&lt;li&gt;Did harm or negative feedback move?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This keeps the answer analytical. It also mirrors how real product teams debug launches.&lt;/p&gt;

&lt;p&gt;Before interpreting a movement, check measurement validity:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;logging coverage&lt;/li&gt;
&lt;li&gt;denominator definitions&lt;/li&gt;
&lt;li&gt;duplicate events&lt;/li&gt;
&lt;li&gt;bot or spam filtering&lt;/li&gt;
&lt;li&gt;experiment balance&lt;/li&gt;
&lt;li&gt;sample-ratio mismatch&lt;/li&gt;
&lt;li&gt;missing labels&lt;/li&gt;
&lt;li&gt;metric backfills&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You do not need to design the ingestion system in a product metric interview. You do need to know when the measurement is untrustworthy.&lt;/p&gt;

&lt;h2&gt;
  
  
  A compact answer pattern for interviews
&lt;/h2&gt;

&lt;p&gt;For a metric design prompt, use this flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clarify the product goal.&lt;/li&gt;
&lt;li&gt;State assumptions.&lt;/li&gt;
&lt;li&gt;Define the primary metric.&lt;/li&gt;
&lt;li&gt;Add supporting funnel metrics.&lt;/li&gt;
&lt;li&gt;Add guardrails.&lt;/li&gt;
&lt;li&gt;Discuss cohorts and denominators.&lt;/li&gt;
&lt;li&gt;Explain experiment design.&lt;/li&gt;
&lt;li&gt;Name likely diagnostics if the result moves.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For Circles, that might be:&lt;/p&gt;

&lt;p&gt;"Success is weekly active circle members with meaningful two-sided interactions, normalized by eligible members. I would support that with circle creation, invite acceptance, posting, comment depth, repeat participation, and 7-day or 28-day retention. Guardrails would include mutes, leaves, reports, blocks, notification opt-outs, and displacement from broader feed engagement. I would run an A/B test if possible, with user-level or circle-level assignment depending on spillovers. I would cut by new users, highly connected users, small markets, and baseline sharing behavior."&lt;/p&gt;

&lt;p&gt;That is a defensible answer because it ties metrics to the decision the team needs to make.&lt;/p&gt;

&lt;p&gt;If you want more prompts to practice this style, PracHub has a set of &lt;a href="https://prachub.com/interview-questions?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;data science and product interview questions&lt;/a&gt;. For the full concept breakdown, use the original PracHub guide on &lt;a href="https://prachub.com/concepts/product-metric-design-and-diagnostic-deep-dives?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;product metric design and diagnostic investigations&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>career</category>
      <category>analyticsexperimentation</category>
      <category>programming</category>
    </item>
    <item>
      <title>Amazon Machine Learning Engineer Interview Cheatsheet 2026</title>
      <dc:creator>Feng Zhang</dc:creator>
      <pubDate>Wed, 24 Jun 2026 14:26:21 +0000</pubDate>
      <link>https://dev.to/feng_zhang_cedb4581bee881/amazon-machine-learning-engineer-interview-cheatsheet-2026-2n5k</link>
      <guid>https://dev.to/feng_zhang_cedb4581bee881/amazon-machine-learning-engineer-interview-cheatsheet-2026-2n5k</guid>
      <description>&lt;p&gt;If you are preparing for an Amazon Machine Learning Engineer interview, expect more than "I know the model." You need to explain how the model works, how you would implement it, what breaks in production, and how you would decide whether it is good enough to ship.&lt;/p&gt;

&lt;p&gt;The longer &lt;a href="https://prachub.com/interview-prep/amazon-machine-learning-engineer-interview-prep?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;PracHub Amazon Machine Learning Engineer interview prep guide&lt;/a&gt; breaks this down by interview stage. This article condenses the highest-signal areas into a study guide you can use before a technical screen or onsite.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Amazon is likely testing
&lt;/h2&gt;

&lt;p&gt;For an MLE role, Amazon interviewers usually care about four things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can you reason from ML theory to working code?&lt;/li&gt;
&lt;li&gt;Can you design systems that train, evaluate, and serve models reliably?&lt;/li&gt;
&lt;li&gt;Can you debug models using metrics, data, and experiments?&lt;/li&gt;
&lt;li&gt;Can you explain tradeoffs around latency, cost, memory, and quality?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A good answer does not stop at "use a Transformer" or "train XGBoost." You should be able to talk through tensor shapes, masks, evaluation gaps, distributed training, sparse data, online metrics, and deployment risk.&lt;/p&gt;

&lt;h2&gt;
  
  
  Transformers: know the internals, not just the vocabulary
&lt;/h2&gt;

&lt;p&gt;Transformers are one of the highest-yield topics for an Amazon MLE interview. Be ready to explain scaled dot-product attention:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Attention(Q, K, V) = softmax((QK^T / sqrt(d_k)) + M)V
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;M&lt;/code&gt; is often an additive mask. Allowed positions get &lt;code&gt;0&lt;/code&gt;; blocked positions get &lt;code&gt;-inf&lt;/code&gt;. The &lt;code&gt;sqrt(d_k)&lt;/code&gt; scaling keeps attention logits from getting too large and saturating the softmax.&lt;/p&gt;

&lt;p&gt;For implementation questions, shape reasoning matters. Given input &lt;code&gt;X&lt;/code&gt; with shape &lt;code&gt;B x T x d_model&lt;/code&gt;, multi-head attention projects it into &lt;code&gt;Q&lt;/code&gt;, &lt;code&gt;K&lt;/code&gt;, and &lt;code&gt;V&lt;/code&gt;, then reshapes them into something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;B x num_heads x T x head_dim
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The attention score tensor then has shape:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;B x num_heads x T x T
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A common bug is reshaping after a transpose without handling non-contiguous tensors. In PyTorch, that means knowing when &lt;code&gt;.view()&lt;/code&gt; can break and when &lt;code&gt;.reshape()&lt;/code&gt; or &lt;code&gt;.contiguous()&lt;/code&gt; is safer.&lt;/p&gt;

&lt;p&gt;For decoder-only models, causal masking is mandatory. Token &lt;code&gt;t&lt;/code&gt; can only attend to positions &lt;code&gt;&amp;lt;= t&lt;/code&gt;. If you forget this, the model can leak future labels during training. The loss may look great, but generation will fail.&lt;/p&gt;

&lt;p&gt;You should also know the standard GPT-style block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = x + attention(LayerNorm(x))
x = x + MLP(LayerNorm(x))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This pre-norm layout is common because it helps gradient flow in deeper models. Post-norm matches the original Transformer pattern, but can be harder to train at scale.&lt;/p&gt;

&lt;p&gt;LayerNorm is another frequent follow-up. It normalizes across the hidden dimension for each token independently:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LN(x) = gamma * (x - mean) / sqrt(variance + epsilon) + beta
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unlike BatchNorm, LayerNorm does not depend on batch statistics. That helps with variable batch sizes, sequence models, and autoregressive inference.&lt;/p&gt;

&lt;h2&gt;
  
  
  LLMs: connect architecture to operations
&lt;/h2&gt;

&lt;p&gt;For LLM questions, you need to move between model internals and production behavior.&lt;/p&gt;

&lt;p&gt;A strong answer covers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Decoder-only Transformer architecture&lt;/li&gt;
&lt;li&gt;Tokenization with BPE, WordPiece, or SentencePiece&lt;/li&gt;
&lt;li&gt;Pretraining with next-token prediction&lt;/li&gt;
&lt;li&gt;Instruction tuning with prompt-response data&lt;/li&gt;
&lt;li&gt;Preference alignment methods such as RLHF or DPO&lt;/li&gt;
&lt;li&gt;Fine-tuning choices such as full fine-tuning, LoRA, QLoRA, prefix tuning, and prompt tuning&lt;/li&gt;
&lt;li&gt;Evaluation beyond perplexity&lt;/li&gt;
&lt;li&gt;Serving constraints such as KV cache memory, throughput, and p99 latency&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Perplexity is useful, but it is not enough. It measures next-token likelihood, not whether the model follows instructions, refuses unsafe requests correctly, produces grounded answers, or gives useful task outputs.&lt;/p&gt;

&lt;p&gt;For a validation-system design question, structure your answer around:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Evaluation data&lt;br&gt;&lt;br&gt;
Use golden prompts, task-specific benchmarks, adversarial sets, regression cases from past failures, and production-like prompts sampled in a privacy-safe way.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Metrics&lt;br&gt;&lt;br&gt;
Include exact match where it fits, rubric scores, human preference win rate, hallucination or groundedness for RAG, toxicity or safety rates, refusal correctness, latency &lt;code&gt;p50/p95/p99&lt;/code&gt;, tokens per second, and cost per request.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;System components&lt;br&gt;&lt;br&gt;
Mention a model registry, prompt/version registry, evaluation runner, deterministic inference harness, result store, dashboard, and deployment gates.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Online validation&lt;br&gt;&lt;br&gt;
Use shadow tests, canary rollout, alerts for regressions, drift checks, and rollback criteria.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the system is RAG-based, model quality depends on more than weights. Retrieval, chunking, embedding quality, ranking, prompt assembly, citation grounding, and index freshness all matter. Good evaluation should include retrieval recall@k, answer faithfulness, source attribution, and latency budget split across retrieval and generation.&lt;/p&gt;

&lt;h2&gt;
  
  
  MoE: sparse compute has systems costs
&lt;/h2&gt;

&lt;p&gt;Mixture-of-Experts models often replace dense MLP layers with multiple expert networks and a learned router. A token may be sent to the top-1 or top-2 experts.&lt;/p&gt;

&lt;p&gt;The benefit is that the model can have more total parameters without activating all of them for every token. The cost is systems complexity.&lt;/p&gt;

&lt;p&gt;In an interview, avoid saying "MoE is more efficient" without explaining the tradeoff. Good answers mention:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Load-balancing losses&lt;/li&gt;
&lt;li&gt;Expert collapse risk&lt;/li&gt;
&lt;li&gt;Capacity factors&lt;/li&gt;
&lt;li&gt;Token dropping during overload&lt;/li&gt;
&lt;li&gt;Distributed &lt;code&gt;all-to-all&lt;/code&gt; communication&lt;/li&gt;
&lt;li&gt;Harder batching because routing is data-dependent&lt;/li&gt;
&lt;li&gt;Higher risk around p99 latency&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Dense models are simpler to serve. MoE models can scale parameter count better relative to FLOPs, but routing and communication make training and serving harder.&lt;/p&gt;

&lt;h2&gt;
  
  
  XGBoost: understand why it is fast
&lt;/h2&gt;

&lt;p&gt;Amazon MLE interviews may still test classic ML, especially for tabular problems. XGBoost is a common topic because it mixes algorithm knowledge with systems thinking.&lt;/p&gt;

&lt;p&gt;Gradient boosting builds an additive model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;y_hat_i^(t) = y_hat_i^(t-1) + eta * f_t(x_i)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each new tree fits the residual signal, often framed as the negative gradient of the loss. This means boosting rounds are sequential. Tree &lt;code&gt;t&lt;/code&gt; depends on predictions from earlier trees.&lt;/p&gt;

&lt;p&gt;The parallelism is inside each tree:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;across candidate splits&lt;/li&gt;
&lt;li&gt;across features&lt;/li&gt;
&lt;li&gt;across data partitions&lt;/li&gt;
&lt;li&gt;across histogram bins&lt;/li&gt;
&lt;li&gt;across workers in distributed training&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;XGBoost uses second-order information. Split scoring uses gradients and Hessians, with regularization terms such as &lt;code&gt;lambda&lt;/code&gt; and &lt;code&gt;gamma&lt;/code&gt;. You do not need to derive every line from memory, but you should be able to explain that XGBoost uses both first and second derivatives to score split quality.&lt;/p&gt;

&lt;p&gt;For large datasets, exact split search can be expensive. Histogram-based split finding buckets continuous values into quantile bins, often far fewer than the number of raw thresholds. Workers build local histograms of gradient and Hessian sums, then reduce them. This gives better cache behavior and lower memory use, with some loss in split precision.&lt;/p&gt;

&lt;p&gt;Also know why sparse handling matters. XGBoost learns a default direction for missing values, which helps with sparse one-hot data and missing feature values.&lt;/p&gt;

&lt;h2&gt;
  
  
  PyTorch implementation questions: be concrete
&lt;/h2&gt;

&lt;p&gt;For "Implement a decoder-only GPT-style Transformer," start by clarifying scope:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Should I implement a minimal PyTorch module with embeddings, positional encoding, masked multi-head attention, MLP blocks, and logits, or should I include training and generation too?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then state assumptions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Input token IDs have shape &lt;code&gt;B x T&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Vocabulary size is &lt;code&gt;V&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Embedding dimension is &lt;code&gt;C&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Number of heads divides &lt;code&gt;C&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Output logits have shape &lt;code&gt;B x T x V&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Talk through token embeddings, positional embeddings or RoPE, stacked pre-norm blocks, causal masking, output projection, and loss.&lt;/p&gt;

&lt;p&gt;Call out edge cases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;T&lt;/code&gt; exceeds configured context length&lt;/li&gt;
&lt;li&gt;mask broadcasting is wrong&lt;/li&gt;
&lt;li&gt;train/eval dropout behavior differs&lt;/li&gt;
&lt;li&gt;causal mask is missing&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.view()&lt;/code&gt; is used on a non-contiguous tensor&lt;/li&gt;
&lt;li&gt;generation lacks a KV cache&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A good implementation answer includes unit tests for shape, causal leakage, and a tiny overfit test to verify the model can learn.&lt;/p&gt;

&lt;h2&gt;
  
  
  Behavioral answers still need metrics
&lt;/h2&gt;

&lt;p&gt;The source guide groups behavioral preparation under leadership principles, ownership, and measurable impact. For Amazon, that phrasing matters.&lt;/p&gt;

&lt;p&gt;Do not give vague stories like "I improved model performance." Give the situation, your decision, the tradeoff, the result, and the metric. For an MLE, strong stories often include model quality, latency, cost, reliability, data quality, rollback decisions, or experiment design.&lt;/p&gt;

&lt;p&gt;For example, a better answer sounds like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"We had a relevance regression after a feature pipeline change. I traced the issue to offline/online feature mismatch, added validation checks before promotion, and reduced bad launches in that area."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The exact numbers depend on your experience, but the structure should make your ownership clear.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final prep checklist
&lt;/h2&gt;

&lt;p&gt;Before the interview, make sure you can answer these without notes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Derive and explain scaled dot-product attention&lt;/li&gt;
&lt;li&gt;Trace Transformer tensor shapes through multi-head attention&lt;/li&gt;
&lt;li&gt;Explain causal masking and label leakage&lt;/li&gt;
&lt;li&gt;Compare LayerNorm and BatchNorm&lt;/li&gt;
&lt;li&gt;Discuss KV cache memory and autoregressive latency&lt;/li&gt;
&lt;li&gt;Explain why perplexity is not enough for LLM evaluation&lt;/li&gt;
&lt;li&gt;Design an LLM validation system with offline and online gates&lt;/li&gt;
&lt;li&gt;Explain MoE routing and serving tradeoffs&lt;/li&gt;
&lt;li&gt;Explain XGBoost histogram split finding and boosting-round dependency&lt;/li&gt;
&lt;li&gt;Write a minimal PyTorch Transformer block&lt;/li&gt;
&lt;li&gt;Tie every model choice to quality, latency, cost, or reliability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to drill with targeted prompts, the &lt;a href="https://prachub.com/interview-questions?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;PracHub interview questions library&lt;/a&gt; has practice questions across ML theory, system design, coding, and behavioral topics.&lt;/p&gt;

&lt;p&gt;For the full role-specific breakdown, use the &lt;a href="https://prachub.com/interview-prep/amazon-machine-learning-engineer-interview-prep?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;Amazon Machine Learning Engineer interview prep guide on PracHub&lt;/a&gt; as your main checklist.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>career</category>
      <category>amazon</category>
      <category>machinelearningengineer</category>
    </item>
    <item>
      <title>Notifications And Lifecycle Engagement Explained — Tech Interview Concept (2026)</title>
      <dc:creator>Feng Zhang</dc:creator>
      <pubDate>Wed, 17 Jun 2026 14:26:03 +0000</pubDate>
      <link>https://dev.to/feng_zhang_cedb4581bee881/notifications-and-lifecycle-engagement-explained-tech-interview-concept-2026-54bg</link>
      <guid>https://dev.to/feng_zhang_cedb4581bee881/notifications-and-lifecycle-engagement-explained-tech-interview-concept-2026-54bg</guid>
      <description>&lt;p&gt;Notifications are easy to measure badly.&lt;/p&gt;

&lt;p&gt;If a push campaign gets more clicks, did it create real engagement, or did it interrupt people who were already likely to open the app? If a ranking model lifts CTR, did it improve relevance, or did it learn to send curiosity bait? If dormant users come back today, do they stick around next month, or do they disable notifications?&lt;/p&gt;

&lt;p&gt;That is what interviewers are getting at when they ask about notification and lifecycle engagement metrics. The original PracHub concept post on &lt;a href="https://prachub.com/concepts/notifications-and-lifecycle-engagement?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;Notifications and Lifecycle Engagement&lt;/a&gt; covers the concept, but this article focuses on the answer pattern you can use in a data science or product analytics interview.&lt;/p&gt;

&lt;h2&gt;
  
  
  What interviewers are really testing
&lt;/h2&gt;

&lt;p&gt;A weak answer sounds like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I would track CTR, opens, DAU, and retention."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is a metric list, not an evaluation plan.&lt;/p&gt;

&lt;p&gt;A stronger answer explains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What product decision the metric supports&lt;/li&gt;
&lt;li&gt;What the primary outcome is&lt;/li&gt;
&lt;li&gt;Which metrics are drivers&lt;/li&gt;
&lt;li&gt;Which metrics are guardrails&lt;/li&gt;
&lt;li&gt;How the experiment estimates incremental impact&lt;/li&gt;
&lt;li&gt;How you handle fatigue, delayed outcomes, and selection bias&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a company like Meta, notifications can bring users back and help build habits. They can also annoy users, increase opt-outs, and reduce long-term trust. The interview is testing whether you can separate short-term movement from durable product value.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the product goal
&lt;/h2&gt;

&lt;p&gt;Before naming metrics, clarify the goal.&lt;/p&gt;

&lt;p&gt;A notification system may be trying to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reactivate dormant users&lt;/li&gt;
&lt;li&gt;Improve relevance of pushes&lt;/li&gt;
&lt;li&gt;Increase marketplace actions&lt;/li&gt;
&lt;li&gt;Reduce notification fatigue&lt;/li&gt;
&lt;li&gt;Test a new ranking or sending policy&lt;/li&gt;
&lt;li&gt;Personalize volume caps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The right metric depends on the goal. A reactivation system may care about &lt;code&gt;D7_retained_active_users&lt;/code&gt;. A marketplace notification may care about &lt;code&gt;listing_detail_views&lt;/code&gt;, &lt;code&gt;saves&lt;/code&gt;, or &lt;code&gt;seller_messages&lt;/code&gt;. A fatigue-reduction project may use &lt;code&gt;disable_push_rate&lt;/code&gt; or &lt;code&gt;mute_rate&lt;/code&gt; as the primary outcome.&lt;/p&gt;

&lt;p&gt;This step matters because it ties measurement to an actual product decision.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build a metric hierarchy
&lt;/h2&gt;

&lt;p&gt;For notification experiments, organize metrics into three layers.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Primary metric
&lt;/h3&gt;

&lt;p&gt;This is the metric you would use to make the launch decision.&lt;/p&gt;

&lt;p&gt;Good candidates include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;D7_retained_active_users&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;D28_retained_active_users&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Incremental &lt;code&gt;sessions_per_user&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;meaningful_sessions&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Downstream actions such as messages, purchases, comments, or listing views&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The primary metric should capture user or business value, not raw notification volume.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Driver metrics
&lt;/h3&gt;

&lt;p&gt;These explain why the primary metric moved.&lt;/p&gt;

&lt;p&gt;Common driver metrics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;notification_open_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;notification_click_through_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;session_starts_from_notification&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;notification-attributed_sessions&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;downstream_conversion&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;CTR is useful here, but it should rarely be the launch metric.&lt;/p&gt;

&lt;p&gt;The formula is simple:&lt;/p&gt;

&lt;p&gt;$$CTR = \frac{\text{notification clicks}}{\text{notifications delivered}}$$&lt;/p&gt;

&lt;p&gt;The problem is what CTR rewards. It can favor clickbait, curiosity, or over-targeting users who were already active. A notification that gets many clicks may still reduce retention if users feel spammed.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Guardrail metrics
&lt;/h3&gt;

&lt;p&gt;Guardrails protect user trust and long-term health.&lt;/p&gt;

&lt;p&gt;Use metrics such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;disable_push_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mute_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;uninstall_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hide_notification_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;negative_feedback_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;notifications_sent_per_user&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;complaints&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Quality metrics like &lt;code&gt;meaningful_interactions_per_session&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A treatment that lifts DAU but also raises push disables may be a bad trade.&lt;/p&gt;

&lt;h2&gt;
  
  
  Design the experiment around assignment, not clicks
&lt;/h2&gt;

&lt;p&gt;For most notification policies, randomize at the user level.&lt;/p&gt;

&lt;p&gt;Control users get the existing policy. Treatment users are eligible for the new notification policy, ranking model, or sending rule.&lt;/p&gt;

&lt;p&gt;The treatment should not be defined as "clicked a notification" or "received a notification." Those are post-treatment events. If you analyze only users who clicked, you introduce selection bias because the treatment itself affects who receives, sees, and clicks notifications.&lt;/p&gt;

&lt;p&gt;Use intent-to-treat analysis as the primary estimate:&lt;/p&gt;

&lt;p&gt;$$ITT = E[Y \mid Z=1] - E[Y \mid Z=0]$$&lt;/p&gt;

&lt;p&gt;Here, &lt;code&gt;Z&lt;/code&gt; is assignment to treatment.&lt;/p&gt;

&lt;p&gt;This estimates the effect of being assigned to the new policy. Some assigned users may never receive a notification during the experiment. That is fine. ITT matches the product decision: should we launch this policy to eligible users?&lt;/p&gt;

&lt;p&gt;You can report treatment-on-treated as a secondary diagnostic, but be careful. If exposure is affected by the treatment, exposed-user analysis can be misleading. If needed, use exposure rates or instrumental variables, with clear caveats.&lt;/p&gt;

&lt;h2&gt;
  
  
  Watch for interference
&lt;/h2&gt;

&lt;p&gt;User-level randomization works well for many notification systems, but social notifications can create spillovers.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Your friend commented"&lt;/li&gt;
&lt;li&gt;"Someone tagged you"&lt;/li&gt;
&lt;li&gt;"A creator you follow posted"&lt;/li&gt;
&lt;li&gt;Marketplace messages tied to listings&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One user's treatment can generate messages or activity that affects another user. That violates SUTVA, the assumption that one unit's treatment does not affect another unit's outcome.&lt;/p&gt;

&lt;p&gt;In those cases, consider cluster randomization. The cluster could be a conversation, household, creator-follower graph component, marketplace listing neighborhood, or another unit that captures likely spillovers.&lt;/p&gt;

&lt;p&gt;Cluster experiments need more sample size because observations inside a cluster are correlated. The design effect is:&lt;/p&gt;

&lt;p&gt;$$DE = 1 + (m-1)\rho$$&lt;/p&gt;

&lt;p&gt;Here, &lt;code&gt;m&lt;/code&gt; is cluster size and &lt;code&gt;rho&lt;/code&gt; is the intra-cluster correlation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Plan for small effects
&lt;/h2&gt;

&lt;p&gt;Retention and opt-out effects can be small, so power matters.&lt;/p&gt;

&lt;p&gt;For a two-sample comparison of means, a rough sample size formula is:&lt;/p&gt;

&lt;p&gt;$$n \approx \frac{2\sigma^2(z_{1-\alpha/2}+z_{1-\beta})^2}{\delta^2}$$&lt;/p&gt;

&lt;p&gt;Here, &lt;code&gt;delta&lt;/code&gt; is the minimum detectable effect. For binary metrics, use &lt;code&gt;p(1-p)&lt;/code&gt; as the variance.&lt;/p&gt;

&lt;p&gt;If you have strong pre-period behavior, use CUPED or regression adjustment to reduce variance. Good covariates include pre-experiment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sessions_per_user&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;notification_clicks&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;active_days&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The covariates must be measured before assignment. This improves sensitivity without changing the estimand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Segment by lifecycle stage
&lt;/h2&gt;

&lt;p&gt;Notification impact is rarely uniform.&lt;/p&gt;

&lt;p&gt;Analyze cohorts such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;New users&lt;/li&gt;
&lt;li&gt;Dormant users&lt;/li&gt;
&lt;li&gt;Power users&lt;/li&gt;
&lt;li&gt;Notification-heavy users&lt;/li&gt;
&lt;li&gt;Low-intent users&lt;/li&gt;
&lt;li&gt;Users with prior disables or mutes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A policy may help dormant users come back while annoying already-active users. A broad average can hide that pattern.&lt;/p&gt;

&lt;p&gt;This is especially relevant for lifecycle engagement. The same push can feel helpful to one user and spammy to another. Segment analysis can support personalization, caps, or targeted rollout instead of a full launch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measure beyond the first click
&lt;/h2&gt;

&lt;p&gt;Notifications often have delayed costs.&lt;/p&gt;

&lt;p&gt;Common patterns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CTR rises, but &lt;code&gt;disable_push_rate&lt;/code&gt; rises later&lt;/li&gt;
&lt;li&gt;DAU increases, but &lt;code&gt;D28_retention&lt;/code&gt; falls&lt;/li&gt;
&lt;li&gt;Sessions increase, but session quality drops&lt;/li&gt;
&lt;li&gt;Short-term reactivation fades after users habituate&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use a window that matches the product goal. If the goal is reactivation, D1 may be too short. D7 or D28 can show whether users came back again. For long-term fatigue, use longer experiments, staggered rollouts, or holdouts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Control multiple testing
&lt;/h2&gt;

&lt;p&gt;Notification systems have many surfaces, cohorts, and outcomes. If you slice enough, some result will look significant by chance.&lt;/p&gt;

&lt;p&gt;A clean answer says you would predefine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Primary metric&lt;/li&gt;
&lt;li&gt;Main guardrails&lt;/li&gt;
&lt;li&gt;Evaluation window&lt;/li&gt;
&lt;li&gt;High-risk cohorts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For many exploratory slices, use false discovery control such as Benjamini-Hochberg. For guardrails where false positives or false negatives are costly, Bonferroni correction may be more appropriate.&lt;/p&gt;

&lt;p&gt;If you want more practice with these interview-style pivots, PracHub has related &lt;a href="https://prachub.com/interview-questions?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;data science and product interview questions&lt;/a&gt; that cover experimentation, metrics, ranking, and causal inference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worked example: general notification policy
&lt;/h2&gt;

&lt;p&gt;Suppose the prompt is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Define metrics and design experiments for notifications."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A strong answer could sound like this:&lt;/p&gt;

&lt;p&gt;First, clarify the goal. Assume we are testing a new push notification ranking policy for a social app. The goal is to increase meaningful engagement and retention without increasing fatigue.&lt;/p&gt;

&lt;p&gt;Primary metric:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;D7_retained_active_users&lt;/code&gt; or incremental &lt;code&gt;sessions_per_user&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Driver metrics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;notification_open_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;notification-attributed_sessions&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;downstream_actions&lt;/code&gt;, such as comments, messages, or shares&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Guardrails:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;disable_push_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mute_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;uninstall_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;notifications_sent_per_user&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;negative_feedback_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;meaningful_interactions_per_session&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Experiment design:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Randomize eligible users into control and treatment&lt;/li&gt;
&lt;li&gt;Control keeps the current policy&lt;/li&gt;
&lt;li&gt;Treatment is eligible for the new ranking or sending policy&lt;/li&gt;
&lt;li&gt;Analyze by assignment using ITT&lt;/li&gt;
&lt;li&gt;Avoid conditioning on users who clicked or received a notification&lt;/li&gt;
&lt;li&gt;Use cluster randomization if social spillovers are strong&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Decision rule:&lt;/p&gt;

&lt;p&gt;Ship only if the primary metric improves and guardrails do not show statistically or practically meaningful harm. If the lift is concentrated in dormant users but guardrail harm appears among power users, consider personalization or volume caps instead of a full rollout.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worked example: similar-listing notifications
&lt;/h2&gt;

&lt;p&gt;Now suppose the prompt is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How would you evaluate a similar-listing notification feature?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The product goal is narrower. You want to know whether notifying users about similar marketplace listings helps them find relevant items without feeling spammed.&lt;/p&gt;

&lt;p&gt;Primary metrics could include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Incremental &lt;code&gt;listing_detail_views&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;saves&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;seller_messages&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Purchase-intent actions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Guardrails:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;notification_disable_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hide_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Lower engagement with future marketplace notifications&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Randomize eligible users who viewed or saved a listing. Do not randomize only people who receive the notification, because eligibility is part of the treatment.&lt;/p&gt;

&lt;p&gt;Use an evaluation window that includes delayed actions. A user may click today but message a seller two days later. Segment by intent strength too. Recent searchers may benefit, while casual browsers may find the same push irrelevant.&lt;/p&gt;

&lt;h2&gt;
  
  
  The common traps
&lt;/h2&gt;

&lt;p&gt;Avoid these mistakes in an interview:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Optimizing only for CTR&lt;/li&gt;
&lt;li&gt;Analyzing only users who opened the notification&lt;/li&gt;
&lt;li&gt;Listing metrics without a launch rule&lt;/li&gt;
&lt;li&gt;Ignoring opt-outs, mutes, and uninstalls&lt;/li&gt;
&lt;li&gt;Treating all lifecycle cohorts the same&lt;/li&gt;
&lt;li&gt;Missing network spillovers in social notifications&lt;/li&gt;
&lt;li&gt;Reading too much into short-term DAU lift&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A good interview answer is causal, decision-oriented, and honest about tradeoffs. You are not trying to prove notifications work. You are trying to estimate whether a specific policy creates incremental value without damaging retention or trust.&lt;/p&gt;

&lt;p&gt;For a more compact interview-prep version of this framework, use the PracHub write-up on &lt;a href="https://prachub.com/concepts/notifications-and-lifecycle-engagement?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;Notifications and Lifecycle Engagement&lt;/a&gt; as a reference before practicing mock answers.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>career</category>
      <category>programming</category>
      <category>tech</category>
    </item>
    <item>
      <title>Uber Data Scientist Interview Cheatsheet 2026</title>
      <dc:creator>Feng Zhang</dc:creator>
      <pubDate>Wed, 10 Jun 2026 14:25:36 +0000</pubDate>
      <link>https://dev.to/feng_zhang_cedb4581bee881/uber-data-scientist-interview-cheatsheet-2026-fal</link>
      <guid>https://dev.to/feng_zhang_cedb4581bee881/uber-data-scientist-interview-cheatsheet-2026-fal</guid>
      <description>&lt;p&gt;If you're preparing for an Uber Data Scientist interview, the hard part is not memorizing formulas. It is knowing how Uber frames data science problems: marketplace effects, experiment validity, ETA quality, and metric definitions that do not fall apart under edge cases.&lt;/p&gt;

&lt;p&gt;This post is a condensed rewrite of PracHub's &lt;a href="https://prachub.com/interview-prep/uber-data-scientist-interview-prep?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;Uber Data Scientist interview prep guide&lt;/a&gt;, focused on the themes that come up in technical screens and onsite rounds.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Uber is really testing
&lt;/h2&gt;

&lt;p&gt;Across SQL, product analytics, experimentation, and stats, interviewers want to see whether you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;define the metric correctly&lt;/li&gt;
&lt;li&gt;choose the right unit of analysis&lt;/li&gt;
&lt;li&gt;avoid leakage and bad denominators&lt;/li&gt;
&lt;li&gt;reason about interference in a two-sided marketplace&lt;/li&gt;
&lt;li&gt;separate model quality from business impact&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last one matters a lot. Lower prediction error does not automatically mean a better rider experience. A statistically significant A/B test result does not automatically mean "launch."&lt;/p&gt;

&lt;h2&gt;
  
  
  1) SQL: can you build defensible metrics from messy event data?
&lt;/h2&gt;

&lt;p&gt;Uber SQL questions often look simple at first. Then they turn into deduping events, picking the correct grain, and handling time windows without leaking future information.&lt;/p&gt;

&lt;p&gt;Topics that come up often:&lt;/p&gt;

&lt;h3&gt;
  
  
  Window functions you should be comfortable with
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Last or first event per entity&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use &lt;code&gt;ROW_NUMBER()&lt;/code&gt; with a deterministic sort:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;ROW_NUMBER&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="n"&gt;OVER&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;PARTITION&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;
  &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;event_ts&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event_id&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the standard pattern for "latest trip per rider" or "first exposure per user."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rolling metrics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For time-series summaries, know how to write rolling averages by partition:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;metric&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;OVER&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;PARTITION&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;
  &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;
  &lt;span class="k"&gt;ROWS&lt;/span&gt; &lt;span class="k"&gt;BETWEEN&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="k"&gt;PRECEDING&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="k"&gt;CURRENT&lt;/span&gt; &lt;span class="k"&gt;ROW&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Top-N logic&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You should know when to use &lt;code&gt;RANK&lt;/code&gt;, &lt;code&gt;DENSE_RANK&lt;/code&gt;, and &lt;code&gt;ROW_NUMBER&lt;/code&gt;, and be able to explain tie behavior clearly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cohort conversion and CTR&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A common failure mode is inflated CTR after joining impressions to clicks. If one impression maps to multiple clicks, &lt;code&gt;COUNT(*)&lt;/code&gt; breaks the metric. You need to define the denominator once, dedupe at the right grain, and use explicit attribution windows like &lt;code&gt;click_ts &amp;lt;= impression_ts + interval '48 hours'&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Date spine joins&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These matter for rolling averages and anomaly detection. Generate all dates first, then left join events, and fill missing counts with zero.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Timezone-aware aggregation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you analyze market-level data, local time matters. San Francisco metrics in January should not be cut on raw UTC day boundaries.&lt;/p&gt;

&lt;h3&gt;
  
  
  Common SQL mistakes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;counting rows after a one-to-many join&lt;/li&gt;
&lt;li&gt;using future rows in a rolling metric&lt;/li&gt;
&lt;li&gt;treating &lt;code&gt;RANK&lt;/code&gt; and &lt;code&gt;ROW_NUMBER&lt;/code&gt; as interchangeable&lt;/li&gt;
&lt;li&gt;skipping timezone conversion before &lt;code&gt;DATE_TRUNC&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want realistic drills for this style of question, PracHub has a set of &lt;a href="https://prachub.com/interview-questions?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;data science interview practice questions&lt;/a&gt; that match the patterns above.&lt;/p&gt;

&lt;h2&gt;
  
  
  2) ETA questions: accuracy is only part of the problem
&lt;/h2&gt;

&lt;p&gt;ETA is one of the clearest examples of how Uber expects product sense and statistical judgment to work together.&lt;/p&gt;

&lt;p&gt;An interviewer is not looking for "we reduced MAE, so the model is better." They want you to think through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what the ETA label is&lt;/li&gt;
&lt;li&gt;how to evaluate prediction quality&lt;/li&gt;
&lt;li&gt;whether the prediction is calibrated&lt;/li&gt;
&lt;li&gt;how uncertainty should be measured&lt;/li&gt;
&lt;li&gt;what user behavior changes after ETA changes&lt;/li&gt;
&lt;li&gt;how interference breaks naive A/B testing&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Start with label definition
&lt;/h3&gt;

&lt;p&gt;You need to ask what ETA means in the question.&lt;/p&gt;

&lt;p&gt;Is it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;request-to-pickup time?&lt;/li&gt;
&lt;li&gt;pickup-to-dropoff time?&lt;/li&gt;
&lt;li&gt;total trip duration?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The target has to match the user-facing promise. Cancellations, reassignment, batching, and no-shows all affect the label definition.&lt;/p&gt;

&lt;h3&gt;
  
  
  Know the evaluation metrics and what they miss
&lt;/h3&gt;

&lt;p&gt;Uber cares about more than one error metric:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;MAE&lt;/strong&gt; is easy to interpret in minutes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RMSE&lt;/strong&gt; penalizes large misses&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;median absolute error&lt;/strong&gt; is more stable with outliers like airports or events&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;bias&lt;/strong&gt; tells you whether the model is systematically optimistic or pessimistic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You should also say you would segment results by city, time of day, weather, airport, and trip type.&lt;/p&gt;

&lt;h3&gt;
  
  
  Calibration matters
&lt;/h3&gt;

&lt;p&gt;If the app says 5 minutes and riders usually wait 7, the model is underestimating. That can increase conversion in the short run and hurt trust later.&lt;/p&gt;

&lt;p&gt;Reliability curves by ETA bucket are often more useful than one aggregate accuracy score.&lt;/p&gt;

&lt;h3&gt;
  
  
  Uncertainty matters too
&lt;/h3&gt;

&lt;p&gt;For dispatch and UX decisions, intervals can matter as much as point estimates. A 90% prediction interval should contain the actual arrival time about 90% of the time. Coverage and interval width are both relevant.&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect ETA to business outcomes
&lt;/h3&gt;

&lt;p&gt;A good answer separates model metrics from business metrics.&lt;/p&gt;

&lt;p&gt;Examples of business outcomes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;request conversion&lt;/li&gt;
&lt;li&gt;cancellation rate&lt;/li&gt;
&lt;li&gt;completed trips&lt;/li&gt;
&lt;li&gt;pickup delay&lt;/li&gt;
&lt;li&gt;rider satisfaction&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Guardrails might include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;driver idle time&lt;/li&gt;
&lt;li&gt;acceptance rate&lt;/li&gt;
&lt;li&gt;surge exposure&lt;/li&gt;
&lt;li&gt;support contacts&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3) Uber experiments are often not standard A/B tests
&lt;/h2&gt;

&lt;p&gt;This is where many candidates get too generic.&lt;/p&gt;

&lt;p&gt;For consumer apps, user-level randomization is often fine. At Uber, treatment can affect shared supply. One rider's treatment can change another rider's outcome. That means &lt;code&gt;SUTVA&lt;/code&gt; may fail.&lt;/p&gt;

&lt;h3&gt;
  
  
  When interference matters
&lt;/h3&gt;

&lt;p&gt;If treatment changes dispatch, pricing, ETA display, or demand, untreated users may still be affected.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a rider-facing ETA change shifts demand in a neighborhood&lt;/li&gt;
&lt;li&gt;a driver incentive changes driver supply for everyone nearby&lt;/li&gt;
&lt;li&gt;a marketplace ranking change affects matching outcomes across groups&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you ignore that, your experiment readout may look precise and still be wrong.&lt;/p&gt;

&lt;h3&gt;
  
  
  Know when to propose switchback experiments
&lt;/h3&gt;

&lt;p&gt;For marketplace changes, Uber often needs geo-time randomization instead of user-level assignment.&lt;/p&gt;

&lt;p&gt;A strong answer for an ETA or dispatch experiment usually includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the estimand&lt;/li&gt;
&lt;li&gt;the randomization design&lt;/li&gt;
&lt;li&gt;primary metrics and guardrails&lt;/li&gt;
&lt;li&gt;the inference plan&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A reasonable design is a switchback experiment with city-zone-hour cells. You randomize treatment by market and time block, then analyze results with cluster-robust standard errors or a regression with time and geography fixed effects.&lt;/p&gt;

&lt;p&gt;Do not use naive row-level standard errors if the design is clustered.&lt;/p&gt;

&lt;h3&gt;
  
  
  Power is different under clustering
&lt;/h3&gt;

&lt;p&gt;For clustered experiments, you need to account for design effect:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;DEFF = 1 + (m - 1)rho&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;where &lt;code&gt;m&lt;/code&gt; is cluster size and &lt;code&gt;rho&lt;/code&gt; is intra-cluster correlation.&lt;/p&gt;

&lt;p&gt;That means more events inside the same cluster do not help as much as people expect. More independent clusters or time blocks usually matter more.&lt;/p&gt;

&lt;h2&gt;
  
  
  4) A/B testing answers need a decision framework
&lt;/h2&gt;

&lt;p&gt;A lot of candidates list metrics and stop there. Uber wants a launch recommendation, not a metrics dump.&lt;/p&gt;

&lt;p&gt;A solid structure is:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Define the objective
&lt;/h3&gt;

&lt;p&gt;Example: Does a promo targeting change increase completed trips or gross bookings at an acceptable promo cost and contribution margin?&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Pick the right randomization unit
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;rider_id&lt;/code&gt; for rider promos&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;driver_id&lt;/code&gt; for driver incentives&lt;/li&gt;
&lt;li&gt;geo or switchback for marketplace changes with spillovers&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Choose one primary metric
&lt;/h3&gt;

&lt;p&gt;Possible primary metrics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;completed trips per user&lt;/li&gt;
&lt;li&gt;conversion rate&lt;/li&gt;
&lt;li&gt;gross bookings&lt;/li&gt;
&lt;li&gt;variable contribution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then add a short list of guardrails:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cancellation rate&lt;/li&gt;
&lt;li&gt;ETA&lt;/li&gt;
&lt;li&gt;surge rate&lt;/li&gt;
&lt;li&gt;driver utilization&lt;/li&gt;
&lt;li&gt;support contact rate&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Check validity before interpretation
&lt;/h3&gt;

&lt;p&gt;You should mention:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sample ratio mismatch&lt;/li&gt;
&lt;li&gt;exposure correctness&lt;/li&gt;
&lt;li&gt;pre-treatment balance&lt;/li&gt;
&lt;li&gt;logging completeness&lt;/li&gt;
&lt;li&gt;novelty or day-of-week effects&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. Make the recommendation based on practical value
&lt;/h3&gt;

&lt;p&gt;Do not say "p &amp;lt; 0.05, ship it."&lt;/p&gt;

&lt;p&gt;A result can be statistically significant and still be a bad launch if contribution drops, promo spend gets out of control, or marketplace health gets worse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final prep advice
&lt;/h2&gt;

&lt;p&gt;If you're studying for this interview, spend less time on abstract ML talk and more time on clean definitions, marketplace-aware experiment design, and SQL execution details. That is where many answers get weak.&lt;/p&gt;

&lt;p&gt;The full &lt;a href="https://prachub.com/interview-prep/uber-data-scientist-interview-prep?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;Uber Data Scientist interview prep guide on PracHub&lt;/a&gt; goes deeper on ETA evaluation, A/B testing, SQL patterns, and practice prompts. If you want to pressure-test yourself, work through timed &lt;a href="https://prachub.com/interview-questions?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;practice questions here&lt;/a&gt; and say your answer out loud like you're already in the interview.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>career</category>
      <category>uber</category>
      <category>datascientist</category>
    </item>
    <item>
      <title>CTR And Engagement Metrics Explained — Tech Interview Concept (2026)</title>
      <dc:creator>Feng Zhang</dc:creator>
      <pubDate>Wed, 27 May 2026 14:24:49 +0000</pubDate>
      <link>https://dev.to/feng_zhang_cedb4581bee881/ctr-and-engagement-metrics-explained-tech-interview-concept-2026-9ad</link>
      <guid>https://dev.to/feng_zhang_cedb4581bee881/ctr-and-engagement-metrics-explained-tech-interview-concept-2026-9ad</guid>
      <description>&lt;p&gt;CTR questions look simple in interviews until you realize the interviewer is not asking for a formula. They want to know whether you can define exposure correctly, separate shallow clicks from useful engagement, and decide what to do when metrics move in opposite directions.&lt;/p&gt;

&lt;p&gt;This post is adapted from PracHub's original breakdown of &lt;a href="https://prachub.com/concepts/ctr-and-engagement-metrics?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;CTR and engagement metrics&lt;/a&gt;, but rewritten as a standalone guide for data science and product analytics interviews.&lt;/p&gt;

&lt;h2&gt;
  
  
  What interviewers are really testing
&lt;/h2&gt;

&lt;p&gt;On ranking-heavy products like a home feed, carousel, Shopping surface, fresh content module, or video feed, small product changes can move several metrics at once:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CTR goes up&lt;/li&gt;
&lt;li&gt;saves stay flat&lt;/li&gt;
&lt;li&gt;reports rise&lt;/li&gt;
&lt;li&gt;retention drops&lt;/li&gt;
&lt;li&gt;impressions per user jump because the UI exposes more content&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your job is to reason through that mess without jumping to the wrong conclusion.&lt;/p&gt;

&lt;p&gt;Interviewers want to hear that you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;define metrics precisely&lt;/li&gt;
&lt;li&gt;explain what changed causally, not just descriptively&lt;/li&gt;
&lt;li&gt;separate product impact from logging issues or mix shifts&lt;/li&gt;
&lt;li&gt;make a launch recommendation under uncertainty&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your answer stays at "CTR is clicks divided by impressions," it is too shallow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the metric definition
&lt;/h2&gt;

&lt;p&gt;Yes, CTR is usually:&lt;/p&gt;

&lt;p&gt;$$CTR = \frac{\text{clicks}}{\text{impressions}}$$&lt;/p&gt;

&lt;p&gt;But the grain matters a lot.&lt;/p&gt;

&lt;p&gt;You might be talking about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;item-level CTR&lt;/li&gt;
&lt;li&gt;user-level average CTR&lt;/li&gt;
&lt;li&gt;session-level CTR&lt;/li&gt;
&lt;li&gt;surface-level CTR&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are different metrics with different interpretations. In experiment analysis, user-level aggregation is often the safer choice because heavy users can otherwise dominate the estimate.&lt;/p&gt;

&lt;p&gt;That is one of the easiest points to miss in an interview. If the surface is personalized, the user is usually the right unit for inference.&lt;/p&gt;

&lt;h2&gt;
  
  
  CTR alone is not the goal
&lt;/h2&gt;

&lt;p&gt;A strong answer treats CTR as an intermediate metric, not the business objective.&lt;/p&gt;

&lt;p&gt;For Pinterest-style surfaces, engagement quality can include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;pin clicks&lt;/li&gt;
&lt;li&gt;saves&lt;/li&gt;
&lt;li&gt;closeups&lt;/li&gt;
&lt;li&gt;outbound clicks&lt;/li&gt;
&lt;li&gt;follows&lt;/li&gt;
&lt;li&gt;board adds&lt;/li&gt;
&lt;li&gt;video starts&lt;/li&gt;
&lt;li&gt;video completes&lt;/li&gt;
&lt;li&gt;Shopping product clicks&lt;/li&gt;
&lt;li&gt;return visits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A +3% CTR result does not mean the launch is good. If saves are flat and hide or report rates get worse, you may have made the feed more clickbaity rather than more useful.&lt;/p&gt;

&lt;p&gt;That is why you need a metric hierarchy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build a metric hierarchy before you interpret anything
&lt;/h2&gt;

&lt;p&gt;A clean interview answer usually has three layers:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Primary success metric
&lt;/h3&gt;

&lt;p&gt;Pick the metric closest to user value for that surface.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;saves per user&lt;/li&gt;
&lt;li&gt;engaged sessions per user&lt;/li&gt;
&lt;li&gt;shopping-engaged sessions&lt;/li&gt;
&lt;li&gt;product detail clicks per user&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Diagnostic metrics
&lt;/h3&gt;

&lt;p&gt;These tell you where movement came from.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;impressions per user&lt;/li&gt;
&lt;li&gt;module visibility&lt;/li&gt;
&lt;li&gt;viewport rate&lt;/li&gt;
&lt;li&gt;click position&lt;/li&gt;
&lt;li&gt;downstream save rate&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Guardrails
&lt;/h3&gt;

&lt;p&gt;These stop you from shipping a bad tradeoff.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;hides&lt;/li&gt;
&lt;li&gt;reports&lt;/li&gt;
&lt;li&gt;session exits&lt;/li&gt;
&lt;li&gt;latency perception&lt;/li&gt;
&lt;li&gt;creator or content diversity&lt;/li&gt;
&lt;li&gt;overall home feed engagement&lt;/li&gt;
&lt;li&gt;retention&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you list ten metrics without saying which one decides the launch, your answer will sound scattered.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exposure definition is where a lot of people fail
&lt;/h2&gt;

&lt;p&gt;In ranking systems, "impression" is often the hardest metric to define correctly.&lt;/p&gt;

&lt;p&gt;An impression should mean the user had a reasonable chance to see the item. It should not mean "the server ranked it."&lt;/p&gt;

&lt;p&gt;For a carousel, you should distinguish between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;module rendered&lt;/li&gt;
&lt;li&gt;module in viewport&lt;/li&gt;
&lt;li&gt;item impression&lt;/li&gt;
&lt;li&gt;click&lt;/li&gt;
&lt;li&gt;post-click engagement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That distinction matters because a ranking or UI change can alter the denominator mechanically. If more items count as impressions because users scroll farther or because the module renders differently, CTR can fall even if the product got better.&lt;/p&gt;

&lt;h2&gt;
  
  
  Watch for denominator effects
&lt;/h2&gt;

&lt;p&gt;This is one of the best points you can bring into an interview.&lt;/p&gt;

&lt;p&gt;Suppose a recommendation launch shows more content lower in the feed. You may get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;more impressions per user&lt;/li&gt;
&lt;li&gt;more clicks per user&lt;/li&gt;
&lt;li&gt;more saves per user&lt;/li&gt;
&lt;li&gt;lower raw CTR&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is not contradictory. The denominator grew faster than the numerator.&lt;/p&gt;

&lt;p&gt;So when CTR drops, do not stop there. Look at both rates and volumes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CTR&lt;/li&gt;
&lt;li&gt;clicks per user&lt;/li&gt;
&lt;li&gt;impressions per user&lt;/li&gt;
&lt;li&gt;saves per user&lt;/li&gt;
&lt;li&gt;save rate&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A strong candidate says, "I want to know whether user value fell, or whether the exposure mix changed."&lt;/p&gt;

&lt;h2&gt;
  
  
  How to talk about experiment design
&lt;/h2&gt;

&lt;p&gt;For personalized feeds, randomize at the user level.&lt;/p&gt;

&lt;p&gt;Why? Because recommendation exposure and engagement history are correlated across sessions. Item-level randomization can create an inconsistent user experience and can contaminate training signals.&lt;/p&gt;

&lt;p&gt;You should also mention experiment validity checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;randomization balance&lt;/li&gt;
&lt;li&gt;ramp timing&lt;/li&gt;
&lt;li&gt;sample ratio mismatch&lt;/li&gt;
&lt;li&gt;pre-period comparability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the assignment is broken, the metric read is not trustworthy.&lt;/p&gt;

&lt;p&gt;For surfaces with social or marketplace effects, spillovers can matter. In those cases, you may need to think beyond pure user-level analysis and discuss creator-level or geo-level effects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Match the stats method to the metric
&lt;/h2&gt;

&lt;p&gt;Interviewers like this because it separates people who know product metrics from people who know how to analyze them.&lt;/p&gt;

&lt;p&gt;Binary click outcomes can use proportion-style tests. But engagement per user is often:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;heavy-tailed&lt;/li&gt;
&lt;li&gt;zero-inflated&lt;/li&gt;
&lt;li&gt;noisy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Common approaches include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;user-level means with robust standard errors&lt;/li&gt;
&lt;li&gt;bootstrap&lt;/li&gt;
&lt;li&gt;winsorization sensitivity checks&lt;/li&gt;
&lt;li&gt;delta method for ratios&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One important warning: do not treat clicks and impressions as independent row-level observations when you analyze ratio metrics. That usually gives false confidence.&lt;/p&gt;

&lt;p&gt;You should also mention power and minimum detectable effect. Tiny CTR lifts can be statistically significant on high-traffic surfaces and still be too small to matter for the business.&lt;/p&gt;

&lt;p&gt;The sample size framing from the source is:&lt;/p&gt;

&lt;p&gt;$$n \approx \frac{2\sigma^2(z_{1-\alpha/2}+z_{1-\beta})^2}{\Delta^2}$$&lt;/p&gt;

&lt;p&gt;where $\Delta$ is the minimum detectable effect.&lt;/p&gt;

&lt;p&gt;The right follow-up is, "What effect size would change a launch decision?"&lt;/p&gt;

&lt;h2&gt;
  
  
  CUPED is worth bringing up
&lt;/h2&gt;

&lt;p&gt;If the interviewer asks how to improve experiment sensitivity, CUPED is a solid answer.&lt;/p&gt;

&lt;p&gt;The adjustment is:&lt;/p&gt;

&lt;p&gt;$$Y_{adj}=Y-\theta(X-\bar{X}),\quad \theta=\frac{Cov(Y,X)}{Var(X)}$$&lt;/p&gt;

&lt;p&gt;Use it when pre-period behavior predicts post-period behavior and treatment cannot affect that pre-period covariate. It is especially useful for noisy user-level metrics like saves per user or Shopping clicks.&lt;/p&gt;

&lt;p&gt;You do not need a long derivation. Just show that you know when it helps.&lt;/p&gt;

&lt;h2&gt;
  
  
  A good framework for "CTR dropped after a recommendation launch"
&lt;/h2&gt;

&lt;p&gt;This is the kind of case question you might get directly.&lt;/p&gt;

&lt;p&gt;A solid structure has four parts:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Validate the metric path
&lt;/h3&gt;

&lt;p&gt;Ask how impressions and clicks are defined.&lt;/p&gt;

&lt;p&gt;Check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ranked impression vs viewport impression&lt;/li&gt;
&lt;li&gt;deduping rules&lt;/li&gt;
&lt;li&gt;whether the new system changed logging or counting logic&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Validate the experiment
&lt;/h3&gt;

&lt;p&gt;Ask whether it was an A/B test or full rollout.&lt;/p&gt;

&lt;p&gt;Check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;randomization balance&lt;/li&gt;
&lt;li&gt;sample ratio mismatch&lt;/li&gt;
&lt;li&gt;pre-period similarity&lt;/li&gt;
&lt;li&gt;ramp timing&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Decompose the funnel
&lt;/h3&gt;

&lt;p&gt;Since:&lt;/p&gt;

&lt;p&gt;$$CTR = \frac{\text{clicks}}{\text{impressions}}$$&lt;/p&gt;

&lt;p&gt;ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Did clicks fall?&lt;/li&gt;
&lt;li&gt;Did impressions rise?&lt;/li&gt;
&lt;li&gt;Did position mix shift toward lower slots?&lt;/li&gt;
&lt;li&gt;Did visibility or viewport rates change?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Segment for diagnosis
&lt;/h3&gt;

&lt;p&gt;After checking the overall result, cut by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;new vs returning users&lt;/li&gt;
&lt;li&gt;heavy vs light users&lt;/li&gt;
&lt;li&gt;platform&lt;/li&gt;
&lt;li&gt;country&lt;/li&gt;
&lt;li&gt;content type&lt;/li&gt;
&lt;li&gt;fresh vs evergreen content&lt;/li&gt;
&lt;li&gt;video vs static&lt;/li&gt;
&lt;li&gt;shopping-intent users&lt;/li&gt;
&lt;li&gt;position or session intent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key judgment call is this: lower CTR may be acceptable if deeper value improves. If saves per user, long-clicks, Shopping conversions, or retention go up while low-quality clicks go down, "CTR dropped" is not enough reason to roll back.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Shopping version of this question
&lt;/h2&gt;

&lt;p&gt;For a Shopping launch, CTR is even less likely to be the final metric that matters.&lt;/p&gt;

&lt;p&gt;Primary metrics may shift toward:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;product detail clicks per user&lt;/li&gt;
&lt;li&gt;merchant outbound clicks&lt;/li&gt;
&lt;li&gt;add-to-cart proxies&lt;/li&gt;
&lt;li&gt;shopping-engaged sessions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And your guardrails still matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;overall home feed engagement&lt;/li&gt;
&lt;li&gt;user trust&lt;/li&gt;
&lt;li&gt;retention&lt;/li&gt;
&lt;li&gt;cannibalization of organic pin engagement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You should also mention heterogeneity. Users with shopping intent may benefit, while casual browsers may see irrelevant commerce content. That changes how you think about targeting and interpretation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common mistakes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Treating CTR as the business goal
&lt;/h3&gt;

&lt;p&gt;It is usually a diagnostic or intermediate metric.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ignoring exposure changes
&lt;/h3&gt;

&lt;p&gt;A CTR drop can come from more low-intent impressions, different positions, or a new UI module.&lt;/p&gt;

&lt;h3&gt;
  
  
  Listing metrics without a decision rule
&lt;/h3&gt;

&lt;p&gt;Say what is primary, what is a guardrail, and what tradeoff is acceptable.&lt;/p&gt;

&lt;p&gt;A much better interview line is:&lt;/p&gt;

&lt;p&gt;"Launch if saves per user or shopping-engaged sessions improve without meaningful degradation in retention, home feed engagement, or negative feedback."&lt;/p&gt;

&lt;h2&gt;
  
  
  Final takeaway
&lt;/h2&gt;

&lt;p&gt;If you get a CTR question in an interview, do not answer it like a spreadsheet exercise. Define exposure carefully. Use user-level reasoning. Check denominator effects. Separate shallow clicks from meaningful engagement. Then make a decision with guardrails, not with one ratio.&lt;/p&gt;

&lt;p&gt;If you want the original concept note, formulas, and interview framing, read the full PracHub post on &lt;a href="https://prachub.com/concepts/ctr-and-engagement-metrics?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;CTR and engagement metrics&lt;/a&gt;. If you want more practice in this style, PracHub also has a set of &lt;a href="https://prachub.com/interview-questions?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;interview questions&lt;/a&gt; on metrics, experimentation, and product data science.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>career</category>
      <category>analyticsexperimentation</category>
      <category>programming</category>
    </item>
    <item>
      <title>Meta Data Scientist Interview Cheatsheet 2026</title>
      <dc:creator>Feng Zhang</dc:creator>
      <pubDate>Sun, 24 May 2026 04:01:10 +0000</pubDate>
      <link>https://dev.to/feng_zhang_cedb4581bee881/meta-data-scientist-interview-cheatsheet-2026-i2d</link>
      <guid>https://dev.to/feng_zhang_cedb4581bee881/meta-data-scientist-interview-cheatsheet-2026-i2d</guid>
      <description>&lt;p&gt;If you're preparing for Meta data scientist interviews, one pattern shows up fast: the bar is not "can you compute a metric?" It is "can you define the right metric, design a clean experiment, and explain tradeoffs like an owner?"&lt;/p&gt;

&lt;p&gt;This article pulls together the most interview-relevant parts of PracHub's &lt;a href="https://prachub.com/interview-prep/meta-data-scientist-interview-prep?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;Meta Data Scientist interview prep guide&lt;/a&gt;, with a focus on areas candidates often get pressed on: notification analytics, A/B testing, cluster randomization, and SQL event logs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Meta interviewers are usually testing
&lt;/h2&gt;

&lt;p&gt;Across technical screens and onsites, the questions often sound broad:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"How would you evaluate similar-listing notifications?"&lt;/li&gt;
&lt;li&gt;"Design an experiment for a new ads ranking model"&lt;/li&gt;
&lt;li&gt;"Write SQL to compute engagement or call metrics"&lt;/li&gt;
&lt;li&gt;"What would you do if there is interference between users?"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The underlying skill is the same. You need to move from raw events or product ideas to a decision-ready analysis. That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;defining eligibility&lt;/li&gt;
&lt;li&gt;choosing a randomization unit&lt;/li&gt;
&lt;li&gt;picking a primary metric&lt;/li&gt;
&lt;li&gt;adding guardrails&lt;/li&gt;
&lt;li&gt;checking whether the observed impact is actually incremental&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your answer stays at the dashboard level, it will usually feel weak.&lt;/p&gt;




&lt;h2&gt;
  
  
  Notification analytics is a causal question, not a CTR question
&lt;/h2&gt;

&lt;p&gt;A common interview prompt is some variation of push notifications or similar-listing alerts. The mistake many candidates make is optimizing for click-through rate.&lt;/p&gt;

&lt;p&gt;That is too shallow.&lt;/p&gt;

&lt;p&gt;For notification products, Meta cares about whether the notification creates net value or just interrupts people enough to get clicks. A strong answer breaks the system into a funnel:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;eligibility&lt;/li&gt;
&lt;li&gt;send&lt;/li&gt;
&lt;li&gt;delivery&lt;/li&gt;
&lt;li&gt;impression or open&lt;/li&gt;
&lt;li&gt;click&lt;/li&gt;
&lt;li&gt;landing-page engagement&lt;/li&gt;
&lt;li&gt;downstream action&lt;/li&gt;
&lt;li&gt;longer-term retention&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a marketplace notification, downstream actions matter more than raw clicks. Examples from the source include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;listing_view&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;save&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;seller_message&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;offer_sent&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;purchase_intent&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;transaction_proxy&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the product goal is better buyer discovery, then a better primary metric than &lt;code&gt;notification_click_rate&lt;/code&gt; might be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;incremental &lt;code&gt;qualified_listing_views_per_user&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;buyer_seller_message_threads_per_eligible_user&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That framing shows you understand the product mechanism.&lt;/p&gt;

&lt;h3&gt;
  
  
  Guardrails matter more for notifications than people think
&lt;/h3&gt;

&lt;p&gt;Notifications impose an attention cost. Your answer should include guardrails such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;push_opt_out_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;notification_disable_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;app_uninstall_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hide_report_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;negative_feedback_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;session_depth&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;7d_retention&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;total notification volume per user&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you ignore fatigue, your experiment design looks incomplete.&lt;/p&gt;

&lt;h3&gt;
  
  
  Be precise about eligibility and exposure
&lt;/h3&gt;

&lt;p&gt;Another common failure mode is saying, "compare users who got notifications with users who didn't."&lt;/p&gt;

&lt;p&gt;That comparison is biased. Users who receive notifications are often already more active, have permissions enabled, or have more relevant inventory available.&lt;/p&gt;

&lt;p&gt;A better answer starts with a fixed eligible population, for example users who:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;viewed or saved a marketplace item in the last 7 days&lt;/li&gt;
&lt;li&gt;have push permissions enabled&lt;/li&gt;
&lt;li&gt;have at least one similar listing available&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then analyze intent-to-treat on randomized eligible users. You can inspect treatment-on-treated later, but only with the right causal caveats.&lt;/p&gt;

&lt;h3&gt;
  
  
  Watch for cannibalization and spillovers
&lt;/h3&gt;

&lt;p&gt;A similar-listing notification can shift behavior from search, organic feed, saved items, or other notification channels rather than create new demand. So you should measure total marketplace engagement, not only attributed notification clicks.&lt;/p&gt;

&lt;p&gt;If the product has social, household, or marketplace spillovers, say that directly. That is often when an interviewer pushes into cluster randomization.&lt;/p&gt;




&lt;h2&gt;
  
  
  A/B testing answers need an estimand, not just a p-value
&lt;/h2&gt;

&lt;p&gt;Meta interviewers want to hear that you can design an experiment before data exists, not just analyze one afterward.&lt;/p&gt;

&lt;p&gt;Start with the decision and the causal quantity. In plain terms: what launch decision does this test inform, and for whom?&lt;/p&gt;

&lt;p&gt;For many interview prompts, your structure can be:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Define the product change and eligible population
&lt;/li&gt;
&lt;li&gt;Choose a randomization unit
&lt;/li&gt;
&lt;li&gt;Name the primary metric
&lt;/li&gt;
&lt;li&gt;Add guardrails
&lt;/li&gt;
&lt;li&gt;Discuss power, variance, and diagnostics
&lt;/li&gt;
&lt;li&gt;Explain how you'd interpret null or mixed results&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Choose the randomization unit based on interference risk
&lt;/h3&gt;

&lt;p&gt;User-level randomization is often fine for isolated product changes. It is not automatically correct.&lt;/p&gt;

&lt;p&gt;If one user's treatment can affect another user's outcome, then SUTVA may fail. In Meta-style products, that comes up in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;social feeds&lt;/li&gt;
&lt;li&gt;messaging&lt;/li&gt;
&lt;li&gt;ads auctions&lt;/li&gt;
&lt;li&gt;marketplaces&lt;/li&gt;
&lt;li&gt;creator ecosystems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In those cases, you may need cluster, geo, advertiser, page, or marketplace-level randomization.&lt;/p&gt;

&lt;p&gt;If you say, "I'd use user-level randomization if interference is low, otherwise I'd consider cluster or geo designs," that is already much stronger than forcing every problem into a 50/50 user RCT.&lt;/p&gt;

&lt;h3&gt;
  
  
  Power should be discussed at the right level
&lt;/h3&gt;

&lt;p&gt;For repeated notifications or clustered experiments, observations are correlated. You should talk about power at the user or cluster level, not at the event level.&lt;/p&gt;

&lt;p&gt;The source also calls out the design effect for clustered experiments:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;DE = 1 + (m - 1)rho&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;where &lt;code&gt;m&lt;/code&gt; is average cluster size and &lt;code&gt;rho&lt;/code&gt; is intracluster correlation.&lt;/p&gt;

&lt;p&gt;That matters because a huge row count can still translate into a much smaller effective sample size.&lt;/p&gt;

&lt;h3&gt;
  
  
  CUPED is worth mentioning if the prompt invites depth
&lt;/h3&gt;

&lt;p&gt;For noisy product metrics, pre-experiment covariates can reduce variance. The source mentions CUPED, which adjusts outcomes using pre-period behavior. You do not need to derive it in every answer, but mentioning it in a Meta interview often signals practical experiment experience.&lt;/p&gt;

&lt;p&gt;Use it when the pre-period metric strongly predicts the post-period metric, such as engagement, spend, or retention.&lt;/p&gt;




&lt;h2&gt;
  
  
  How to answer a "similar-listing notifications" question
&lt;/h2&gt;

&lt;p&gt;A solid answer could sound like this:&lt;/p&gt;

&lt;p&gt;First, clarify the product goal. Are you trying to increase discovery, transactions, or re-engagement among users with shopping intent?&lt;/p&gt;

&lt;p&gt;Next, define the eligible population: users who recently viewed or saved an item, have push permissions on, and have relevant similar inventory available.&lt;/p&gt;

&lt;p&gt;Then propose user-level randomization if interference is limited. Treatment users receive similar-listing pushes, control users stay on the current notification policy.&lt;/p&gt;

&lt;p&gt;Pick a primary metric tied to downstream value, like incremental &lt;code&gt;qualified_listing_views_per_eligible_user&lt;/code&gt; or &lt;code&gt;buyer_seller_message_threads_per_user&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Use secondary metrics like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;notification_open_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;save_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;return_sessions&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Add guardrails:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;push_opt_out_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;notification_settings_disable_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hide_report_rate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;notifications received per user&lt;/li&gt;
&lt;li&gt;&lt;code&gt;7d_retention&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then say you'd analyze ITT first, check whether gains are incremental versus cannibalized from existing surfaces, and look at heterogeneous effects by intent, notification sensitivity, and inventory density.&lt;/p&gt;

&lt;p&gt;That answer is much closer to what interviewers want than "I'd compare CTR between treatment and control."&lt;/p&gt;




&lt;h2&gt;
  
  
  SQL event log questions are mostly about grain and joins
&lt;/h2&gt;

&lt;p&gt;The SQL side of the interview is less about syntax tricks and more about getting metric definitions right.&lt;/p&gt;

&lt;p&gt;The source's advice is simple and useful:&lt;/p&gt;

&lt;h3&gt;
  
  
  1) Decide the grain first
&lt;/h3&gt;

&lt;p&gt;Know what one row means before you write code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;user-day&lt;/li&gt;
&lt;li&gt;call-day&lt;/li&gt;
&lt;li&gt;impression-day&lt;/li&gt;
&lt;li&gt;country-day&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A lot of mistakes come from skipping this step.&lt;/p&gt;

&lt;h3&gt;
  
  
  2) Be careful with time windows
&lt;/h3&gt;

&lt;p&gt;Use bounded windows like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;event_ts &amp;gt;= start&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;event_ts &amp;lt; end&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That avoids double counting midnight events.&lt;/p&gt;

&lt;h3&gt;
  
  
  3) Aggregate before joining when needed
&lt;/h3&gt;

&lt;p&gt;Joining raw event tables too early can multiply rows and inflate clicks, responses, revenue, or duration.&lt;/p&gt;

&lt;h3&gt;
  
  
  4) Protect ratio calculations
&lt;/h3&gt;

&lt;p&gt;Use safe denominators and be explicit about what happens when the denominator is zero.&lt;/p&gt;

&lt;h3&gt;
  
  
  5) Clarify deduplication rules
&lt;/h3&gt;

&lt;p&gt;If the metric requires one valid event per entity or one response per user, say how you would dedupe, often with &lt;code&gt;ROW_NUMBER()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;These are basic ideas, but they come up constantly in product analytics interviews.&lt;/p&gt;




&lt;h2&gt;
  
  
  What candidates most often miss
&lt;/h2&gt;

&lt;p&gt;From the source, the recurring weak spots are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;optimizing for &lt;code&gt;CTR&lt;/code&gt; alone&lt;/li&gt;
&lt;li&gt;being vague about eligibility or exposure&lt;/li&gt;
&lt;li&gt;ignoring interference and repeated treatment&lt;/li&gt;
&lt;li&gt;assuming every experiment should be user-level 50/50&lt;/li&gt;
&lt;li&gt;treating a null result as proof of no effect&lt;/li&gt;
&lt;li&gt;skipping diagnostics like sample ratio mismatch, logging sanity, or pre-period balance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you avoid those, your answers already sound more senior.&lt;/p&gt;




&lt;h2&gt;
  
  
  A better way to use a cheatsheet
&lt;/h2&gt;

&lt;p&gt;Don't memorize lines. Practice turning these patterns into spoken answers.&lt;/p&gt;

&lt;p&gt;Take a prompt like notifications, ads ranking, or call metrics, and force yourself to answer in this order:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;goal&lt;/li&gt;
&lt;li&gt;population&lt;/li&gt;
&lt;li&gt;unit of randomization&lt;/li&gt;
&lt;li&gt;primary metric&lt;/li&gt;
&lt;li&gt;guardrails&lt;/li&gt;
&lt;li&gt;power and inference risks&lt;/li&gt;
&lt;li&gt;interpretation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want more realistic drills, PracHub also has &lt;a href="https://prachub.com/interview-questions?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;interview practice questions here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And if you're preparing specifically for Meta, the full &lt;a href="https://prachub.com/interview-prep/meta-data-scientist-interview-prep?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=backlinks" rel="noopener noreferrer"&gt;Meta Data Scientist interview prep guide on PracHub&lt;/a&gt; is the better reference because it keeps these topics in one place and ties them to actual interview-style prompts.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>career</category>
      <category>meta</category>
      <category>datascientist</category>
    </item>
  </channel>
</rss>
