Find Lots With Yield Drops Against Their Tool Baseline in SQL

Last updated: November 29, 2026

Quick Overview

Given a wafer_sort table with lot_id, wafer_id, tool_id, sort_date, die_total and die_pass, compute die yield per lot and return lots whose yield is more than 5 percentage points below the average of the previous 10 lots processed on the same tool, requiring at least 3 prior lots.

Intel
Data Manipulation (SQL/Python)
Data Engineer
Intel
November 29, 2026
Data Engineer
Technical Screen
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


Given a wafer_sort table with lot_id, wafer_id, tool_id, sort_date, die_total and die_pass, compute die yield per lot and return lots whose yield is more than 5 percentage points below the average of the previous 10 lots processed on the same tool, requiring at least 3 prior lots.

Intel's manufacturing data teams monitor sort yield by lot and by process tool to catch excursions quickly. The interviewer checks correct die-weighted yield, window frames that exclude the current row, and guarding against thin baselines.

What the Interviewer Expects
  • Computes yield as total passing dies over total dies, not an average of wafer yields
  • Uses a window partitioned by tool with ROWS BETWEEN 10 PRECEDING AND 1 PRECEDING
  • Requires a minimum baseline count
  • Orders deterministically when dates tie
  • Explains how to validate the output against a known excursion
Key Topics to Cover
Window functions
Aggregation
Yield analysis
Moving averages
SQL
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you instead flag lots outside 3 standard deviations of the tool baseline?
  • A lot runs on several tools at different steps. How would you attribute the drop?
  • How would you make this incremental for a streaming pipeline?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

One row per wafer. A lot is processed on one sort tool for this question. Yield should weight by dies, so a lot with one bad wafer of many is not exaggerated. Rows with die_total = 0 (scrapped or un...

Approach

Aggregate to one row per lot, then use window functions over lots of the same tool to compute the trailing average of the previous ten lots and a count of how many were available. Filter on the drop a...


Submit Your Answer
Markdown supported

Related Questions