
Real Interview Questions for the Data Engineer at Shopify
NewPractice MCQs
Answers count toward the Data Engineer and overall leaderboards; your latest answer to each question is the one that counts.
MCQ-1A `deposits` table ordered by `deposit_date` has rows for Jan 1, Jan 2, Jan 4 and Jan 5, with no row for Jan 3. An analyst needs Jan 4's average over the calendar days Jan 2 to Jan 4. Which window frame gives that three-day rolling average?
Answer to see the discussion.
MCQ-2A nightly SQL pipeline merges 40 million orders into date-partitioned tables, with staging validation already blocking duplicate keys before publish. Late refunds arrive up to three days after the order date, and partitions older than three days are sealed in cold storage and cannot be rewritten. Which lookback window should the incremental merge use?
Answer to see the discussion.
MCQ-3A Shopify order has multiple line items, each for a different variant and quantity. Each parcel contains exactly one line item, and a return references the line item in one parcel. Which data model preserves these relationships without duplication?
Answer to see the discussion.
MCQ-4A `daily_activity` table has counts for `2026-01-01`, `2026-01-03` and `2026-01-05`, with no rows for Jan 2 or Jan 4. Finance feeds the Jan 1 to Jan 5 series into a reconciliation that totals activity, averages it per calendar day, and lists days where the count equals zero. Which series satisfies that reconciliation?
Answer to see the discussion.
MCQ-5An `orders` table holds `customer_id`, `order_id`, `order_date` and `amount`, with one customer having several earlier orders and two orders sharing the same `order_date`. A query must return each order once with the immediately preceding order's amount for that customer. Which approach gives that result without duplication?
Answer to see the discussion.
MCQ-6A nightly Shopify orders ETL is packaged as a Docker image and run as a Kubernetes Job that writes directly to the production warehouse table. When a pod is evicted mid-load, the Job retries and downstream revenue is double-counted. Which change prevents duplicates on retry?
Answer to see the discussion.
MCQ-7A streaming job ingests `payment_events` at 40,000 events/sec for 10,000 accounts and must apply updates for each account in event order. The team runs 32 consumers and requires exactly one partition per consumer for simpler rebalancing. Which partitioning setup meets both ordering and parallelism?
Answer to see the discussion.
MCQ-8A Shopify dashboard shows daily revenue by store for the last 90 days, filtering on `sale_date` and `store_id` and summing `amount`. It reads 50 million order-line rows per day and takes 8 seconds, while analysts still need order-line detail for ad-hoc queries. Which model best optimizes the dashboard without removing that detail?
Answer to see the discussion.
MCQ-9A daily Airflow DAG loads orders for its logical date into a warehouse table, but a task can be retried after a partial load and a manual rerun can repeat the same date. Cancelled orders may be removed from the source between runs, and a rerun must reflect those removals without manual cleanup. Which task design makes the load idempotent?
Answer to see the discussion.
MCQ-10A `daily_sessions` table holds one row per shop per day, but shop 42 is missing Jan 3 and Jan 6. For Jan 9 the analyst needs the average of daily sessions across the current day and the six preceding calendar days. Which explicit frame gives that window?
Answer to see the discussion.
MCQ-11A Shopify orders pipeline ingests order modifications and refunds, with some refunds arriving days late and failed batches replayed under new batch identifiers. Each source event carries a stable `event_id`, one order can have several events, and replays get fresh arrival timestamps. Which key should the warehouse use to make reprocessing idempotent?
Answer to see the discussion.
MCQ-12A daily batch for one user lists rows in ingestion order: `end` at 10:00, `start` at 09:00, `start` at 11:00, and `end` at 12:00, plus a `start` at 23:00 today and `end` at 01:00 tomorrow that must count in full. Active hours sum paired start to end intervals per user. Which sessionization produces the correct total?
Answer to see the discussion.
MCQ-13A Shopify catalog job must merge near-identical product listings across 80 million rows from many sellers, where titles have typos but variants differ by a single attribute such as size. Merging distinct variants is far costlier than leaving some duplicates unmerged, and the job must finish nightly on Spark. Which deduplication approach fits these constraints?
Answer to see the discussion.
MCQ-14A Shopify clickstream pipeline receives events up to two days late, and retries resend the same `event_id` with a new ingestion timestamp. The daily active merchants metric counts distinct `merchant_id` values per UTC day of `event_time`. Which handling produces the correct daily metric?
Answer to see the discussion.
MCQ-15A Shopify orders pipeline processes 2 billion events daily. Finance needs final daily revenue by 6 a.m., the dashboard tolerates 90-minute delay, and each hourly load takes 20 minutes. Which processing design fits these constraints?
Answer to see the discussion.
MCQ-16A Python ETL loads orders with `updated_at > watermark`, writes them to the warehouse, then saves the batch maximum as the new watermark. A crash between the write and the save causes a rerun, late orders can share the watermark timestamp, and existing orders can be updated after creation. Which change makes reruns safe without missing rows?
Answer to see the discussion.
MCQ-17An `orders` table has `customer_id`, `order_id` and `amount`. Customer A has two orders tied for the highest amount and a lower amount next, while customer B has distinct amounts. A bonus must go only to orders with competition rank 2 per customer, so A's lower orders must not qualify. Which query pattern returns exactly those orders?
Answer to see the discussion.
MCQ-18A Shopify `orders.csv` extract for 2024-01-15 has amounts formatted as `$1,200.00`, refunds as negative values, and 180 rows with blank `amount`. Source notes say blank rows are cancelled orders that were never charged, and finance needs average revenue per completed order. How should blank rows be handled in the SQL metric?
Answer to see the discussion.
MCQ-19A Shopify orders pipeline receives refunds up to three days late. Operations needs hourly provisional revenue within one hour for staffing, and finance needs a final daily figure on day four for payout reconciliation. Which publishing approach satisfies both stakeholders?
Answer to see the discussion.
MCQ-20A Shopify data engineer must deliver a merchant payout dataset in three weeks for a launch. Product requires hourly freshness, Finance requires a frozen daily close at 23:59 UTC that never changes after sign-off, and Platform warns that duplicating the full pipeline doubles cost. Which delivery decision resolves the dispute?
Answer to see the discussion.
MCQ-21A robot starts at `(0, 0)` facing north and reads the terminal string `R2 L2 R2 L1`, where `R` and `L` turn right or left in place and a digit moves forward that many cells. What is its final position and facing direction?
Answer to see the discussion.
MCQ-22A candidate spent three years as a business analyst writing SQL reports, then built dbt models and a Python ingestion service in the last year. At a Shopify Data Engineer interview they are asked how they got into tech and their plan for the next two years. Which answer best fits the role?
Answer to see the discussion.
MCQ-23A report needs each customer's order count and total amount, including customers with no orders. `customers` has `customer_id` and `name`, `orders` has `order_id`, `customer_id` and `amount`, and one customer has three orders while another has none. Which query pattern gives correct rows?
Answer to see the discussion.
MCQ-24A Shopify team stores 400 TB of raw clickstream events with evolving schemas for exploratory ML training, where storage cost dominates. Finance also needs governed, curated revenue tables with fast SQL queries and column-level access control. Which layering fits both workloads?
Answer to see the discussion.
Curated: · Written: · Reviewed: