Schema Contracts, End-to-End Pipeline Quality, and Production Troubleshooting

Easy · Behavioral & Leadership · Data Engineer · Technical Screen

Prompt

During a technical screen for a Data Engineer position at Royal Bank of Canada (RBC), address the four experience-based topics below with concrete examples from pipelines you have built or operated:

  1. Graduate-level engineering foundations: Which specific capabilities from your master's training directly improved how you design, validate, and run data pipelines?
  2. Managing structural drift in ETL/ELT: How do you reconcile structural mismatches between upstream producers and target tables—covering dropped or unexpected fields, data-type shifts, column renames, and evolving nested JSON payloads—and where do you draw the line between flexible evolution and strict contract enforcement?
  3. Four-pillar warehouse quality: How do you guarantee completeness, accuracy, consistency, and timeliness from initial raw landing through intermediate models to curated warehouse tables, where is each validation gate placed, and what happens operationally when a gate fails?
  4. Resolving a thorny production issue: Recount one tough operational pipeline failure you owned—such as delayed or out-of-order events, duplicate loads, historical reprocessing, partition skew, unstable upstream sources, non-idempotent retries, runaway compute spend, or missed delivery windows—explaining the underlying fault, your architectural fix, and the lasting takeaway.

Scope & Expectations

  • Real-world grounding: Pair clear engineering principles with concrete examples from past pipelines, using structured storytelling (such as STAR) for your incident walkthrough.
  • Zone-aware trade-offs: Distinguish policies across raw landing zones and curated business tables, spelling out the latency, compute, and strictness costs of your choices.
  • Consumer-safe failure playbooks: Explain how failed checks protect downstream reports and models so partial or corrupted snapshots never reach end users silently.

Step-by-step walkthrough

  1. What this Data Engineer screen is really testing

    Three of these four prompts are system-design questions disguised as behavioral prompts. Rather than reciting tool names, the interviewer wants concrete operating policies backed by real pipeline trade-offs:

    1. Graduate skills that changed how you build: Specific distributed-systems, modeling, or testing concepts from your master's that visibly improved your production habits.
    2. A deliberate schema-evolution policy: In ETL (Extract, Transform, Load—transforming data before loading) or ELT (Extract, Load, Transform—landing raw payloads into storage/warehouse first and transforming afterward), when do you allow flexible evolution versus halting strictly?
    3. End-to-end data integrity across all four named dimensions: Concrete checks for completeness, accuracy, consistency, and timeliness mapped to specific pipeline stages, with explicit failure actions.
    4. Ownership of a thorny production bug: Methodical root-cause diagnosis, a fix that eliminates the entire class of failure, honest accounting of the fix's cost, and a transferable lesson.

    At a major financial institution like Royal Bank of Canada (RBC), warehouse tables power financial reconciliations, credit-risk models, and regulatory filings—so demonstrating when to halt publishing and protect downstream trust carries major weight.

  2. Anchor all four prompts in one pipeline you know cold

    Pick one production pipeline you owned (or your deepest graduate capstone if you are early in your career) and thread all four answers through it. Prompts 1–3 are "how do you" framework prompts best answered with Principle -> Mechanism -> Example -> Trade-off, while Prompt 4 is a behavioral deep dive best answered with STAR (Situation, Task, Action, Result):

    4-Prompt Screen Blueprint:
      Prompts 1-3   Principle   1 sentence stating your core rule (e.g., "flexible at landing, strict at consumption")
                    Mechanism   Where the check/contract runs + exact behavior on edge cases
                    Example     How it worked in your pipeline (including nested JSON or late events)
                    Trade-off   What strictness or recomputation costs—and why it is worth paying
      Prompt 4      Situation   Pipeline purpose, finance/model consumer, and quantified symptom (%)
                    Task        Your ownership scope
                    Action      Data-driven diagnosis -> root cause -> architectural fix + guardrails
                    Result      Eliminated failure + compute/latency trade-off + lasting lesson
    
  3. Prompts 1 and 2: graduate foundations and structural drift

    Before reading the spoken scripts, make sure three key concepts are crystal clear:

    • Event time vs. processing time: Event time is the timestamp when an action actually occurred in the real world (a card swipe Monday night), whereas processing time is when your pipeline received the record (Wednesday morning after an offline terminal reconnected).
    • Raw (bronze) layer vs. curated (silver/gold) tables: The raw layer stores incoming files or JSON payloads untouched so nothing is lost and historical data can always be replayed; curated tables enforce strict types and business contracts for analysts, reports, and ML models.
    • Schema registry: A central catalog where upstream services register event schemas and enforce compatibility checks in CI before deploying breaking payload changes.
    Schema Change Case                Raw (Bronze) Layer      Curated / Financial Tables
    --------------------------------  ----------------------  --------------------------------------------------
    Extra column added                Accept automatically    Ignore until mapped deliberately; notify owner.
    Optional column missing           Accept automatically    Populate NULL, increment missing-field metric.
    Required column missing           Accept automatically    Halt curated publish immediately; page owner.
    Type widening (INT32 -> INT64)    Accept automatically    Widen target DDL first, then resume load.
    Type narrowing / bad text cast    Accept automatically    Quarantine failed rows; halt job if > threshold.
    Renamed field (fee -> svc_fee)    Accept automatically    Appears as missing + extra column -> halt as a
                                                              breaking change so values don't silently go NULL!
    Nested JSON adds/moves subfields  Store full JSON string  Extract typed paths via explicit contract;
                                      or VARIANT column       quarantine structural mismatches.
    

    Note an important warehouse detail: modern table formats like Apache Iceberg (and Delta Lake with column mapping enabled) track target columns by numeric ID rather than name, making planned target-side renames fast metadata operations without rewriting Parquet files—but unannounced upstream renames still require a schema contract or registry check so your parser knows the old and new names mean the same field.

    Prompt 1 — Graduate engineering foundations (~105 words):

    Three skills from my master's directly upgraded how I engineer pipelines. First, distributed data systems taught me shuffle mechanics, data skew mitigation, and separating event time from processing time—which proved critical when handling late-arriving financial events at work. Second, database internals grounded me in ACID isolation and dimensional modeling, so I design atomic partition swaps rather than fragile row-by-row mutations. Third, software engineering rigor for data: version-controlled transformations, CI schema-compatibility tests, and automated data assertions, replacing manual notebook spot-checks with repeatable gates on every run.

    Prompt 2 — Reconciling structural drift (~130 words):

    My core rule is flexible evolution at raw ingestion and strict enforcement at curated consumption. In an ELT setup, our raw layer stores exact incoming payloads—including full nested JSON in a raw string or VARIANT column—so unexpected extra keys never crash ingestion or get dropped permanently. Between raw and curated tables sits a versioned schema contract specifying required fields, types, and JSON paths, paired upstream with a schema registry wherever event producers support it. I choose flexible evolution only for raw landing zones and exploratory sandboxes; for financial tables, ML feature stores, and regulatory reports, I enforce strict contracts that halt publishing on missing required columns, type overflows, or suspected renames—because a delayed table is recoverable, while silently NULL financial columns destroy trust.

  4. Prompt 3: four-pillar warehouse quality gates

    Map every automated check explicitly to the prompt's four required dimensions (completeness, accuracy, consistency, timeliness), its pipeline stage, and its exact failure action:

    Dimension     Meaning                            Stage & Concrete Check                 Action on Failure
    ------------  ---------------------------------  -------------------------------------  --------------------------
    Completeness  No missing files, partitions,      Ingestion: partition arrived; row      Abort load before staging;
                  or dropped records                 count == upstream control manifest     page ingestion owner.
    Accuracy      Numbers parse cleanly and match    Staging: safe type casts, valid value  Quarantine bad rows; block
                  real-world source amounts          ranges, SUM(amount) == source ledger   publish above threshold.
    Consistency   Keys align and metrics agree       Transform: unique primary keys, FK     Block atomic publish; keep
                  across related tables              joins resolve, cross-table sums match  last verified version live.
    Timeliness    Fresh data lands before the        Warehouse: max(updated_at) within      Alert on-call + post stale
                  agreed SLA deadline                the 7:00 AM SLA window                 banner for downstream users.
    

    Prompt 3 — Spoken summary (~125 words):

    I enforce integrity as a defense-in-depth system across four dimensions: completeness at ingestion by verifying partition arrival and row counts against upstream control totals; accuracy in staging through type-cast validation, domain range checks, and dollar reconciliation; consistency during transformations via primary-key uniqueness, foreign-key checks, and cross-table metric reconciliation; and timeliness on warehouse tables by monitoring data freshness against our SLA (Service Level Agreement—our promised delivery deadline). Underneath those checks sit two invariants: idempotent writes (using atomic partition overwrites or merges so retries never duplicate rows) and row-level lineage columns (load_id, source_file). Whenever a blocking check fails, we halt swaps so consumers keep reading the prior verified snapshot, mark freshness stale, alert owners, fix the root cause, and add a regression test.

  5. Prompt 4: sample STAR story on late-arriving settlement data

    Below is a realistic first-person STAR walkthrough (~365 words) tailored to a Data Engineer candidate interviewing at RBC:

    At my previous role at a payments company, I owned the daily ELT pipeline calculating merchant settlement totals—daily card volume per merchant—which finance used to reconcile payouts. Every week or two, finance noticed historical daily totals in our warehouse ran up to 0.5% lower than the core payment ledger for certain merchants, forcing engineers and analysts to spend hours running manual SQL patches.

    To find the root cause, I recomputed 90 days of totals directly from raw event logs and diffed them against our warehouse table. Every single missing dollar came from late-arriving events: portable card terminals on ferries and cellular dead zones approved offline transactions on Monday—their event time—but uploaded batches hours or days later—their processing time. Profiling arrival lag showed 97% of events landed within six hours, 99.9% arrived within 72 hours, and a 0.1% tail trickled in up to ten days late. Our pipeline only recomputed yesterday's event-date partition, so a Monday swipe uploaded on Wednesday landed in raw storage but never entered Monday's settlement total.

    I shipped three coordinated changes. First, each daily run now recomputes a rolling three-day window of event-date partitions using atomic partition overwrites, keeping reruns 100% idempotent while capturing 99.9% of late uploads automatically. Second, I added a status column marking each date provisional for 72 hours before locking it final, and partnered with finance to run payout sign-offs strictly on final dates. Third, so closed accounting periods would never mutate silently, any event arriving more than 72 hours late routes into an append-only settlement_adjustments table posted on the current day's statement, backed by an automated check alerting if final + adjustments drifts from the source ledger by more than 0.01%.

    Daily compute runtime rose from 10 minutes to 28 minutes—well within our one-hour SLA—manual finance patches dropped to zero over the next six months, and our reconciliation check caught two upstream ingestion bugs before finance noticed. That taught me to separate event time from processing time on day one—a discipline directly applicable to banking pipelines at RBC.

  6. Handle the technical follow-up probes

    Strong interviewers will probe the trade-offs behind your schema and late-data decisions:

    • "Why pick a 3-day recomputation window instead of 10 days?" Two concrete constraints: recomputing 10 days daily would have tripled compute cost and pushed runtime close to our morning SLA, and more importantly, finance could not wait 10 business days to finalize merchant payout reconciliations. Measuring the empirical arrival curve (99.9% within 72 hours) let us capture almost everything in the rolling window while handling the 0.1% tail cleanly via explicit accounting adjustments.
    • "Why didn't you rewrite the batch pipeline into a real-time streaming pipeline?" Streaming lowers display latency, not offline terminal upload delay—a ferry terminal with no cell signal for two days still uploads two days late, and finance still needs a clear rule defining when Monday's ledger closes and locks. A 3-day sliding batch plus adjustments solved the exact business problem at a tenth of the operational complexity.
    • "Walk through what happens if an upstream microservice renames a nested JSON key from fee_cents to service_fee_cents without telling you." Raw bronze ingestion succeeds uninterrupted because it stores the raw JSON payload untouched; the curated silver job halts at the contract check before publishing silent NULLs, keeping yesterday's clean snapshot intact while paging the owner. Once we update the mapping expression to COALESCE(service_fee_cents, fee_cents), we replay cleanly from our raw bronze layer with zero data loss.

Intuition & how it works

Think of managing schemas and data integrity in an ELT pipeline (Extract, Load, Transform—landing raw inputs into storage first and transforming them into structured warehouse tables afterward) like operating a bank's armoured cash vault. At the loading dock, guards log and store every sealed canvas bag exactly as the courier hands it over so nothing is lost on arrival (flexible raw layer). Inside the counting room, tellers verify bill denominations, counterfeit markers, and deposit slips against strict rules before updating customer balances (curated schema enforcement and multi-stage quality gates). And once Friday's ledger book is signed and locked, a crumpled receipt discovered on Monday is recorded as a dated adjustment line rather than secretly erasing inked numbers on Friday's page.

Naive answers fail because candidates apply a single blunt rule everywhere: either enforcing brittle schemas right at raw ingestion so a harmless new JSON field crashes the nightly load, or turning on blind auto-evolution all the way to executive tables so a renamed field quietly turns revenue columns into NULLs. Just as often, engineers confuse event time (when a real-world transaction happened) with processing time (when the server received it), causing delayed uploads from offline devices to vanish forever from yesterday's batch partition.

Watch how a layered banking-grade pipeline handles both evolving schemas and late-arriving data cleanly:

1. Flexible Landing:  Store raw files & full nested JSON untouched in bronze storage (0 data loss).
2. Strict Contract:   Validate required fields, types, & renames before curated silver/gold publish.
3. 4D Quality Gates:  Check Completeness, Accuracy, Consistency, & Timeliness; halt swap on failure.
4. Late-Data Design:  Recompute a 3-day sliding event-date window via idempotent partition overwrite
                      (99.9% coverage) + route >72h stragglers to an immutable adjustments table.

Every layer reinforces the others: preserving raw inputs makes strict downstream halts safe to replay, and idempotent partition overwrites make rolling recomputations and backfills risk-free.

What interviewers look for

  • Coursework translated into engineering habits: Connecting graduate fundamentals—like shuffle optimization, transaction isolation, or event-time windowing—to concrete improvements in pipelines you built.
  • Zone-specific schema policies: Explaining why raw landing zones accept extra fields and full nested JSON payloads flexibly while curated financial and ML tables enforce strict versioned contracts (ideally backed upstream by a schema registry—a service that blocks incompatible producer schema changes before deployment).
  • Checks mapped to all four integrity dimensions: Naming specific gates for completeness (row counts vs. manifests), accuracy (domain bounds and source ledger reconciliation), consistency (unique keys and cross-table agreement), and timeliness (freshness within the agreed SLA, or Service Level Agreement delivery deadline).
  • Safe failure choreography: Leaving downstream readers on the previous verified table version via atomic swaps, marking stale metadata explicitly, alerting owners, and quarantining bad rows rather than publishing half-broken data.
  • Idempotency and lineage as foundational invariants: Ensuring idempotent writes (reruns produce identical state without duplicates) and stamping audit columns (load_id, source_file) on every record.
  • Principled root-cause storytelling: Measuring the exact distribution of a production failure (such as arrival lag), explaining the engineering and business trade-offs of your fix (compute cost vs. completeness), and preserving closed-period immutability.

Common mistakes

  • Dropping tool names in place of policies: Listing "dbt, Great Expectations, Iceberg, Airflow" without explaining which exact schema changes halt publishing or what happens when a check fails.
  • Treating renamed columns as harmless evolution: Without a contract check, a renamed field looks like one dropped column plus one extra column, quietly writing NULLs into downstream tables.
  • Validating only at the final dashboard table: Waiting until the end of five joins to run checks makes corrupt data vastly slower and harder to trace back to the offending source file.
  • Omitting timeliness from data integrity: Perfectly accurate risk numbers that finish three hours after the morning regulatory filing deadline still fail the business.
  • Silently mutating closed financial history: Overwriting 30-day-old reconciled partitions whenever a straggler event arrives breaks audit trails and confuses finance teams whose prior reports suddenly change.
  • Presenting fixes with zero trade-offs: Every architectural fix carries a cost in compute minutes, storage, or freshness delay; stating that cost proves senior judgment.

Follow-up questions

  • How do you run a multi-year historical backfill without disrupting analysts querying live production tables? Never overwrite live production partitions directly in place while analysts are querying them. Instead, run the backfill job into a separate shadow table (or staged shadow partitions), execute the full suite of primary-key, nullability, and ledger-reconciliation checks on the backfilled output, and run a summary diff explaining every intentional delta against current production numbers. Once signed off, swap partitions atomically in bounded date batches during off-peak hours and notify downstream teams which historical windows were restated; because each partition build is idempotent, any failed batch can simply be retried cleanly.
  • What organizational and technical mechanisms prevent upstream application teams from pushing breaking payload changes? Turn implicit tribal assumptions into explicit, automated contracts that fail fast on the producer side rather than at 3:00 AM in the warehouse. Publish a concise data contract listing the exact fields, types, and semantic meanings downstream reports rely on, and wire a lightweight compatibility check—via a schema registry or a shared JSON-Schema test in the producer's CI pipeline—so breaking changes are flagged while the app engineer is still writing their pull request. Pairing that automated check with a shared #data-contracts announcement channel and transparent visibility into which regulatory or finance reports depend on their table eliminates 90% of accidental breaks.
  • Suppose a blocking reconciliation assertion fails sixty minutes before a regulatory reporting deadline—how do you handle the incident? First, never bypass a failed financial accuracy check just to hit the clock; submitting a known wrong number to a regulator is far worse than escalating a delay. Within five minutes, notify the report owner and engineering lead with three crisp facts: which table halted, the exact magnitude of the discrepancy, and whether the previous verified snapshot is still intact. In parallel, triage logs and quarantine rows to check whether the mismatch comes from an isolated upstream glitch (like one delayed regional file) that can be reloaded and verified within 30 minutes, giving the business owner accurate information to either ship verified numbers on time or trigger their formal regulatory extension playbook—and afterward, move upstream ingestion and validation earlier in the night to widen your recovery buffer.

Follow-up questions

Similar questions

More Rbcroyalbank interview questions

All 5 Rbcroyalbank questions →