Blockchain Quiz

quiz

Blockchain Quiz channel for Web3 learners and professionals: practice blockchain, DeFi, NFT, smart contract, and blockchain security quiz questions with answers

  • Difficulty - Medium
    Total Plays - 3
    Allowed Time - 10 sec
    Best time - 3.850 sec
    #A
    #B
    #C
    #D
    Explanation:
    immutable variables are assigned once (typically in the constructor) and then become read-only. They are stored in bytecode rather than regular storage slots, which can reduce gas compared to storage reads. This matters in Solidity interviews because immutables are common in optimized contracts (e.g., router addresses) and in secure configuration patterns.
  • Difficulty - Medium
    Total Plays - 5
    Allowed Time - 10 sec
    Best time - --

    Which storage type enables EIP-1167 minimal clones to be cheap?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    Minimal proxy clones (EIP-1167) keep logic in an implementation and rely on proxy bytecode forwarding calls, making deployment cheap. In practice, immutables in the implementation help keep runtime reads efficient and reduce repeated storage reads for configuration-like values. Candidates are often tested on why clones save gas and how configuration is safely handled.
  • Difficulty - Medium
    Total Plays - 5
    Allowed Time - 10 sec
    Best time - 1.736 sec

    Which pattern most directly reduces reentrancy risk on external transfers?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    The Checks-Effects-Interactions (CEI) pattern reduces reentrancy by making you validate inputs and update internal state before any external call (like ETH transfer or token transfer). If a malicious contract re-enters, state has already moved forward, limiting exploitability. Many interviewers treat CEI as a must-know Solidity security habit for production contracts
  • Difficulty - Medium
    Total Plays - 3
    Allowed Time - 10 sec
    Best time - --

    In EVM, which opcode can silently fail and return a boolean instead of reverting?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    Low-level CALL (and friends like DELEGATECALL) returns a success flag rather than automatically bubbling a revert. If you don’t check that boolean (or decode return data properly), your contract may continue in a “success-looking” state while the external call actually failed. This is a classic Solidity audit finding tied to unsafe external interactions.
  • Difficulty - Medium
    Total Plays - 25
    Allowed Time - 10 sec
    Best time - --

    Which audit signal indicates poor threat modeling?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    A happy-path-only focus is a strong signal of poor threat modeling in blockchain security because it ignores attacker behavior, edge cases, and abuse scenarios. Strong smart contract audit readiness requires adversarial thinking, not just normal-flow testing.
  • Difficulty - Medium
    Total Plays - 16
    Allowed Time - 10 sec
    Best time - --

    Which audit issue is most often downgraded incorrectly?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    Front-running is often downgraded incorrectly in smart contract audits because teams underestimate MEV and mempool-based exploitability. In DeFi security, transaction ordering attacks can cause repeated economic loss even without a classic code exploit.
  • Difficulty - Medium
    Total Plays - 14
    Allowed Time - 10 sec
    Best time - --

    Which finding has highest real-world exploit probability?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    Access control bugs often have the highest real-world exploit probability in smart contracts because attackers can directly call privileged functions when role checks fail. In blockchain security audits, broken authorization logic is a common cause of fund loss and protocol takeover.
  • Difficulty - Medium
    Total Plays - 31
    Allowed Time - 10 sec
    Best time - 0.900

    Which opcode is deprecated but still callable?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    CALLCODE is deprecated due to unsafe context handling. It remains callable for backward compatibility but should never be used in new designs.
  • Difficulty - Medium
    Total Plays - 18
    Allowed Time - 10 sec
    Best time - 1.367

    Which opcode differentiates EOAs from contracts?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    EXTCODESIZE returns zero for EOAs and non-zero for deployed contracts. This distinction is commonly used for contract detection, though it has edge cases.
  • Difficulty - Medium
    Total Plays - 21
    Allowed Time - 10 sec
    Best time - 1.582 sec

    Which opcode returns remaining gas?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    GASLEFT returns the amount of gas remaining in the current execution context. It is commonly used for gas-aware logic and debugging.
  • Difficulty - Medium
    Total Plays - 18
    Allowed Time - 10 sec
    Best time - 3.422

    Which type consumes exactly one storage slot regardless of value?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    bytes32 always occupies a full 32-byte storage slot. Smaller types may be packed together, but bytes32 always stands alone.
  • Difficulty - Medium
    Total Plays - 16
    Allowed Time - 10 sec
    Best time - 1.200

    Why does storage write order matter for structs?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    Solidity packs struct variables tightly into storage slots based on declaration order. Reordering fields can change slot boundaries and break upgrade compatibility.
  • Difficulty - Medium
    Total Plays - 13
    Allowed Time - 10 sec
    Best time - 0.784

    What determines the base slot of a mapping?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    The base slot of a mapping is derived using keccak256(key . slot). This hashing ensures unique storage locations per key without collisions.
  • Difficulty - Medium
    Total Plays - 11
    Allowed Time - 10 sec
    Best time - 5.093

    Which operation causes storage slot re-packing?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    Changing variable types alters how Solidity packs them into storage slots. This can shift offsets and corrupt existing storage layouts in upgradeable contracts.
  • Difficulty - Medium
    Total Plays - 17
    Allowed Time - 10 sec
    Best time - 1.638

    Which data location is read-only by default?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    Calldata is immutable and cannot be modified by the callee. This makes it gas-efficient and safe for external function inputs
  • Difficulty - Medium
    Total Plays - 15
    Allowed Time - 10 sec
    Best time - 1.548 sec

    What happens to storage slots after contract self-destruct?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    Storage is not automatically wiped when a contract self-destructs. The data remains on-chain and can be accessed again if a contract is redeployed at the same address.
  • Difficulty - Medium
    Total Plays - 19
    Allowed Time - 10 sec
    Best time - 1.455

    Why is bytes32 cheaper than string in storage?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    bytes32 has a fixed 32-byte size and fits into a single storage slot. string is dynamically sized and requires additional storage pointers and length metadata.
  • Difficulty - Medium
    Total Plays - 21
    Allowed Time - 10 sec
    Best time - 3.228

    Which operation resets a dynamic array length to zero?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    Using delete on a dynamic array sets its length to zero. Storage slots may remain allocated but become inaccessible through the array.
  • Difficulty - Medium
    Total Plays - 18
    Allowed Time - 10 sec
    Best time - 3.454

    What does delete do to a mapping entry?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    Deleting a mapping key resets its value to the default type value. The key itself still exists conceptually since mappings do not track keys.
  • Difficulty - Medium
    Total Plays - 17
    Allowed Time - 10 sec
    Best time - 1.444

    Which data location persists across transactions?

    Tip: Click "Play" to reveal options and start playing.

    #A
    #B
    #C
    #D
    Explanation:
    Storage persists on-chain across transactions and blocks. Memory and calldata are temporary and cleared after execution completes.