Read the first chapter
The whole of chapter one, free. About 17 min. Turn the pages with the arrows, your keyboard, or a swipe.
Chapter 1
Blockchain Fundamentals (1-100)
Category Introduction: Blockchain Fundamentals (1-100)
This section covers questions about the core mechanics you have to reason about in every interview: how data is represented on-chain, how consensus works, how validators and nodes actually fit together, what forks and finality mean in practice, and how transactions move through the mempool and get priced via gas. These show up constantly when people are explaining designs, debugging incidents, or arguing about “why the chain did that.”
If you can answer these cleanly - and connect the dots between consensus, cryptography, and execution - you’re already ahead of most candidates who only memorize definitions.
---
Core Blockchain Concepts for 4+ Years: Blockchain Data Model
Q1: What does a blockchain “store” in practical terms? A: A blockchain stores an append-only sequence of blocks, where each block contains a set of transactions plus metadata that links it to the previous block. The key practical point is that the chain is not a database you query casually; it’s a verifiable history where every new block must be consistent with the chain state rules. If you’re building or auditing anything on top, you care about how transaction data becomes state transitions and how that transition is validated by consensus.
In interview terms, you should describe the data model as: block → transactions → state transition → resulting state root (or equivalent commitment). Even when the “state” lives elsewhere (like Ethereum’s state trie), the chain still commits to it using cryptographic commitments so nodes can verify correctness without trusting any single party.
Ask yourself: “If I replay the chain from genesis, can I deterministically reach the same state?” That’s the bar.
Related: See also Q7 about Merkle Trees and Q8 about Digital Signatures for the verification pieces.
---
Q2: What’s the difference between a block and a transaction in the data model? A: A transaction is a signed instruction (or set of instructions) that proposes a state change under some protocol rules. A block is the container that bundles many transactions together and provides ordering and a reference to the previous block so the history is tamper-evident. Ordering matters because state transitions depend on prior transitions.
Practically, you’ll see blocks include: references to parent block(s), a list of transactions, and usually commitments (like state roots) that let other nodes validate efficiently. Transactions alone don’t prove they were executed - blocks and consensus rules are what make them part of canonical history.
If you’re debugging: “Did the transaction get included?” is a different question than “Did it execute correctly?” Inclusion is block membership; execution is deterministic validation by the protocol.
Related: See also Q12 about forks and Q23 about finality.
---
Q3: Why do blockchains use hashing in the data model? A: Hashing is how a blockchain creates compact, tamper-evident commitments. When you hash the contents of transactions (and often the block header), you get a fixed-size digest that changes drastically if any input changes. That makes it cheap to detect inconsistency and efficient for nodes to verify data without re-downloading everything.
Hashing also enables Merkle Trees, where you commit to a large set of items with a single root hash while still allowing proofs for individual items. That’s how you verify “this transaction is in that block” without trusting the peer who sent the block.
In interviews, the clean answer is: hashing gives immutability-by-detection, and it makes verification scalable.
Related: See also Q7 about Merkle Trees and Q4 about block linkage.
---
Q4: How do blocks link together - what actually prevents rewriting history? A: Blocks link via cryptographic commitments in their headers. Typically, each block header includes a hash of the previous block header (directly or indirectly). If you change an old block, the hash changes, which breaks the link to the next block, and so on. To rewrite history, you must produce a new valid chain from that point onward under the consensus rules.
So “immutability” isn’t magic; it’s the combination of (1) cryptographic linkage and (2) consensus cost/requirements. If consensus makes it expensive or impossible to produce an alternative chain that nodes accept, rewriting becomes practically infeasible.
Interview-ready framing: nodes don’t just check “hash matches”; they check “the chain is valid under consensus,” which includes difficulty/stake rules and valid state transitions.
Related: See also Q12 about forks and Q23 about finality.
---
Q5: What does “state” mean in a blockchain? A: State is the current set of account balances, contract storage, and other protocol-relevant variables after executing transactions according to the consensus rules. It’s not just “data on chain” - it’s the result of applying the transaction set to a previous state.
Most chains don’t store the entire state as raw blobs in every block. Instead, they use commitments (like Merkle roots) so nodes can verify state-related claims efficiently. When you execute a transaction, you move from one state root to another state root.
If you’re building: think in transitions. If you’re auditing: think in invariants - what must always hold across transitions.
Related: See also Q2 about transaction execution vs inclusion.
---
Q6: What’s a chain reorg, and why do devs care? A: A reorg (reorganization) happens when the network agrees on a different “canonical” chain than what you previously considered the head. That means some transactions you saw as confirmed might get replaced by transactions from another competing fork.
Dev impact is real: balances, event logs, and contract state you assumed were final can change. Even if your transaction was valid, it might not remain in the canonical history.
So your design needs confirmation depth policies and idempotent handling. In interviews, connect this to finality: “reorg frequency and size depend on how fast finality is achieved.”
Related: See also Q23 about finality and Q12 about forks.
---
Validators/nodes
Q7: What’s the difference between a node and a validator? A: A node is any participant that runs software to receive, verify, and relay blockchain data. A validator is a specific node role that participates in consensus voting/attestation and helps decide which blocks are accepted.
On many networks, not every node validates consensus rules with the same authority. Some nodes are “full nodes” that verify blocks and state, but they don’t produce consensus votes. Validators are the ones that matter for block production/finality.
In interviews, be crisp: “Node = infrastructure; Validator = consensus agent.” Then add: validators also must be well-connected and well-behaved, or their votes become ineffective.
Related: See also Q9 about PoW vs PoS and Q23 about finality.
---
Q8: How do nodes verify correctness without trusting peers? A: Nodes verify correctness by re-executing transactions and checking cryptographic commitments. In the general model: they validate signatures on transactions, check that state transitions follow protocol rules, and ensure the resulting commitments match what the block claims.
This is why blockchains can operate without a central authority. Peers can lie about what they sent, but a node can detect invalid data by running the same deterministic rules and verifying commitments.
In your answer, explicitly mention commitments: Merkle roots/state roots and block header hashes. That’s the bridge between “data transfer” and “data validity.”
Related: See also Q7 about Merkle Trees and Q8 about Digital Signatures.
---
Q9: What’s the difference between PoW and PoS at a validator level? A: In PoW (Proof of Work), validators (miners) compete by expending computational work to find a block that meets difficulty requirements. In PoS (Proof of Stake), validators (often called validators or proposers/attesters depending on protocol) stake capital and participate in consensus by signing/voting on blocks.
The practical difference in interviews: PoW ties block production probability to hashing power; PoS ties it to stake and slashing/selection rules. Both still require that nodes can verify the produced blocks, but the “cost” and “incentive model” differ.
If you’re comparing architectures: PoS typically targets faster finality and lower energy consumption, while PoW emphasizes a different kind of economic deterrence via computation.
Related: See also Q10 about PoW vs PoS tradeoffs and Q23 about finality.
---
Q10: Why do interviews ask “PoW vs PoS” so often? A: Because consensus design shows up everywhere: reorg behavior, finality, validator incentives, and the threat model. If you understand PoW vs PoS, you can reason about what assumptions your app should make about confirmation depth and censorship resistance.
PoW and PoS also shape operational requirements. PoW miners optimize for hash throughput and block propagation. PoS validators optimize for key management, uptime, correct attestation/proposal, and avoiding slashing.
So the “why” is: consensus is the root of your app’s reliability assumptions. Without it, your correctness story is incomplete.
Related: See also Q23 about finality and Q24 about mempool behavior under different consensus.
---
Foundational Cryptography (hashing
Q11: What is hashing in blockchain terms? A: Hashing is a way to map arbitrary-length input data to a fixed-length digest such that small changes in input produce large changes in output. In blockchains, hashing is used for integrity checks, block linkage, and building commitments.
The important properties you should mention: collision resistance (hard to find two inputs with the same hash) and preimage resistance (hard to find an input that maps to a given hash). These properties are what make tampering detectable.
Interview takeaway: hashing isn’t just for “security vibes” - it’s the primitive that makes verification fast and proofs compact.
Related: See also Q3 about why hashing is used in the data model.
---
Q12: Why do Merkle Trees matter for transaction inclusion proofs? A: Merkle Trees let you commit to a large set of transactions using a single root hash, while still allowing a proof that a particular transaction is included under that root. The proof size is logarithmic in the number of leaves, and verification is efficient.
This matters because nodes and light clients don’t want to download everything. They can verify “this transaction is part of this block” using the Merkle proof plus the block’s committed root.
If you’re asked “what problem does it solve,” the real answer is scalability of verification: inclusion verification without full data.
Related: See also Q3 about hashing and Q13 about how proofs work.
---
Q13: How do you explain a Merkle proof quickly? A: A Merkle proof is a set of sibling hashes that lets you recompute the Merkle root for a leaf you care about. You start with the transaction hash, combine it with the provided siblings in the correct order, and end up with the root hash. If that root matches the one in the block header, inclusion is proven.
In interviews, don’t overcomplicate: the “math” is iterative hashing up the tree. The “engineering” is: proof generation at block creation and proof verification at client validation.
Practical takeaway: Merkle proofs are how wallets and indexers can verify inclusion claims without trusting a node’s API.
Related: See also Q1 about the data model commitments.
---
Q14: What are the common cryptographic pitfalls teams hit around hashing? A: The biggest pitfalls are using the wrong assumptions (e.g., assuming collision resistance when the hash function is broken), mixing hashing for signatures incorrectly, or building protocols that rely on malleable encodings. Also, people sometimes hash only part of the structured data, enabling ambiguity.
In practice: you want canonical serialization for what you hash, and you need clear domain separation - so signatures/hashes can’t be reused across contexts.
Interview-ready answer: hashing must be combined with strict serialization and clear protocol boundaries. Otherwise, “cryptography” becomes “works on paper, breaks in edge cases.”
Related: See also Q15 about Digital Signatures and Q16 about replay.
---
Digital Signatures).
Q15: What’s a digital signature, and why do blockchains use it? A: A digital signature proves authorization: the signer approved a specific message, and anyone can verify that approval using the signer’s public key. In blockchains, transactions are signed so nodes can verify that the sender had the authority to move funds or call a contract.
The security requirement is unforgeability: attackers shouldn’t be able to produce valid signatures without the private key. Verification should be efficient so nodes can validate many transactions.
The practical interview point: signatures bind to the exact message bytes. If you sign the wrong serialization or omit fields like chain ID, you get replay or cross-context problems.
Related: See also Q16 about signature replay and Q14 about hashing pitfalls.
---
Q16: How does signature replay happen, and how do you prevent it? A: Signature replay happens when a signature is valid in one context and also valid in another because the signed message doesn’t include enough domain separation (like chain ID, nonce, or contract-specific identifiers). Attackers can reuse the same signed payload elsewhere.
Prevention strategy is to include context in what’s signed and to enforce uniqueness. In Ethereum-like systems, chain ID inclusion and nonce usage are common defenses. Even if the signature verifies, the transaction must also pass protocol rules (nonce not reused, correct sender state).
If you’re answering for interviews: mention both - (1) domain separation in the signed payload and (2) stateful replay prevention via nonces.
Related: See also Q23 about finality and Q33 about nonces (if covered later in your overall prep).
---
Q17: What’s the difference between hashing and signing? A: Hashing creates a digest for integrity/commitment; signing creates an authorization proof tied to a private key. Hashing alone doesn’t provide “who approved this.” Signing binds the signer identity to the message.
In practice, blockchains often hash structured transaction data and then sign the hash (or sign the structured data in a canonical way). Nodes verify signatures using the public key and then verify protocol rules using the signed fields.
Interview takeaway: hashing is not enough for authorization; signatures provide provenance.
Related: See also Q11 about hashing and Q15 about signatures.
---
Q18: Why do signatures need canonical encoding? A: If the signed message can be interpreted multiple ways (non-canonical encodings), attackers can create different byte sequences that represent the “same meaning,” potentially bypassing checks or causing inconsistent verification across implementations.
Canonical encoding ensures that the bytes you sign are exactly the bytes everyone verifies. It reduces ambiguity and eliminates whole classes of signature malleability or serialization inconsistency bugs.
In an interview: “Canonical serialization + strict message format” is a strong, direct answer.
Related: See also Q14 about hashing pitfalls.
---
Ethereum Fundamentals at a Conceptual Level
Q19: What’s Ethereum, conceptually, beyond “a chain”? A: Ethereum is a state machine replicated by many nodes, where transactions instruct the machine to transition state. The “chain” is the ordered history of those transitions, but the core is the deterministic execution model.
So when interviewers ask Ethereum fundamentals, they’re really asking: how do transactions map to execution, how does the network agree on results, and how does the chain commit to state so nodes can verify it?
Conceptually, think: transaction → execution in the EVM → new state. Consensus ensures that all honest nodes converge on the same state transitions.
Related: See also Q1 about blockchain state and Q5 about state.
---
Q20: What does “deterministic execution” mean in Ethereum-level discussions? A: Deterministic execution means that given the same inputs (transaction data, current state), every honest node should compute the same output (logs/events and updated state). That’s what makes consensus possible: agreement on state roots, not just agreement on message delivery.
If execution is deterministic, then the only remaining question is whether the block producer executed correctly. Nodes can verify by re-running the execution.
Interview takeaway: deterministic execution is the backbone of verifiable computation on-chain.
Related: See also Q8 about nodes verifying correctness.
---
Q21: How do forks relate to Ethereum’s execution model? A: Forks are about competing histories of blocks. Since execution depends on prior state, different forks produce different states. When the canonical chain changes due to reorgs, the execution results for transactions in the replaced blocks may no longer be the canonical truth.
So Ethereum devs care about forks because they affect finality and the stability of contract state and event logs. If you build systems that assume “I saw it, so it’s true forever,” forks break that assumption.
Interview-ready answer: forks don’t just move blocks - they move the state machine forward on different paths.
Related: See also Q23 about finality and Q6 about reorgs.
---
Q22: What’s the practical meaning of “finality” in Ethereum-like chains? A: Finality is how strongly the network guarantees that a transaction will remain in the canonical chain and can’t be reverted by future reorgs. Some systems have probabilistic finality (reorg becomes less likely over time), while others have stronger, explicit finality once consensus reaches a threshold.
For devs, finality determines how many confirmations you wait before treating results as safe for accounting, settlement, or cross-contract workflows.
Interview takeaway: you don’t just want “included” - you want “final enough for your risk budget.”
Related: See also Q23
Related: See also Q23 about finality guarantees.
---
Core Blockchain Concepts for 4+ Years: Blockchain Data Model
Q23: What’s the blockchain data model most people get wrong? A: The common mistake is treating the chain as “a database you can query.” In practice, it’s an append-only log of blocks, where each block commits to prior history via cryptographic linkage (hashes) and contains transactions plus metadata needed for consensus and execution.
In a stateful chain, the block history is the source of truth for state transitions. The “database” view comes from nodes replaying the history (or using snapshots) and computing the current state.
Ask yourself: what does a new node need to trust? It needs a trusted checkpoint plus the ability to verify each block and each state transition. That’s why the data model is built around verifiable commitments, not just storage.
Related: See also Q24 about why hashes connect blocks.
---
Q24: How do hashes link blocks together in a way that’s hard to tamper with? A: Each block typically includes the hash of the previous block (directly or via headers). If you change anything inside an earlier block, its hash changes, which breaks the “previous hash” reference stored in later blocks. That means you can’t silently edit history without redoing all subsequent work/consensus.
This is more than integrity-checking; it’s a commitment chain. Nodes can verify structure quickly without fetching everything, and consensus rules can rely on those commitments.
Related: See also Q25 about Merkle trees for transaction commitments.
---
Q25: Why do blocks use Merkle trees instead of just hashing the full transaction list? A: Merkle trees let you commit to a large set of transactions with a single root hash while still enabling efficient proofs. If you only had a single hash over the entire list, you’d need the whole list to verify inclusion. With a Merkle tree, you can prove “this tx is in the block” using a small audit path.
That matters for light clients and for bandwidth/verification costs. It also gives you a clean separation: the block header commits to tx content via the Merkle root, while clients can verify specific pieces without downloading everything.
Related: See also Q26 about Merkle proof verification.
---
Q26: What’s a Merkle proof, and what does the verifier actually do? A: A Merkle proof is the set of sibling hashes needed to recompute the Merkle root for a particular leaf (transaction). The verifier hashes upward from the leaf to the root using the provided siblings and compares the computed root to the block’s committed Merkle root.
If any bit is wrong - leaf, sibling, or order - the computed root won’t match. That gives you compact inclusion verification.
Interview takeaway: Merkle proofs turn “prove inclusion” into a deterministic hashing exercise.
Related: See also Q27 about ordering and leaf indexing.
---
Q27: How does leaf ordering affect Merkle tree correctness? A: Leaf ordering changes the Merkle root. That’s why implementations define how leaves are indexed (e.g., tx order within a block) and how internal nodes are computed. If you build the tree with a different ordering than the chain expects, your root won’t match, even if you used the right txs.
For interview purposes: ordering is part of the commitment. You don’t get to rearrange leaves and still claim the same root.
Related: See also Q28 about how transaction ordering impacts state.
---
Q28: Why does transaction ordering inside a block matter to smart contracts? A: Because contract execution is sequential per block: earlier transactions change state that later transactions read and write. Even if two transactions are independent in your head, execution can interact via shared storage, nonce/account balances, or event-driven assumptions.
This is why front-running, sandwiching, and back-running are practical: order is manipulable at the mempool/producer level. Ordering rules (and how they’re enforced) become part of the safety model.
Related: See also Q61 about front-running.
---
Q29: What’s the “mempool → block” pipeline at a data-model level? A: At a high level, transactions enter the mempool (pending tx pool), miners/validators select a subset, and then they package those txs into a block with specific ordering and metadata. The block header commits to selected tx contents (via Merkle root) and consensus-critical fields.
Nodes later verify that the block’s transactions are valid and that execution results match the committed state transitions (or the chain’s acceptance rules).
Related: See also Q30 about mempool selection and ordering.
---
Q30: How should you think about block headers vs full blocks? A: Headers contain the consensus-relevant commitments (like previous block reference, timestamp, and Merkle roots) and are small enough for quick verification. Full blocks include the transactions and execution-relevant data needed for full validation.
Many systems allow light clients to verify headers and inclusion proofs without downloading full blocks. Full nodes validate everything: transactions, state changes, and any execution rules.
Interview takeaway: headers are “verification anchors,” full blocks are “execution payload.”
Related: See also Q31 about light clients and inclusion proofs.
---
Q31: What’s the difference between “accounting state” and “execution state” in interviews? A: Accounting state is what users care about (balances, allowances, ownership). Execution state is the internal variables and storage the VM uses to compute those accounting outputs. In EVM-style systems, both are derived from the same execution: storage writes update the internal state, and view functions read it.
When you discuss correctness, you’re not guessing balances - you’re validating that state transitions followed the VM rules from the previous state.
Related: See also Q32 about state roots and commitments.
---
Q32: What is a state root, and why do nodes commit to it? A: A state root is a cryptographic commitment to the current state after executing transactions in a block. By committing to it (often via a trie or similar structure), nodes can verify state-related claims efficiently and prove correctness without
End of chapter one. 4 more chapters in the full book.
Swipe or use the arrows to turn the page
What's inside: 5 chapters
- 1. Blockchain Fundamentals (1-100)
- 2. Ethereum Architecture, EVM, and Solidity Core (101-250)
- 3. Solidity Deep Dive: Language Features, Security, and Upgradeability (251-400)
- 4. Token Standards, Security Tokens, and Web3 Protocol Patterns (401-550)
- 5. DeFi, Solana, and Real-World Project/Mock Interviews (551-700)
About this book
"Blockchain Interview Q&A Mastery" is a q&a book by VIKASH VASHISHAT with 5 chapters and approximately 17,841 words. Blockchain, Solidity, smart contracts, security, DeFi, and Solana interview Q&A.
This book was created using Inkfluence AI, an AI-powered book generation platform that helps authors write, design, and publish complete books.
Frequently Asked Questions
What is "Blockchain Interview Q&A Mastery" about?
Blockchain, Solidity, smart contracts, security, DeFi, and Solana interview Q&A
How many chapters are in "Blockchain Interview Q&A Mastery"?
The book contains 5 chapters and approximately 17,841 words. Topics covered include Blockchain Fundamentals (1-100), Ethereum Architecture, EVM, and Solidity Core (101-250), Solidity Deep Dive: Language Features, Security, and Upgradeability (251-400), Token Standards, Security Tokens, and Web3 Protocol Patterns (401-550), and more.
Who wrote "Blockchain Interview Q&A Mastery"?
This book was written by VIKASH VASHISHAT and created using Inkfluence AI, an AI book generation platform that helps authors write, design, and publish books.
Write your own q&a book with AI
Describe your idea and Inkfluence writes the whole thing. Free to start.
Start writingCreated with Inkfluence AI