top of page
  • Writer's pictureJeffrey Scholz

Solidity Interview Questions

Updated: 3 days ago

Over 100 interview questions for Ethereum Developers

All of these questions can be answered in three sentences or less.


  1. What is the difference between private, internal, public, and external functions?

  2. Approximately, how large can a smart contract be?

  3. What is the difference between create and create2?

  4. What major change with arithmetic happened with Solidity 0.8.0?

  5. What special CALL is required for proxies to work?

  6. Prior to EIP-1559, how do you calculate the dollar cost of an Ethereum transaction?

  7. What are the challenges of creating a random number on the blockchain?

  8. What is the difference between a Dutch Auction and an English Auction?

  9. What is the difference between transfer and transferFrom in ERC20?

  10. Which is better to use for an address allowlist: a mapping or an array? Why?

  11. Why shouldn’t tx.origin be used for authentication?

  12. What hash function does Ethereum primarily use?

  13. How much is 1 gwei of Ether?

  14. How much is 1 wei of Ether?

  15. What is the difference between assert and require?

  16. What is a flash loan?

  17. What is the check-effects pattern?

  18. What is the minimum amount of Ether required to run a solo staking node?

  19. What is the difference between fallback and receive?

  20. What is reentrancy?

  21. As of the Shanghai upgrade, what is the gas limit per block?

  22. What prevents infinite loops from running forever?

  23. What is the difference between tx.origin and msg.sender?

  24. How do you send Ether to a contract that does not have payable functions, or a receive or fallback?

  25. What is the difference between view and pure?

  26. What is the difference between transferFrom and safeTransferFrom in ERC721?


  1. What is the difference between transfer and send? Why should they not be used?

  2. How do you write a gas-efficient for loop in Solidity?

  3. What is a storage collision in a proxy contract?

  4. What is the difference between abi.encode and abi.encodePacked?

  5. uint8, uint32, uint64, uint128, uint256 are all valid uint sizes. Are there others?

  6. What changed with block.timestamp before and after proof of stake?

  7. What is frontrunning?

  8. What is a commit-reveal scheme and when would you use it?

  9. Under what circumstances could abi.encodePacked create a vulnerability?

  10. How does Ethereum determine the BASEFEE in EIP-1559?

  11. What is the difference between a cold read and a warm read?

  12. How does an AMM price assets?

  13. What is the effect on gas of making a function payable?

  14. What is a signature replay attack?

  15. What is gas griefing?

  16. How would you design a game of rock-paper-scissors in a smart contract such that players cannot cheat?

  17. What is the free memory pointer and where is it stored?

  18. What function modifiers are valid for interfaces?

  19. What is the difference between memory and calldata in a function argument?

  20. Describe the three types of storage gas costs.

  21. Why shouldn’t upgradeable contracts use the constructor?

  22. What is the difference between UUPS and the Transparent Upgradeable Proxy pattern?

  23. What danger do ERC777 tokens pose?

  24. What is a bonding curve?

  25. How does safeMint differ from mint in the OpenZeppelin ERC721 implementation?

  26. What keywords are provided in Solidity to measure time?

  27. What is a sandwich attack?

  28. What is a gas efficient alternative to multiplying and dividing by a multiple of two?

  29. How large a uint can be packed with an address in one slot?

  30. Which operations give a partial refund of gas?

  31. What is ERC165 used for?

  32. What is a slippage parameter useful for?


  1. How does fixed point arithmetic represent numbers?

  2. What is an ERC20 approval frontrunning attack?

  3. What opcode accomplishes address(this).balance?

  4. How many arguments can a solidity event have?

  5. What is an anonymous Solidity event?

  6. Under what circumstances can a function receive a mapping as an argument?

  7. What is an inflation attack in ERC4626

  8. How many arguments can a solidity function have?

  9. How many storage slots does this use? uint64[] x = [1,2,3,4,5]? Does it differ from memory?

  10. Prior to the Shanghai upgrade, under what circumstances is returndatasize() more efficient than push zero?

  11. Why does the compiler insert the INVALID op code?

  12. What is the difference between how a custom error and a require with error string is encoded at the EVM level?

  13. What is the kink parameter in the Compound DeFi formula?

  14. How can the name of a function affect its gas cost, if at all?

  15. What is a common vulnerability with ecrecover?

  16. What is the difference between an optimistic rollup and a zk-rollup?

  17. How does EIP1967 pick the storage slots, how many are there, and what do they represent?

  18. How much is one Sazbo of ether?

  19. Under what circumstances would a smart contract that works on Etheruem not work on Polygon or Optimism? (Assume no dependencies on external contracts)

  20. How can a smart contract change its bytecode without changing its address?

  21. What is the danger of putting msg.value inside of a loop?

  22. Describe the calldata of a function that takes a dynamic length array of uint128 when uint128[1,2,3,4] is passed as an argument

  23. Why is strict inequality comparisons more gas efficient than ≤ or ≥? What extra opcode(s) are added?

  24. What is the relationship between variable scope and stack depth?

  25. What is an access list transaction?

  26. Why is it necessary to take a snapshot of balances before conducting a governance vote?

  27. How can a transaction be executed without a user paying for gas?

  28. In solidity, without assembly, how do you get the function selector of the calldata?

  29. How is an Ethereum address derived?

  30. What is the metaproxy standard?

  31. Under what circumstances do vanity addresses (leading zero addresses) save gas?


  1. What addresses to the ethereum precompiles live at?

  2. How does Solidity manage the function selectors when there are more than 4 functions?

  3. How does ABI encoding vary between calldata and memory, if at all?

  4. What is the difference between how a uint64 and uint256 are abi-encoded in calldata?

  5. What is read-only reentrancy?

  6. If you deploy an empty Solidity contract, what bytecode will be present on the blockchain, if any?

  7. How does the EVM price memory usage?

  8. What is stored in the metadata section of a smart contract?

  9. What is the uncle-block attack from an MEV perspective?

  10. How do you conduct a signature malleability attack?

  11. Under what circumstances do addresses with leading zeros save gas and why?

  12. What is the difference between payable(msg.sender).call{value: value}(””) and{value: value}(””)?

  13. How many storage slots does a string take up?

  14. How does the --via-ir functionality in the Solidity compiler work?

  15. Are function modifiers called from right to left or left to right, or is it non-deterministic?

  16. If you do a delegatecall to a contract and the opcode CODESIZE executes, which contract size will be returned?

  17. Why is it important to ECDSA sign a hash rather than an arbitrary bytes32?

  18. Describe how symbolic manipulation testing works.

  19. What is the most efficient way to copy regions of memory?

  20. How can you validate on-chain that another smart contract emitted an event, without using an oracle?

  21. When selfdestruct is called, at what point is the Ether transferred? At what point is the smart contract's bytecode erased?

  22. Why did Solidity deprecate the "years" keyword?

  23. What does the verbatim keyword do, and where can it be used?

  24. How much gas can be forwarded in a call to another smart contract?

  25. What does an int256 variable that stores -1 look like in hex?

  26. What is the use of the signextend opcode?

  27. Why do negative numbers in calldata cost more gas?

Learn more

Take our Solidity Bootcamp to deepen your knowledge of Ethereum smart contract development.

211 views0 comments

Recent Posts

See All

We will demonstrate a step-by-step exploration of a basic zk-dapp designed for verifying additions. This application enables users to prove that the sum of two numbers, X and Y, equals Z without discl