Blockchain Interview Questions on Finality and Contract Security

Blockchain interviews test how a ledger establishes valid history and what its cryptography leaves unresolved. Explain hashes, signatures, consensus, finality and smart contracts with their network assumptions. The checked Python exercise below changes a fictional shipment record, then recomputes its hash links. It demonstrates why internally consistent links alone cannot choose the accepted history.

Aug 13, 2024 - 11:48
Updated: 
104.2k

Ethical Hacking in Cybersecurity & Ethical Hacking · Interview preparation

Blockchain Interview Questions on Finality and Contract Security

Quick answer: Blockchain interviews test how a ledger establishes valid history and what its cryptography leaves unresolved. Explain hashes, signatures, consensus, finality and smart contracts with their network assumptions. The checked Python exercise below changes a fictional shipment record, then recomputes its hash links. It demonstrates why internally consistent links alone cannot choose the accepted history. The remaining questions connect that distinction to Bitcoin, Ethereum, permissioned networks and contract security without creating a wallet, signing transactions or deploying code.

Key takeaways

  • Hash links make alterations detectable against trusted reference evidence.
  • Signatures identify key use; key protection and human approval remain separate.
  • State the network before discussing consensus or finality.
  • Review contract state, external calls and administrative privileges.
  • Validate offchain facts and governance as well as ledger entries.

Table of Contents

What makes a blockchain different from an ordinary shared file?

1. What is a blockchain? It is a ledger maintained under a network's validation and agreement rules. The Bitcoin block-chain guide describes linked blocks and independently validating nodes. Identify who can participate, propose records and change the rules.

2. What is stored in a block? The format depends on the protocol. Bitcoin includes a header committing to the previous header and a transaction Merkle root. Do not assume every ledger uses an identical header or transaction model.

3. What does a Merkle proof establish? It can demonstrate inclusion relative to a particular root under the construction used. That alone does not establish that the underlying transaction was authorised or that an offchain statement is true.

Can valid hash links prove which history is genuine?

This invented shipment exercise uses Python hashlib and a deliberately small record format. The first edit changes a record without its digest. The second creates a newly consistent chain with different content. A separately retained original tip distinguishes the histories in this model.

from hashlib import sha256

def make_chain(records):
    previous = '0' * 64
    blocks = []
    for record in records:
        digest = sha256(bytes.fromhex(previous) + record.encode()).hexdigest()
        blocks.append((record, previous, digest))
        previous = digest
    return blocks

def links_match(blocks):
    previous = '0' * 64
    for record, parent, digest in blocks:
        expected = sha256(bytes.fromhex(parent) + record.encode()).hexdigest()
        if parent != previous or digest != expected:
            return False
        previous = digest
    return True

original = make_chain(['shipment:received', 'temperature:pass'])
edited = original.copy()
edited[1] = ('temperature:fail', edited[1][1], edited[1][2])
rewritten = make_chain(['shipment:received', 'temperature:fail'])
print('Original links:', links_match(original))
print('Edited without rehash:', links_match(edited))
print('Recomputed links:', links_match(rewritten))
print('Recomputed tip equals saved original:', rewritten[-1][2] == original[-1][2])

Checked output:

Original links: True
Edited without rehash: False
Recomputed links: True
Recomputed tip equals saved original: False

The checker verifies only the shown links and digests. It has no signatures, consensus, proof of work, validator votes or protection for the saved tip. A person who controls all copies and reference evidence can replace them. Explain which independent rule or protected evidence would make the accepted history distinguishable.

What do wallets and signatures actually establish?

4. Does a valid signature prove the rightful person approved? It establishes the relevant cryptographic relationship under the verification rules. Ethereum account documentation describes signing keys. A stolen key or misleading signing request can still produce a valid signature, so review key custody and approval context.

5. Are coins stored inside a wallet? Wallets manage keys and transaction interaction. The Bitcoin transaction guide explains unspent transaction outputs; Ethereum uses accounts and state. The wallet's local display is not the ledger itself.

EvidenceWhat it can supportSeparate question
Matching digestCompared bytes match the referenceWas the reference protected?
Valid signatureKey-related verification passedWas the key use authorised?
Merkle inclusionMembership under a given rootIs this the accepted ledger state?

How do proof of work, proof of stake and finality differ?

6. What does proof of work contribute? Bitcoin uses a computational-work-based agreement process together with transaction and block validation. Work does not make an invalid transaction valid; nodes still apply their validation rules.

7. Does Ethereum still use mining for its current consensus? Ethereum uses proof of stake. Its consensus guide describes proposing, attesting and checkpoint finality. Keep that explanation separate from historical Ethereum proof of work and Bitcoin's present mechanism.

8. Are confirmation and finality interchangeable? State the protocol and decision. A recent inclusion can have different reversal assumptions from a finalised checkpoint. Application acceptance should reflect the relevant network and failure model.

9. Is a 51% attack one universal threshold? No. Capabilities and thresholds depend on the consensus mechanism and action involved. Explain the relevant validation, reorganisation or finality assumption instead of transferring one percentage to every network.

How do smart contracts, gas and oracles fit together?

10. What is a smart contract? The Ethereum introduction describes code and state at a contract address. Execution follows network rules; a contract does not independently observe the outside world or wake up because a real-world event occurred.

11. Is gas simply another name for the fee? Ethereum gas documentation distinguishes computational units from their price and the resulting fee. A failed transaction can still consume gas. Avoid promising a fixed cost without the relevant execution and network context.

12. What does an oracle add? An oracle connects onchain execution with external information or systems. In the shipment case, agreeing that a sensor reported “pass” does not establish that the sensor was calibrated or attached to the correct shipment.

Which contract-security questions deserve concrete answers?

13. What is reentrancy? An external interaction can permit a callback before the intended operation is complete. The Solidity security guide explains checks-effects-interactions and cross-contract risks. Review state transitions and every relevant call path, rather than assuming one guard proves complete safety.

14. Does private contract state mean confidential data? In ordinary Ethereum contract storage, a language-level private declaration controls code access rather than concealing the stored value from observers. Keep secrets outside publicly observable state under an appropriate design.

15. What should a review include beyond arithmetic? Authorisation, upgrade and pause powers, external dependencies, unexpected state sequences, failure handling and tests of the required invariants. An audit supports its stated scope and date; it does not guarantee every future integration.

When should you consider a permissioned ledger or a database?

16. Is Hyperledger Fabric the same network as Ethereum? No. Fabric documentation describes an enterprise permissioned platform with identifiable participants and its own architecture. Compare membership, endorsement and governance requirements; “blockchain” is not a common permission model.

17. When might an ordinary database fit better? If one trusted organisation can operate the authoritative record and ordinary replication, access control and audit meet the requirement, assess that simpler arrangement before introducing multi-party consensus.

18. Does a scaling layer preserve every original assumption? Review where execution, data availability, settlement and administrative control occur. A throughput claim alone cannot establish the resulting security, recovery or privacy properties.

Design questionEvidence needed
Who can change membership or rules?Governance and administrative authority
Who reports shipment conditions?Sensor identity, validation and dispute handling
When is an entry accepted?Protocol-specific confirmation and finality policy

How would you finish the shipment interview exercise?

19. What does the recomputed chain prove? Only that its supplied data and links are internally consistent under this toy format. Its changed tip conflicts with the retained original; the program cannot adjudicate competing network histories.

20. What evidence would you request next? Identify the accepted network state, signing authority, sensor provenance and correction process. Keep an incorrect physical observation distinct from an altered ledger record, then explain how the business handles either dispute.

Related reading: network security interview questions; machine learning interview questions.

References

Frequently Asked Questions

Hash links connect records under a chosen construction, while agreement on accepted history requires additional protocol rules and trust assumptions.

It checks a small invented SHA-256 record format without transaction validation, mining, signatures, nodes or Bitcoin header serialization.

The toy program can do so, which is why a protected reference and actual network acceptance rules matter.

It verifies a key-related operation under its rules, while compromised keys and misleading signing requests require separate approval and custody controls.

Ethereum uses proof of stake; historical mining explanations should be labelled and kept separate from its current consensus mechanism.

The contract can process supplied information, but sensor identity, calibration and oracle arrangements still determine the reliability of that input.

The language access modifier does not by itself conceal ordinary Ethereum storage, so confidential information needs an appropriate separate design.

The example ran offline in Python with invented strings; no keys, transactions, contract execution or network participation occurred.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Anjali

I am passionate about technology, invention and big challenging tasks on my to- do list. In terms of the work I am doing also at Bunnyshell, I am most passionate about the technologies that we are using., I'm devoted to delivering content that not only informs but also inspires. Whether you need in- depth analysis pieces, educational attendants, or study- provoking opinion pieces, I draft content that resonates with tech suckers and professionals likewise.