Skip to content
Tech Interview Prep
Technical interview guide

Web3 Development Tooling & Testing

The frameworks, testing practices, and node infrastructure a blockchain developer actually uses day to day.

Minutes to read
3
Practice MCQs
25
Interview Q&A
25
Edition
v4
Editorial status
Reviewed

Scope: Solidity compiler and security documentation; Hardhat 3; Foundry Forge; ethers v6; EIP-1193; EIP-712; Sourcify verification guidance reviewed 2026-09-04.

Overview

Curated: · Written: · Reviewed:

Web3 Development Tooling & Testing

In one line

Treat a contract system as a state machine with financial consequences: a green test only counts if the source, compiler settings, lockfile, deployed artifact, pinned chain state and retained inputs all agree. Reach for this framing whenever you must show that a test predicts production behaviour.

Key definitions

  • Invariant: a property that must hold after any sequence of valid calls. You state it first, then the test checks it.
  • Handler contract: a Foundry contract whose bounded actions the fuzzer calls, with ghost variables for accounting the contract does not store.
  • Pinned fork: a fork fixed to a block number and chain ID, served by an archive node.
  • Metadata suffix: the trailing CBOR in runtime bytecode. It records compiler metadata, so two builds with identical code can still differ in hash.
  • Domain separator: the EIP-712 hash of name, version, chainId and verifyingContract. It binds a signature to one chain and one contract.

Formulas and complexity

address=keccak256(0xff++factory++salt++keccak256(init_code))[12:]address = keccak256(0xff ++ factory ++ salt ++ keccak256(init\_code))[12:] runtime_size≤24,576 bytes (EIP-170),initcode_size≤49,152 bytes (EIP-3860)runtime\_size \le 24{,}576 \text{ bytes (EIP-170)}, \quad initcode\_size \le 49{,}152 \text{ bytes (EIP-3860)} 12 s/slot×32 slots/epoch×2 epochs=768 s≈12.8 min to finality12 \text{ s/slot} \times 32 \text{ slots/epoch} \times 2 \text{ epochs} = 768 \text{ s} \approx 12.8 \text{ min to finality} cold SSTORE from zero=20,000 gas,non-zero rewrite=5,000 gas\text{cold SSTORE from zero} = 20{,}000 \text{ gas}, \quad \text{non-zero rewrite} = 5{,}000 \text{ gas}

How it works

Source, compiler settings and lockfile produce an artifact with a fixed hash. The deploy plan records chain, deployer, nonce and predicted address before anything is broadcast. Post-deploy, the receipt must match the plan, and verification must reproduce the deployed runtime bytecode. Monitoring then reads canonical state at a pinned block.

Reviewed source and lockfile Pinned solc and optimizer settings Artifact and runtime hash Plan: chain, deployer, nonce, predicted address Broadcast and receipt check Exact-match source verification Monitoring reads pinned canonical state

When to use and when not to

SituationChooseWhy
Heavy fuzz and invariant work on contractsFoundryTests are Solidity, built-in stateful fuzzing, fast shrinking
Indexer, keeper or relayer tests in TypeScriptHardhat or viem layerSame language as off-chain code, mature plugins
Property tests that must cross the contract boundaryNeither aloneKeep properties in Solidity, end-to-end wiring in TypeScript
Reproducing a production bugPinned fork at incident blockReal storage, oracle values and adversary contracts
Signing or deploying from a fresh counterDo notReverted transactions spend their nonce

Traps interviewers probe

  1. Bare expectRevert and vm.assume(amount > 0). The test passes for the wrong reason and hides the zero input that drains the vault. Fix: use vm.expectRevert(Custom.selector) and bound in handlers, and assert the state afterwards.
  2. Unit tests for a sequence bug. Forty passing single-call tests cannot find a deposit, donate, borrow, withdraw sequence. Fix: a stateful invariant campaign with a handler, plus a differential or invariant assertion on share price.
  3. Unpinned fork at latest. A suite that passed Monday fails Tuesday because a pool rebalanced. Fix: pin block number and chain ID, record both with the release, and re-pin when bytecode or layout changes.
  4. Re-deriving CREATE addresses after a revert. A reverted transaction consumes its nonce, so a fresh script lands at different addresses. Fix: resume from the recorded plan with the same nonce and calldata. Use CREATE2 when the address must survive a retry, and remember that its squatting risk is real.
  5. Caching the EIP-712 domain across chainChanged. The signature covers the cached chainId, so a switch to another chain produces a signature that the wrong deployment must reject. Fix: rebuild the domain from the live chainId after every provider event. The contract should recompute the separator from block.chainid and reject mismatches.

Interview tips

Open by naming the state machine and the property the test proves, then name the tool and the trade-off. Expect these follow-ups: walk me through your CI pipeline for a contract repo; a fuzz test found a conservation violation, what do you do in the next hour; how do you test an upgrade against live state; what does the runbook say when the third of five deploy transactions fails.

30-second outline: (1) The chain is source, compiler, artifact, deployment, verification and monitoring, and each link must be reproducible. (2) Foundry for invariant fuzzing, TypeScript for off-chain wiring, both pinned. (3) One incident: a fork test passed but mainnet failed, so the fork was unpinned and the oracle timing was not reproduced. (4) The fix: pin the block, reproduce the incident block, and add a regression seed. (5) State what the test does not prove: it covers the pinned block only, not mempool or MEV behaviour.

Feedback on this overview

Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.