Blockchain Developer Interview Questions (With Answers)

Common blockchain developer interview questions with concise model answers on the EVM, Solidity, security, testing, layer 2 and system design.

In this guide
  1. How these interviews are usually structured
  2. Fundamentals
  3. Solidity and the EVM
  4. Security
  5. Testing and tooling
  6. Architecture and layer 2
  7. Questions to ask and how to prepare
  8. FAQ
  9. Sources

Blockchain developer interviews mostly test three things: whether you understand how the chain executes your code, whether you can spot and prevent the classic security bugs, and whether you can explain design trade-offs. The questions below are the ones that come up repeatedly for EVM-focused roles, with short model answers. Use them to find gaps, not as scripts to memorize; interviewers follow up, and a recited answer falls apart on the second question.

How these interviews are usually structured

Formats vary by company, but most processes combine some of the following:

  • Screening call. Background, motivation, a few fundamentals.
  • Technical interview. Solidity and EVM questions, often with code on screen.
  • Code review or bug hunt. You are shown a contract and asked what is wrong with it.
  • Take-home or live build. A small contract with tests.
  • System design. On-chain versus off-chain split, upgrades, key management.

Code-reading exercises are common because reviewing code is a large part of the job. Practise by reading the findings in common smart contract audit findings.

Fundamentals

What happens between clicking "send" and a transaction being final?

The wallet builds the transaction, the user signs it, and it is sent to a node over JSON-RPC. It waits to be picked up, is included in a block, and executes: state changes apply if it succeeds, and are rolled back if it reverts (the fee is still paid). Inclusion is not finality. On Ethereum a block becomes final only after the consensus layer finalizes it, and applications that move value should wait for the confirmation level their risk requires.

What is the difference between an externally owned account and a contract account?

An EOA is controlled by a private key and can start transactions. A contract account is controlled by its code and only runs when called. Since the Pectra upgrade, EIP-7702 lets an EOA delegate to deployed contract code through a type 4 transaction, so the line is blurrier than it used to be. One practical result: code must not assume tx.origin or msg.sender is a code-less account.

What is gas, and why does it exist?

Gas measures the computational work of each operation. Users pay for the gas their transaction consumes, which prices scarce block space and stops infinite loops. Good answers mention that storage writes are among the most expensive operations and that gas schedules change with protocol upgrades, so contracts and front ends should not depend on fixed gas costs.

What are events for?

Events write logs that off-chain software can filter and index cheaply. Contracts cannot read logs. They are effectively your contract's public API for indexers and front ends, so they should be designed, not added as an afterthought.

Solidity and the EVM

Explain the data locations

Location Lifetime Mutable Typical use
storage Permanent, per contract Yes State variables
transient Cleared at the end of the transaction Yes Reentrancy locks, per-transaction flags
memory One external call Yes Temporary values, return data
calldata One external call No Read-only function arguments

Follow-up to expect: transient state variables currently support value types only, need the Cancun EVM version or newer, and are available as a language feature from Solidity 0.8.28.

What is the difference between call and delegatecall?

call runs the target's code in the target's context: its storage, its balance. delegatecall runs the target's code in the caller's context, keeping the caller's storage, msg.sender and msg.value. That is the basis of proxies and libraries, and the reason storage layouts must match between a proxy and its implementation.

How do upgradeable proxies work, and what can go wrong?

A proxy holds the state and forwards calls with delegatecall to an implementation contract whose address can be changed. ERC-1967 defines fixed storage slots for the implementation, beacon and admin addresses so they do not collide with normal variables. Typical failures are storage layout collisions after an upgrade, implementations left uninitialized, constructors used where initializers are needed, and an upgrade key held by a single account.

How should a contract send ETH?

Use a low-level call and check the result:

(bool ok, ) = recipient.call{value: amount}("");
require(ok, TransferFailed());

transfer and send forward a fixed 2300 gas stipend, which is not reliably enough; both have been deprecated since Solidity 0.8.31 and are scheduled for removal in 0.9.0. Because call forwards all available gas, it gives no reentrancy protection by itself, so you pair it with checks-effects-interactions or a guard.

require with a string, or custom errors?

Custom errors. They cost less to deploy and revert with, and they carry typed arguments. Recent compilers allow require(condition, CustomError(args)), which keeps the readable require form.

Security

What is reentrancy, and how do you prevent it?

A contract makes an external call before finishing its own state updates, and the callee calls back in while the state is inconsistent. A vulnerable withdrawal:

function withdraw() external {
    uint256 amount = balanceOf[msg.sender];
    (bool ok, ) = msg.sender.call{value: amount}("");
    require(ok, TransferFailed());
    balanceOf[msg.sender] = 0; // too late
}

A corrected contract, targeting Solidity 0.8.28 or later:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;

contract Vault {
    error ZeroAmount();
    error InsufficientBalance(uint256 available, uint256 requested);
    error TransferFailed();
    error Reentrancy();

    event Deposited(address indexed account, uint256 amount);
    event Withdrawn(address indexed account, uint256 amount);

    mapping(address account => uint256) public balanceOf;
    bool transient locked;

    modifier nonReentrant() {
        require(!locked, Reentrancy());
        locked = true;
        _;
        locked = false;
    }

    function deposit() external payable {
        require(msg.value > 0, ZeroAmount());
        balanceOf[msg.sender] += msg.value;
        emit Deposited(msg.sender, msg.value);
    }

    function withdraw(uint256 amount) external nonReentrant {
        uint256 balance = balanceOf[msg.sender];
        // Checks
        require(amount <= balance, InsufficientBalance(balance, amount));
        // Effects
        balanceOf[msg.sender] = balance - amount;
        emit Withdrawn(msg.sender, amount);
        // Interactions
        (bool ok, ) = msg.sender.call{value: amount}("");
        require(ok, TransferFailed());
    }
}

Name both defenses: ordering (checks, effects, interactions) and a guard. Strong candidates also mention cross-function and read-only reentrancy, where the re-entered function is a different one or a view that other protocols rely on. In production you would normally use an audited guard such as OpenZeppelin's instead of writing your own.

Why is tx.origin dangerous for authorization?

tx.origin is the account that started the transaction, not the immediate caller. If a user is tricked into calling a malicious contract, that contract can call yours and pass a tx.origin check. Use msg.sender. Related: msg.sender == tx.origin is no longer a valid way to detect "not a contract", nor a reentrancy defense, after EIP-7702.

What is oracle manipulation?

A contract trusts a price or other external value that an attacker can move, for example a spot price from a single liquidity pool pushed with a flash loan within one transaction. Mitigations include decentralized oracle networks, time-weighted average prices and sanity bounds.

Can you keep data secret on-chain?

No. private restricts access from other contracts only. Storage and transaction inputs are readable by anyone. For the same reason, block values make poor randomness. Secrets need commit-reveal schemes, off-chain storage or cryptographic techniques.

How do you handle access control and emergencies?

Restrict privileged functions with ownership or roles, put privileged keys behind a multisig, and consider timelocks so users can react to changes. A pause mechanism should stop risky functions while leaving users a way to withdraw. More in smart contract security basics.

Testing and tooling

What kinds of tests do you write for a contract?

  • Unit tests for each function and each revert path.
  • Fuzz tests, where the framework generates inputs for parameterized tests.
  • Invariant tests, which call functions in random sequences and check properties that must always hold, such as "the contract's balance covers the sum of deposits".
  • Fork tests against real chain state for integrations.
  • Static analysis, for example Slither, in CI.

A Foundry test for the vault above:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;

import {Test} from "forge-std/Test.sol";
import {Vault} from "../src/Vault.sol";

contract VaultTest is Test {
    Vault vault;
    address alice = makeAddr("alice");

    function setUp() public {
        vault = new Vault();
    }

    function testFuzz_DepositThenWithdraw(uint96 amount) public {
        vm.assume(amount > 0);
        vm.deal(alice, amount);

        vm.startPrank(alice);
        vault.deposit{value: amount}();
        vault.withdraw(amount);
        vm.stopPrank();

        assertEq(vault.balanceOf(alice), 0);
        assertEq(alice.balance, amount);
    }

    function test_RevertWhen_WithdrawingTooMuch() public {
        vm.prank(alice);
        vm.expectRevert(
            abi.encodeWithSelector(Vault.InsufficientBalance.selector, 0, 1)
        );
        vault.withdraw(1);
    }
}

Be ready to explain why coverage is not the same as correctness: full line coverage says nothing about the inputs and call orders you did not try.

Foundry or Hardhat?

Give a reasoned answer, not a team allegiance. Foundry is fast and keeps tests in Solidity; Hardhat 3 supports Solidity tests too and adds TypeScript tests and a plugin ecosystem. Mention that Hardhat 2 is approaching end of life. See smart contract testing tools.

Architecture and layer 2

What would you store on-chain versus off-chain?

On-chain: what must be enforced or verified without trusting you, such as balances, ownership and commitments. Off-chain: everything else, with events feeding an indexer and a database. Mention cost, privacy and the fact that on-chain data cannot be deleted.

How do optimistic and ZK rollups differ?

Both execute transactions off layer 1 and post data to it. Optimistic rollups assume batches are valid and rely on fraud proofs if someone challenges; ZK rollups submit a validity proof with each batch. For an application developer the visible differences are withdrawal time to layer 1 and, sometimes, EVM compatibility details. Since EIP-4844, rollups post data as blobs with a separate fee market. See layer 2 explained for developers.

Questions to ask and how to prepare

Good questions for the interviewer: how upgrades are governed, who holds privileged keys, what the audit and review process is, how incidents are handled, and what the test suite looks like.

To prepare:

  1. Rebuild the examples above from memory and test them.
  2. Read two or three public audit reports and explain each finding aloud.
  3. Be able to walk through one project of your own in detail, including what you would change. Our portfolio project ideas can help.
  4. Check current versions before the interview. Quoting outdated practices, such as SafeMath or transfer(), is a common negative signal.
  5. Know the market context from our salary guide before the compensation conversation.

FAQ

Do interviews include LeetCode-style algorithm questions?

Some companies include them, particularly larger ones. Smart contract roles lean more toward code review, security reasoning and a practical build.

Will I be asked about chains other than Ethereum?

Only if the role involves them. For a Solana role, expect questions on accounts, program-derived addresses and cross-program invocations instead of the EVM material above.

How much should a junior candidate know about security?

Enough to explain reentrancy, access control, oracle risk and why testing matters, and to recognize them in code. Nobody expects a junior developer to audit a protocol alone.

Sources

About the author

Alessandro Moretti is a crypto analyst and blockchain strategist who writes and maintains the guides on BlockDev Path. Every factual claim is checked against the primary sources listed above. Spotted an error? Tell us and we will correct it. See our editorial policy.