Blockchain developer interview questions and how to answer them
Blockchain developer interview questions are mostly about writing smart contracts that are safe and cheap to run: how the EVM stores data and charges gas, vulnerabilities such as reentrancy and broken access control, upgradeable contract patterns, testing with fuzzing and invariants, and how off-chain services read chain data. Expect a Solidity coding or code review exercise and questions about audits you have been through. Because deployed code is hard to change, interviewers reward caution and precise reasoning about failure.
By Evin JohnPublished 8 min read
What a blockchain developer does
Most blockchain engineering roles split into two groups. Smart contract engineers write and test the on-chain code, usually Solidity for Ethereum and compatible chains, sometimes Rust or Move on other platforms. Protocol and infrastructure engineers work on clients, nodes, indexers, bridges and the services that read and write chain data. Both groups share one constraint that shapes every interview: once a contract is deployed and holds value, a bug can be exploited by anyone in public and is hard to patch. Code review, testing and threat modeling take a larger share of the work than in most software jobs.
- Precise knowledge of the execution model, so you can predict what the code costs and where it can fail.
- A security mindset: you read every external call as a chance for an attacker to run code.
- Testing discipline with frameworks such as Foundry or Hardhat, including fuzzing and invariant tests.
- Clear written specifications that auditors and other engineers can check the code against.
- Backend skills for indexing events, handling chain reorganizations and managing keys safely.
How blockchain interviews are usually structured
- ScreenWhich chains and languages you have used, what you deployed, and whether any of it was audited.
- Fundamentals roundQuestions on the EVM, gas, storage layout, transactions and common token standards.
- Code review or codingFind the bugs in a short contract, or write one with tests. Some teams send a take-home with a test suite to pass.
- Security and designDesign a contract system such as a vault or an auction, and walk through how an attacker might break it.
- Team roundsWorking with auditors, handling an incident, and how you decide when code is ready to deploy.
EVM and Solidity fundamentals
| Question | What it tests | What a strong answer shows |
|---|---|---|
| What is the difference between an externally owned account and a contract account? | Account model | An externally owned account is controlled by a private key and starts transactions; a contract account has code and runs only when called |
| Storage, memory and calldata: where does each live and what does it cost? | Data locations | Storage persists on chain and is the most expensive to write; memory lasts for the call; calldata is read-only input and cheapest for external function arguments |
| What is gas, and why does every operation have a cost? | Execution model | Gas meters computation and storage so the network can price work and stop infinite loops; unused gas is refunded, but a failed call still consumes what it used |
| How does storage slot packing work? | Storage layout | Variables smaller than 32 bytes declared next to each other share a slot, which saves writes; order of declaration matters |
| What happens to state when a transaction reverts? | Atomicity | All state changes in the transaction are undone, but the gas spent is not returned |
| What are events, and why not store everything in state? | Logging | Events write to logs that off-chain services read cheaply; contracts cannot read logs, so only data the contract needs goes in storage |
| Explain call, delegatecall and staticcall. | Low-level calls | Call runs another contract in its own context; delegatecall runs its code in the caller's storage, the basis of proxies; staticcall forbids state changes |
| Why is tx.origin unsafe for authorization? | Authentication | It is the original signer, so a malicious contract the user calls can act on their behalf; use msg.sender |
Smart contract security questions
This is the heart of most interviews. Expect to be shown code and asked what is wrong with it. Name the vulnerability, show the attack step by step, then give the fix and how a test would catch it.
// Vulnerable: sends ether before clearing the balance,
// so the receiver can call withdraw() again from its fallback.
function withdraw() external {
uint256 amount = balances[msg.sender];
(bool ok, ) = msg.sender.call{value: amount}("");
require(ok, "send failed");
balances[msg.sender] = 0;
}
// Fixed: check, then update state, then interact.
function withdraw() external {
uint256 amount = balances[msg.sender];
require(amount > 0, "nothing to withdraw");
balances[msg.sender] = 0;
(bool ok, ) = msg.sender.call{value: amount}("");
require(ok, "send failed");
}- What is reentrancy, and how do you prevent it? An external call lets the callee re-enter before state is updated. Follow checks-effects-interactions, add a reentrancy guard where needed, and remember read-only reentrancy across contracts.
- How do access control bugs happen? A missing modifier on an admin function, an initializer anyone can call on a proxy, or roles granted too widely. Mention tests that call every privileged function from an unprivileged account.
- Is integer overflow still a risk in Solidity? Recent compiler versions check arithmetic by default, but
uncheckedblocks, casts between sizes and older code still need care. - What is front-running, and how do you design around it? Others can see pending transactions and act first. Commit-reveal schemes, slippage limits and batch auctions reduce the exposure.
- How can a price oracle be manipulated? A contract that reads a spot price from a single pool can be pushed within one transaction, often using a flash loan. Use time-weighted averages or robust external oracles and sanity bounds.
- What is signature replay? A signed message used twice or on another chain. Include a nonce, the chain ID and the contract address in what is signed, and follow typed structured data signing.
- What is a denial-of-service risk in a contract? Unbounded loops over user-controlled arrays, or a payment loop that one failing recipient can block. Prefer pull payments.
- Why is on-chain randomness hard? Block data can be predicted or influenced; use a verifiable randomness service or commit-reveal.
Upgradeability and contract design
| Question | What it tests | What a strong answer shows |
|---|---|---|
| How does a proxy upgrade pattern work? | Proxies | A proxy holds storage and delegates calls to an implementation contract that can be swapped; compare transparent and UUPS styles |
| What is a storage collision, and how do you avoid it? | Storage layout across upgrades | New versions must keep existing variable order; use reserved gaps or namespaced storage and tooling that checks layouts |
| Should this contract be upgradeable at all? | Trust trade-offs | Upgrades fix bugs but give an admin power over users' funds; timelocks, multisig control or immutability are real choices |
| Design a simple escrow or vault contract. | Design under adversaries | Clear state machine, pull-based withdrawals, events for each state change, limits, and a pause path with clear authority |
| How do you implement a token that follows a standard? | Standards | Use a well-reviewed library implementation of ERC-20, ERC-721 or ERC-1155, and know quirks such as tokens that do not return a boolean |
| How would you reduce gas costs in a hot function? | Gas optimization | Fewer storage writes, cache storage reads in memory, pack variables, use calldata, and measure with a gas report rather than guessing |
Testing, audits and deployment
- How do you test a contract before an audit? Unit tests for each function, fuzz tests on inputs, invariant tests for properties that must always hold, and tests on a fork of the live chain.
- Give an example of an invariant. The sum of all balances equals the contract's total supply, or the vault always holds at least what it owes depositors.
- What do you prepare for auditors? A specification, known risks, the threat model, a frozen commit and a test suite that runs in one command.
- How do you deploy safely? Scripts that are reviewed and repeatable, a testnet rehearsal, verified source code, admin roles moved to a multisig, and monitoring from the first block.
- What static analysis tools have you used? Name a tool and what it caught, and say what it cannot find, such as business logic errors.
Off-chain integration and chain fundamentals
- How does a backend reliably track events from a contract? Index logs from a node or provider, store the block number and hash, and handle reorganizations by re-checking recent blocks.
- What is a chain reorganization, and why does it matter to your service? Recent blocks can be replaced, so confirmations depend on the chain's finality rules before treating data as final.
- How should a service hold signing keys? Hardware security modules or a managed key service, least privilege, and no keys in code or plain environment files.
- What is the difference between optimistic and zero-knowledge rollups? Optimistic rollups assume validity and allow a challenge window; zero-knowledge rollups post proofs of validity.
- Proof of work and proof of stake: what changes for an application developer? Mostly finality and block timing assumptions, which affect confirmation logic.
Many of these integration questions overlap with general service design. The backend developer guide covers queues, idempotency and data consistency in more depth. The habit of treating deployed code as nearly permanent is shared with device work; the firmware engineer guide shows the same caution applied to over-the-air updates.
Fictional example
- We were about to send a rewards contract to audit. While writing invariant tests, I added one saying total claimed rewards could never exceed the rewards funded. The fuzzer broke it within minutes. A user could claim, transfer their staked position to a second address, and claim again, because the claim record was keyed by address instead of by position. I wrote a failing test that reproduced the sequence, moved the record onto the position itself, and added a test for transfers between claims. When the auditors reviewed it, they had no high-severity findings in that module. What I took away is to write invariants first, because they find the bugs nobody thought to write a test for.
Behavioral questions
- Tell me about an audit finding you disagreed with. Show you engaged with evidence and accepted it where the auditor was right.
- How would you respond if a live contract you wrote were being exploited? Pause if a mechanism exists, communicate through agreed channels, preserve evidence, and run a postmortem.
- How do you decide a contract is ready to deploy? A checklist: tests, audit fixes verified, deployment rehearsed, monitoring in place, and someone else's sign-off.
Frame these with the structure in the behavioral question guide.
A two-week study plan
- FundamentalsReview accounts, transactions, gas, storage layout, data locations and the low-level call types until you can explain each in two sentences.
- Vulnerability drillsWork through a set of deliberately vulnerable practice contracts. For each, write the attack as a test before writing the fix.
- Build and testWrite a small vault or auction with unit, fuzz and invariant tests, and a deployment script for a testnet.
- Read real audit reportsPublic audit reports show what reviewers flag most often and how findings are written up.
- StoriesPrepare a bug you found, a design trade-off on upgradeability, and how you worked with auditors.
Code review rounds ask you to talk through an attack in order, and gaps in the sequence are easy to miss in your own head. Natively, an AI interview assistant for Mac and Windows, transcribes a mock review session on your computer, so afterwards you can read whether each step of the exploit and the fix was stated clearly. In practice it can read a contract snippet from a screenshot and suggest how to approach the review, and the saved transcripts and notes let you compare sessions as you improve.
Questions people ask
What questions are asked in a blockchain developer interview?
Questions on the EVM account model, gas and storage, Solidity data locations and call types, contract vulnerabilities such as reentrancy and access control, proxy upgrades, testing with fuzzing and invariants, and audits.
How do I explain reentrancy in an interview?
An external call lets the receiving contract call back in before state is updated, so it can withdraw twice. Update state before the call, following checks-effects-interactions, and add a reentrancy guard where needed.
Do blockchain developer interviews include coding?
Usually. Expect to review a short contract for bugs or to write one with tests, often in Solidity, sometimes as a take-home with a test suite.
What should I study for a smart contract interview?
The EVM execution and storage model, common vulnerabilities and their fixes, proxy upgrade patterns and storage layout, gas optimization, and testing with unit, fuzz and invariant tests.
Where to go next
Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.
Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.
