Solidity interview: Overflow/Underflow handling — 0.8 checks, SafeMath, and upgradeable contract gotchas
I’m prepping for a Solidity interview and got stuck when they asked about integer overflow/underflow.
I know Solidity 0.8+ has built-in overflow checks, but the interviewer didn’t stop there. They kept asking:
Is SafeMath (OpenZeppelin style) still relevant anywhere today, or is it purely legacy?
When do people use unchecked in real projects, and how do you defend that decision in an interview?
Any realistic “gotchas” when contracts are upgradeable and logic changes over time (or when teams update compiler versions across releases)?
I’d love a practical interview-ready explanation — not just theory. If you’ve seen real cases (or common interview traps), please share.