Top 3 Solidity Interview Questions
Browse 3 real-world technical and behavioral interview questions about Solidity. Review scenarios, edge cases, and architectural best practices.
How does a proxy make a deployed contract upgradeable, and what does that put at risk?
The proxy upgradeability pattern keeps state in the proxy and delegates calls to replaceable implementation logic, which makes storage layout, initializers and upgrade admin control the core smart contract security risks. Use this solidity answer to show the decision, trade-off, and evidence rather than a memorised definition.
Walk me through a re-entrancy attack, and how checks-effects-interactions prevents it
A reentrancy attack happens when a smart contract calls an untrusted address before updating its own state, letting the callee enter again and reuse stale balances. The checks-effects-interactions pattern closes that window by validating first, mutating state next and calling out last.
Why does storage layout dominate the gas cost of a contract?
Solidity storage layout dominates gas cost because persistent 32-byte slots are expensive to read and write on every node. Efficient smart contracts pack fields, cache repeated storage reads, avoid unnecessary writes and preserve layout during upgrades.