Skip to content
Tech Interview Prep
Technical interview guide

Blockchain & Distributed Ledger Fundamentals

What a blockchain actually is: a replicated, append-only ledger, and why that structure trades off against a conventional database.

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

Scope: NISTIR 8202; Bitcoin white paper; Ethereum developer documentation and proof-of-stake behavior reviewed 2026-09-04; Hyperledger Fabric latest documentation; IPFS documentation reviewed 2026-09-04.

Overview

Curated: · Written: · Reviewed:

Blockchain & Distributed Ledger Fundamentals

In one line

A blockchain is a replicated state machine: nodes agree on one ordered, append-only transaction history through consensus, and every node re-executes the same deterministic transitions. Reach for it when several parties need one shared record and no single party can be the accountable writer of record.

Key definitions

  • Hash pointer: a header stores H(previous header), so editing any earlier byte changes every later header hash.
  • Merkle root: one hash committing to a block's transactions. An inclusion proof needs one sibling hash per tree level.
  • Finality: probabilistic (PoW), economic (PoS after checkpoints), or absolute once committed (BFT).
  • Reorg: the canonical head switches to a competing branch, so state you read from the old head may disappear.
  • Nonce: a per-account counter that orders that account's transactions and blocks replay of a signed transaction.
  • Light client: verifies headers and Merkle proofs against a trusted root without storing full history.

Formulas and complexity

n≥3f+1n \geq 3f+1

BFT: a validator set of n tolerates f Byzantine faults.

log⁡2n sibling hashes per Merkle proof\log_2 n \text{ sibling hashes per Merkle proof}

For 4 leaves that is 2 hashes.

fee charged=gas used×gas price\text{fee charged} = \text{gas used} \times \text{gas price}

A reverted transaction is charged for gas used, not for the gas limit.

How it works

  1. The client signs a transaction with its account key. The nonce fixes its position in that account's sequence.
  2. Nodes check the signature, nonce and balance, then execute the transaction deterministically.
  3. Consensus orders transactions into blocks. Each header commits to its parent's hash and to the Merkle root of its transactions.
  4. Every node re-executes the block and must reach the same state.
  5. Finality is whatever the consensus protocol guarantees, not whatever the node has seen.
Signed transaction Node checks signature and nonce Consensus orders into block Header: parent hash + Merkle root Every node re-executes to the same state

When to use and when not to

SituationBlockchainDatabase
Several parties, no single writer of recordFitsOverkill
One accountable operator who must reverse or delete rowsWrong modelFits
p99 writes under 10 ms, confidential queriesCostly, replicatedFits
Known counterparties, sub-second absolute finalityConsortium BFT fitsAlso fits, with an audit log
Only needs auditabilityOverkillAppend-only table

Traps interviewers probe

  • Trap: "We put the document's hash on-chain, so the document is stored." Fix: a hash is a commitment. The document still needs pinning or a publisher to serve it.
  • Trap: "Blocks can't be changed." Fix: the chain is tamper-evident and expensive to rewrite. A majority coalition or a social fork can rewrite history.
  • Trap: "Raft is Byzantine fault tolerant." Fix: Raft is crash-fault tolerant only. A malicious ordering node can equivocate and Raft will not detect it.
  • Trap: "A nonce gap is harmless." Fix: a transaction with maxFeePerGas below the base fee cannot be included, and every higher nonce from that account waits behind it.
  • Trap: "A valid signature proves who sent it." Fix: it proves the key holder authorized these bytes. It proves nothing about civil identity or the truth of the payload.

Interview tips

Open with the one-line definition, then name the trust problem: no single writer of record. Follow-ups to expect:

  • Finality on the specific chain you cite, stated per consensus model.
  • What a 51% attack costs and can do: it can double-spend and censor. It cannot steal keys or mint outside the rules.
  • How oracles break the trust model, since the chain only verifies what its inputs say.
  • Who governs the upgrade path and who holds admin keys.

30-second outline:

  1. One sentence: a replicated, append-only ledger ordered by consensus.
  2. The problem it solves: several parties, no single accountable writer.
  3. The mechanism: hash-linked headers, Merkle roots, deterministic re-execution.
  4. Finality for the chain at hand, with its number and its assumption.
  5. The trade-off, and the point where a database wins.

Feedback on this overview

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