Compare ERC-20, ERC-721 and ERC-1155. When would you use each?
What the interviewer wants to hear
- ERC-20 is for fungible tokens where every unit is the same
- ERC-721 is for unique tokens, each ID has one owner
- ERC-1155 handles many token types, fungible and non-fungible, in one contract
- ERC-1155 supports batch transfers and saves gas
- Safe transfer callbacks in 721 and 1155 need care
Model answer
ERC-20 is the standard for fungible tokens, where every unit is interchangeable, like a stablecoin or governance token. It defines balanceOf, transfer, approve, transferFrom and allowance, plus Transfer and Approval events. ERC-721 is for non-fungible tokens: each token ID is unique and has exactly one owner, which suits art, tickets or property deeds, and it has metadata through tokenURI. ERC-1155 is a multi-token standard where one contract manages many IDs, and each ID can have any supply, so a game can have gold coins and unique swords together. It supports batch transfers and balance queries, which cuts gas a lot. I pick ERC-20 for currencies, ERC-721 when each item is truly unique and needs wide marketplace support, and ERC-1155 for games or editions. With 721 and 1155, I remember that safe transfers call the receiver, which is a reentrancy point.
Can you answer it under time pressure?
Take a timed easy round and get scored on every answer.
More easy Blockchain Developer questions
- Explain what a blockchain is to someone who is not technical.
- What is a smart contract, and what are its main limitations?
- What is the ERC-20 standard and what are its key functions and events?
- What is the difference between proof of work and proof of stake?
- Describe the basic architecture of a decentralised application (dApp).
- How does a crypto wallet work, and what is the role of the private key and the seed phrase?
- How are transaction fees calculated on Ethereum today?
- What are Layer 2 networks, and why are they important for Ethereum?
- What are events in Solidity, and how do you use them in a real project?