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.

Read
48 min
Practice MCQs
25
Interview Q&A
25
Edition
v3
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.

Curated: · Written: · Reviewed:

25 questions

MCQ-1A contract is deployed from source compiled with solc 0.8.24, optimizer enabled at 200 runs, default metadata settings. A verifier recompiles the same source file with solc 0.8.24 and the same optimizer settings; the runtime bytecode matches byte-for-byte except for the trailing metadata suffix, so the creation bytecode hash differs. What most likely explains the mismatch?
MCQ-2A team's Solidity contract compiles to 22,410 bytes of deployed runtime bytecode with the optimizer enabled at 200 runs. To cut runtime gas on a hot path they rebuild the same source with the same solc version but set optimizer runs to 10,000. The new artifact is 26,180 bytes, and the mainnet deployment transaction reverts. What is the cause?
MCQ-24`Vault.sol` compiles to 24,300 bytes of runtime bytecode. A PR adds a `sweep()` function and a longer revert string, growing runtime code by 340 bytes. CI fails the build because `forge build --sizes` reports the new size over the EIP-170 limit, but the team overrides the check and deploys to Ethereum mainnet. What happens?
MCQ-23A DeFi team audits and deploys a contract from commit `abc123`. The repo commits `package.json` and `hardhat.config.ts` (which pins `solidity: "0.8.24"`, the audited optimizer settings and the same `viaIR` flag) and the sources use `pragma solidity 0.8.24;`. `.gitignore` excludes `package-lock.json`, `artifacts/` and `cache/`. `package.json` declares `"@openzeppelin/contracts": "^5.0.0"`, and the deploy script uses `ethers`. In March, a clean clone in the CI container at `/build/app` ran `npm install && npx hardhat compile` and produced runtime bytecode with hash `0x9f3c…`; that build was audited and deployed. In July the same commit is cloned into the same container image at the same path, and the same two commands produce hash `0x41ab…`. The two artifacts differ by 412 bytes spread through the runtime code, not only in the trailing metadata. `npm ls @openzeppelin/contracts` now prints `5.1.0`; the lockfile kept in the audit bundle recorded `5.0.2`. Which explanation and fix fits?
MCQ-20A team deploys a contract compiled with solc 0.8.24, optimizer enabled at 200 runs, and verifies it on Sourcify: the result is `exact_match`. Three months later they redeploy the same git commit to a second chain from a CI job that copies the sources into a temp directory before compiling. Sourcify now returns `match`, and the two deployments' runtime bytecode differs only in the trailing CBOR metadata. The source files themselves are byte-identical. What explains the difference?
MCQ-18A deploy script writes a plan before broadcasting: chain id 1, deployer 0x71C7…9aF2, nonce 47, artifact hash 0x3d1e…, and a predicted contract address 0x4c2B…8e01 derived from the deployer and nonce. The broadcast transaction is mined with status 1, but the receipt shows nonce 48 and a contract created at 0x9fA0…77b3, so the post-deploy address check fails. What is the correct diagnosis?
MCQ-19A factory at 0x1234567890AbcdEF1234567890aBcdef12345678 deploys minimal-proxy wallets with CREATE2. Wallet #1 was deployed with salt 0x0000000000000000000000000000000000000000000000000000000000000001 and init code C, landing at 0x9f8A1b2C3d4E5f60718293a4B5c6D7e8F9012345. The factory's nonce is now 1. A developer copies the deployment script, changes only the signing EOA, and runs it again with the same salt and the same init code C. What happens?
MCQ-4A `Vault` contract has `deposit()` and `withdraw(uint256)`. In a unit test, `alice` calls `vault.deposit{value: 1 ether}()`; the call succeeds and uses 43,210 gas. The test then calls `vault.withdraw(1 ether)` from `bob` and the call reverts. A reviewer mutates the contract so that (1) `deposit` credits `bob` instead of `alice`, (2) `deposit` emits no `Deposited` event, and (3) `withdraw` lets `bob` drain the vault. The current test still passes because it only asserts `deposit` did not revert. Which assertion set would fail for all three mutations?
MCQ-5A vault's Foundry suite has run this test in CI for months with `fuzz.runs = 256`, and it has never failed: ```solidity function testFuzz_withdraw(uint256 amount) public { vm.assume(amount > 0); vault.withdraw(amount); } ``` In production a caller passes `amount = 0` and drains the vault: `withdraw` mints shares before it checks the amount. Re-running the test locally with `--fuzz-runs 100000` still passes. What explains the miss?
MCQ-10A vault holds 100 ETH. Its withdraw function is: ```solidity // Solidity 0.8.24 function withdraw(uint256 amt) external { require(balances[msg.sender] >= amt, "insufficient"); (bool ok, ) = msg.sender.call{value: amt}(""); require(ok, "send failed"); unchecked { balances[msg.sender] -= amt; } } ``` The 42-test suite reports 100% line, 100% branch and 100% function coverage for the vault. After deploy, an attacker's contract deposits 1 ETH and, in one transaction, reenters withdraw until the vault's 100 ETH is gone. Which statement explains why the coverage report did not catch this?
MCQ-6A lending protocol's test suite has 40 unit tests that each call one function with fixed arguments, plus a stateless fuzzer that hammers `deposit(uint256)` with random amounts. All 40 pass and the fuzzer finds nothing. Two weeks after mainnet launch, an attacker calls `deposit(1)`, then `donate(1_000_000e18)` to inflate the share price, then `borrow()` against the inflated collateral, then `withdraw()`: draining 3.2M USDC. The team adds a test that replays those four calls in that order and it passes. What should they have run instead to have caught this before launch?
MCQ-7A rollup team ports a Solidity function to Rust. Their differential fuzzer runs 50,000 random inputs through both implementations, comparing return values and revert data byte-for-byte and diffing emitted logs, and reports 1,240 mismatches. Triage: 1,238 are the Rust port formatting revert strings differently and emitting logs in a different order; 2 are arithmetic differences on inputs where an intermediate product exceeds 2^256. What is the right reading of this run?
MCQ-8A Foundry fork test forks mainnet at `latest`, impersonates a whale holding 5,000,000 USDC, and asserts that swapping 1,000,000 USDC into a Uniswap v3 pool moves the price by less than 0.5%. It passed Monday. On Wednesday the same commit fails: the whale's balance reads 3,000,000 USDC and the swap moves the price 3.1%. The RPC endpoint and the test code are unchanged. What should the team do?
MCQ-9A team forks Ethereum mainnet at block 21,000,000 with Anvil and tests a liquidation bot against a lending market. At that block the Chainlink ETH/USD feed returns $3,412.50, and the target account holds 10 WETH against 30,000 USDC of debt at an 82.5% liquidation threshold: liquidatable, and the bot's fork simulation nets $1,240. The bot decides by simulating against the fork's RPC and then submitting to mainnet. In production the first six liquidation transactions it submits revert with 'health factor above 1', and the account still shows its full 30,000 USDC debt and 10 WETH. What did the fork fail to reproduce?
MCQ-11A team runs Slither with its default detectors on a 3,000-line vault before an audit. It reports five findings, and the team reads the code behind each: 1. `withdraw()` sends ETH with `msg.sender.call{value: amount}("")` and only then sets `balances[msg.sender] = 0`. The function carries `nonReentrant`, and so does every other external function that touches `balances`. Slither: `reentrancy-eth`. 2. `claim()` calls `require(token.transfer(to, amount))`. Slither: `unchecked-transfer`. 3. `settle()` carries no modifier. It reads `settled[msg.sender]` to reject double-settlement, sends `msg.sender.call{value: fee}("")`, then sets `settled[msg.sender] = true`. Slither: `reentrancy-eth`. 4. `payout()` calls `token.transfer(to, amount)` and ignores the returned bool, while its accounting assumes the transfer succeeded. The protocol accepts any ERC-20, including ones that return `false` instead of reverting. Slither: `unchecked-transfer`. 5. `poke()` calls `oracle.getPrice()` (declared `view`) and then writes `lastPokeTime = block.timestamp`; `lastPokeTime` is never read anywhere in the codebase. Slither: `reentrancy-benign`. How many of the five findings identify a defect that must be fixed before the audit?
MCQ-12A team formally verifies a vault contract with a symbolic executor. They write 14 properties, including 'sum of user balances equals totalSupply' and 'only the owner can call withdraw'. The tool reports all 14 proved. The model treats external calls as atomic and does not model reentrancy. They deploy; an attacker reenters withdraw and drains 3,200 ETH before balances update. Which statement best explains why the verifier's pass did not prevent the loss?
MCQ-13A portfolio dashboard reads three things from an Ethereum node: the user's USDC balance, the USDC allowance granted to a router, and the router's current exchange rate. Each read is a separate `eth_call` sent with the default `latest` tag. During a busy block, the balance read lands on block N, the allowance read on block N+1, and the rate read on block N+2. The dashboard then shows a balance and allowance that never coexisted on chain, and a user acting on it gets a revert. What change actually removes this class of inconsistency?
MCQ-14A bot simulates a swap with eth_call pinned to block N, using the same from, to, data and value it then signs. The call returns a well-formed result, the bot broadcasts, and the transaction is included two blocks later and reverts with a slippage error. What accounts for the difference?
MCQ-15An indexer has processed logs through block 1002 and credited 12 deposits. It stores block_number, block_hash, log_index, and tx_hash for each event. A reorg replaces blocks 1000–1002 with a new chain; the new block 1002 has block 999 as its parent. What should the indexer do before processing the replacement blocks?
MCQ-25At the start of a block, a Uniswap V2 WETH/USDC pair holds reserves of 1,000 WETH and 1,800,000 USDC. At index 4 of that block a router call swaps exactly 60 WETH for USDC through the same pair. At index 47 a router call swaps exactly 1 WETH for USDC, with `amountOutMin`, the slippage limit, set to 1,780 USDC, and the transaction reverts with `UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT`. Amounts are integers and every division in the pair floors. Which USDC amount did the router compute for the index-47 swap and compare against `amountOutMin`?
MCQ-3A dapp's client ships with the ABI for implementation v1, which exposes `withdraw(uint256)`. The team deploys v2 behind the same proxy address; v2 renames the function to `withdrawTo(uint256)`, keeps identical logic, exposes `withdrawTo(uint256)` and `deposit()`, and has no fallback function. The client is not updated and sends a transaction calling `withdraw(1e18)`. What happens?
MCQ-21A team upgrades an upgradeable contract behind an ERC-1967 proxy. The V1 implementation's storage began with `address owner; uint256 totalSupply; uint256 balances;` and V2's implementation begins with `uint256 totalSupply; address owner; uint256 balances;`. The upgrade transaction succeeds and no revert occurs, but after it, `owner()` returns the address that previously held the largest balance and `totalSupply()` returns a small address-shaped number. What is the cause?
MCQ-22A protocol's deployer EOA can upgrade a proxy holding $40M in TVL. Its private key is a GitHub Actions repository secret, and the release workflow runs on GitHub-hosted runners that call three third-party actions pinned to version tags. The team wants a single compromised runner to be unable to produce a valid upgrade. Which change achieves that?
MCQ-16A marketplace dapp holds one EIP-1193 provider and builds its EIP-712 domain once per page load, caching it in module state: { name: 'Market', version: '1', chainId: 1, verifyingContract: 0x9d2f... }. Its chainChanged listener only repaints the network badge. On every chain the Market contract recomputes its domain separator from block.chainid when verifying, and rejects the order unless ecrecover's result equals the order's seller. A seller loads the page while the wallet is on mainnet and signs order 4412 (3 WETH for 7,200 USDC); the wallet hashes the order against the cached domain and returns the signature. She then switches the wallet to Base (chainId 8453, announced as '0x2105'), where Market is deployed at 0x3a91..., and the dapp submits that same signature in an eth_sendTransaction to the Base deployment. What is the result of that transaction?
MCQ-17A team deploys the same `ERC20Permit` source to Ethereum mainnet (chain ID 1) and to an OP Stack L2 (chain ID 10). The constructor builds the domain separator with `abi.encode(DOMAIN_TYPEHASH, keccak256("USDX"), keccak256("1"), 1, address(this))` (the chain ID argument is the literal `1`, left over from the mainnet source) and stores it in an `immutable`. The contract lands at the same address on both chains. A user signs a permit on the L2 with nonce 0 and a deadline one hour out. Before the deadline, someone submits that exact signature to the mainnet contract, where the user also holds USDX and has nonce 0. What happens?