All questions
of 40What is Solidity and what is it used for?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Solidity is a high-level, object-oriented programming language specifically designed for writing smart contracts on Ethereum and other blockchain platforms. It's statically typed and supports inheritance, libraries, and complex user-defined types.
Solidity is primarily used for:
- Creating smart contracts for decentralized applications (DApps)
- Implementing token standards (ERC-20, ERC-721, ERC-1155)
- Building decentralized finance (DeFi) protocols
- Creating decentralized autonomous organizations (DAOs)
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
Explain the difference between `uint` and `int` in Solidity.
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
uintrepresents unsigned integers (positive numbers and zero only)intrepresents signed integers (positive, negative, and zero)
Both come in different sizes: uint8 to uint256 and int8 to int256. The default uint is equivalent to uint256, and int is equivalent to int256.
uint256 public positiveNumber = 100; // Can only store 0 to 2^256 - 1
int256 public anyNumber = -50; // Can store -2^255 to 2^255 - 1
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
What are the main components of a smart contract?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
The main components include:
- State variables: Store data permanently on the blockchain
- Functions: Define contract behavior and interactions
- Events: Enable logging and external notifications
- Modifiers: Reusable code for function validation
- Constructor: Initializes contract state during deployment
contract Example {
uint256 public value; // State variable
constructor(uint256 _initialValue) { // Constructor
value = _initialValue;
}
modifier onlyPositive(uint256 _value) { // Modifier
require(_value > 0, "Value must be positive");
_;
}
function setValue(uint256 _value) public onlyPositive(_value) { // Function
value = _value;
emit ValueChanged(_value); // Event
}
event ValueChanged(uint256 newValue); // Event
}
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
What is the difference between `public`, `private`, `internal`, and `external` visibility modifiers?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
public: Accessible from anywhere (internally, externally, and by derived contracts)private: Only accessible within the same contractinternal: Accessible within the same contract and derived contractsexternal: Only accessible from outside the contract (not internally)
contract VisibilityExample {
uint256 public publicVar; // Auto-generates getter
uint256 private privateVar; // Only this contract
uint256 internal internalVar; // This contract + derived
function externalFunc() external {} // Only external calls
function publicFunc() public {} // Internal + external calls
function internalFunc() internal {} // This contract + derived
function privateFunc() private {} // Only this contract
}
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
Explain the concept of gas in Ethereum and how it relates to Solidity.
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Gas is the computational cost required to execute operations on the Ethereum network. Every operation in Solidity has a gas cost, and users must pay gas fees to execute transactions.
Key concepts:
- Gas Limit: Maximum gas a transaction can consume
- Gas Price: Amount of Ether willing to pay per unit of gas
- Gas Used: Actual gas consumed by the transaction
Different operations have different gas costs:
- Simple operations (addition): ~3 gas
- Storage operations (SSTORE): ~5,000-20,000 gas
- Contract creation: ~32,000 gas + deployment code
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
What are events in Solidity and why are they important?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Events are a way for smart contracts to communicate that something has happened on the blockchain. They are stored in the transaction logs and can be accessed by external applications.
Benefits:
- Cost-effective logging mechanism
- Enable dApp frontend notifications
- Facilitate blockchain indexing and searching
- Provide audit trail for contract interactions
contract Token {
event Transfer(address indexed from, address indexed to, uint256 value);
function transfer(address to, uint256 amount) public {
// Transfer logic here
emit Transfer(msg.sender, to, amount);
}
}
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
What are mappings and how do they work?
What is the difference between arrays and mappings?
Explain the difference between `view`, `pure`, and regular functions.
What is the difference between `msg.sender` and `tx.origin`?
Explain the difference between `require`, `assert`, and `revert`.
Explain the difference between storage, memory, and calldata.
Explain fixed-size vs dynamic arrays in Solidity.
What are function modifiers and how are they used?
What are function overloading and function selectors?
What is the fallback function and receive function?
How does inheritance work in Solidity?
What are interfaces and how are they different from abstract contracts?
Explain the `virtual` and `override` keywords.
What is the difference between `transfer`, `send`, and `call` for sending Ether?
What are some gas optimization techniques in Solidity?
Explain storage slots and how variables are packed.
What are libraries and how do they differ from contracts?
How do you handle errors and exceptions in Solidity?
What are some testing strategies for smart contracts?
How do you debug smart contracts?
What are oracles and why are they needed?
What is the reentrancy attack and how can it be prevented?
What are some common security vulnerabilities in smart contracts?
What are proxy patterns and why are they used?
What is inline assembly and when would you use it?
Explain the CREATE and CREATE2 opcodes.
What are delegate calls and how do they work?
What is the diamond pattern (EIP-2535)?
What are meta-transactions and how do they work?
Explain flash loans and their implementation.
What are state channels and how do they work?
What is MEV (Maximum Extractable Value) and how does it affect smart contracts?
How do you implement access control patterns beyond simple ownership?
What are the latest developments in Solidity and Ethereum that developers should know about?
This answer is part of Pro.
The full written answer, with the trade-offs and follow-ups an interviewer will probe.
No matches
Try a different filter or search term.
Solidity cheatsheet
Solidity Technical Interview Cheat Sheet
- Summary01
- 1. Basics02
- 2. Data Types03
- 3. Functions04
- 4. Custom Modifiers05
- 5. State Variables & Visibility06
- 6. Control Structures07
- 7. Error Handling08
- 8. Events09
- 9. Inheritance10
- 10. Interfaces & Abstract Contracts11
- 11. Libraries12
- + 10 more inside
34 of 40 Solidity answers are gated.
Full answers, code samples, AI explanations - simpler, deeper, or as an interactive diagram. Cancel anytime.
- Full answers + code
- AI explain - simpler, deeper, or visualized
- 1,000 AI credits / month
- Cancel anytime
Change topic
Pick a different technology or stack. Your current topic stays put until you choose a new one.
MEAN
MongoDB, Express, Angular, Node.jsMERN
MongoDB, Express, React, Node.jsLAMP
Linux, Apache, MySQL, PHPRuby on Rails
Convention over ConfigurationJAM
JavaScript, APIs, and MarkupServerless on AWS
Serverless Architecture on AWSInterviewers also test these - they're common to every stack, whichever one you picked above.
Flutter Mobile
Flutter Cross-Platform Mobile DevelopmentInterviewers also test these - they're common to every stack, whichever one you picked above.
Spring Boot
Enterprise Java Development.NET
Microsoft EcosystemVue
Vue.js, Vite, TypeScript, Tailwind, Node.jsGo Backend
Golang, gRPC, PostgreSQL, Redis, RabbitMQFastAPI
Python, FastAPI, SQLAlchemy, PostgreSQLReact Native
React, TypeScript, Redux, FirebaseiOS Native
Swift, SwiftUI, UIKit, FirebaseAndroid Native
Java, Jetpack Compose, FirebaseWeb3 / Ethereum
Solidity, Ethereum, Hardhat, FoundryDevOps / Platform
Docker, Kubernetes, Terraform, CI/CDCore SWE Interview Prep
Data structures, algorithms, OS, concurrency, networking, gitInterviewers also test these - they're common to every stack, whichever one you picked above.
Interviewers also test these - they're common to every stack, whichever one you picked above.