Blockchain Developer Core Blockchain Data Structures 2 — Questions and Answers
Question 1: In a Merkle tree, what is stored at each leaf node?
- The hash of an individual transaction (Correct answer)
- The block header
- A pointer to the previous block
- The nonce value
Correct answer: The hash of an individual transaction
Leaf nodes contain the hashes of individual transactions, which are then combined upward to form the Merkle root.
Question 2: What property of cryptographic hash functions ensures a tiny input change produces a completely different output?
- The avalanche effect (Correct answer)
- Collision resistance
- Determinism
- Preimage resistance
Correct answer: The avalanche effect
The avalanche effect means a single-bit input change cascades into a drastically different hash output.
Question 3: How does a block reference the block before it in the chain?
- By including the previous block's hash in its header (Correct answer)
- By storing the previous block's full data
- By using a sequential database ID
- By timestamp comparison
Correct answer: By including the previous block's hash in its header
Each block header contains the hash of the previous block, creating an immutable cryptographic link.
Question 4: What is the primary benefit of a Merkle tree for lightweight (SPV) clients?
- They can verify a transaction's inclusion without downloading the full block (Correct answer)
- They can mine blocks faster
- They eliminate the need for hashing
- They compress all transactions into one byte
Correct answer: They can verify a transaction's inclusion without downloading the full block
Merkle proofs let SPV clients confirm a transaction belongs to a block using only a small branch of hashes.
Question 5: If a Merkle tree has an odd number of leaf nodes, how is this commonly handled in Bitcoin?
- The last hash is duplicated to make a pair (Correct answer)
- The tree is rejected
- A zero hash is appended
- The odd node becomes the root directly
Correct answer: The last hash is duplicated to make a pair
Bitcoin duplicates the final hash when a level has an odd count so it can be paired and hashed.
Question 6: What data structure is a blockchain fundamentally based on?
- A hash-linked list of blocks (Correct answer)
- A balanced binary search tree
- A hash table
- A doubly-linked circular queue
Correct answer: A hash-linked list of blocks
A blockchain is essentially a singly-linked list where each node links backward via cryptographic hashes.
Question 7: Why is a blockchain considered tamper-evident?
- Altering one block changes its hash and breaks all subsequent links (Correct answer)
- Blocks are encrypted with private keys
- Miners manually inspect every block
- Each block has a digital watermark
Correct answer: Altering one block changes its hash and breaks all subsequent links
Changing any block's data invalidates its hash, which cascades and invalidates every later block's reference.
In a Merkle tree, what is stored at each leaf node?