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
BFT: a validator set of n tolerates f Byzantine faults.
For 4 leaves that is 2 hashes.
A reverted transaction is charged for gas used, not for the gas limit.
How it works
- The client signs a transaction with its account key. The nonce fixes its position in that account's sequence.
- Nodes check the signature, nonce and balance, then execute the transaction deterministically.
- Consensus orders transactions into blocks. Each header commits to its parent's hash and to the Merkle root of its transactions.
- Every node re-executes the block and must reach the same state.
- Finality is whatever the consensus protocol guarantees, not whatever the node has seen.
When to use and when not to
| Situation | Blockchain | Database |
|---|---|---|
| Several parties, no single writer of record | Fits | Overkill |
| One accountable operator who must reverse or delete rows | Wrong model | Fits |
| p99 writes under 10 ms, confidential queries | Costly, replicated | Fits |
| Known counterparties, sub-second absolute finality | Consortium BFT fits | Also fits, with an audit log |
| Only needs auditability | Overkill | Append-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:
- One sentence: a replicated, append-only ledger ordered by consensus.
- The problem it solves: several parties, no single accountable writer.
- The mechanism: hash-linked headers, Merkle roots, deterministic re-execution.
- Finality for the chain at hand, with its number and its assumption.
- 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.