Skip to content
Tech Interview Prep
Technical interview guide

Oracles & Cross-Chain Interoperability

How smart contracts get real-world data they can't natively access, and how assets and messages move between otherwise-isolated chains.

Minutes to read
3
Practice MCQs
25
Interview Q&A
25
Edition
v6
Editorial status
Reviewed

Scope: Chainlink Data Feeds, Sequencer Uptime Feeds, VRF v2.5 and CCIP documentation; Uniswap v2 oracle design; IBC core and ICS-23 specifications; EIP-3668 reviewed 2026-09-07.

Overview

Curated: · Written: · Reviewed:

Oracles & Cross-Chain Interoperability

In one line

An oracle imports an external fact (a price, a timestamp, a random output) and a bridge imports another chain's state or message. Each one moves trust onto named signers, sources or proofs, so reach for them only when on-chain data cannot answer the question, and state exactly what you now trust.

Key definitions

  • Feed identity: chain, contract address, base, quote, decimals and heartbeat. Pin all of them per deployment.
  • Heartbeat and deviation: a push feed writes on a timer or when price crosses a threshold, so a flat price can be old without being wrong.
  • Round validation: answer > 0, updatedAt within maxStaleness, and answeredInRound >= roundId.
  • Sequencer uptime feed: reports whether the L2 sequencer is up and since when (startedAt). A grace period after restart gates liquidations.
  • Finality: the point after which a source block cannot reorg. Twelve confirmations is a depth, not finality.
  • Replay protection: a consumed-identifier check bound to source chain, sender, destination chain, target and nonce.
  • Light client: verifies source headers and validator signatures on the destination. You inherit its correctness and update liveness.

Formulas and complexity

A median over n reporters is set by the middle value, so an attacker must control at least half the slots to move it: with 7 slots, 3 forged reporters move nothing while 4 honest reporters hold the true price.

k=⌈n/2⌉ slots needed to set the median of nk=\lceil n/2 \rceil \text{ slots needed to set the median of } n

A TWAP averages cumulative price over window w:

TWAP=Ct−Ct−ww\text{TWAP}=\frac{C_t-C_{t-w}}{w}

Finality on Ethereum: 32 slots per epoch at 12 s per slot, finalized after two epochs, so 64 slots or about 12.8 minutes.

How it works

  1. Each reporter signs (price, timestamp) and submits. The contract recovers the signer and checks it is registered.
  2. The aggregator takes the median of the latest slots. A push update fires on deviation or heartbeat.
  3. The consumer validates the round, staleness, sequencer grace and a sanity range before using the value.
  4. A bridge proves a source event or header on the destination, marks the identifier consumed, then executes.
pass fail Reporter 1 Median aggregator Reporters 2 to n Feed answer Consumer checks: round, staleness, sequencer grace Use price Block new risk, allow repay

When to use and when not to

SituationUseAdd controls or avoid
Liquidation price on L1Push feed with staleness checkSpot read from one pool
Deep, liquid pairTWAP as cross-checkTWAP as sole source on a thin pool
Asset transfer across chainsLight client, or committee with rate limitsTrusting the relayer to be honest
Random outcome for a gameVerifiable randomness bound to a request IDBlock hash or user-supplied seed
Liquidations on an L2Sequencer uptime feed plus grace periodPrice freshness alone

Traps interviewers probe

  • Two feeds means diversified. Fix: trace both to the same exchanges and reporters, then diversify sources and operators.
  • Any signed report is accepted. Fix: check the report's feed ID matches the market ID it writes to, and that the signer is registered. Freshness alone does not stop a valid report written to the wrong market.
  • Twelve confirmations is finality. Fix: act only on the finalized checkpoint, or price the reorg risk explicitly for the value at stake.
  • Replay keyed on nonce alone, or no destination chain ID. Fix: the identifier includes source and destination chain IDs, sender, target, payload hash and nonce, and execution checks block.chainid.
  • Falling back to a manipulable price on staleness. Fix: bound deviation from the primary, halt new borrowing and keep repayment open.

Interview tips

Open with the trust boundary: the oracle imports this fact from these sources, so the protocol now trusts these parties for it. Expect these follow-ups: the maximum loss one compromised signer can move; what happens to in-flight messages during an upgrade; how you detect a stale feed before it liquidates someone; what your monitoring shows when two independent endpoints disagree.

Thirty-second outline: name the fact and its source. State the freshness and validation rule and its number. Name the failure mode and what stays open, such as repayment or exit. For cross-chain, state the replay key and the finality rule. Finish with the monitoring signal you would alert on.

Feedback on this overview

Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.