Struggling With EVM Gas Costs in Interviews — How Do SSTORE/SLOAD and Slot Packing Actually Work in Real Projects?
Yesterday’s smart contract interview was quite difficult for me.
I was asked to explain SSTORE vs SLOAD gas costs, warm vs cold access, and when slot packing actually saves gas. I’ve studied these topics, but under pressure the “why behind the numbers” completely vanished.
I understand the basics:
storage writes cost more than reads
EIP-2929 introduced warm/cold access
smaller variables can fit into a single slot
But interviewers usually ask follow-up questions like “When does this matter in real contracts?” or “How would you optimize storage patterns without breaking readability?” — and that’s where I freeze.
Can someone explain this in simple, memorable terms?
Why are storage writes so expensive in the first place?
When does warm/cold access actually appear in real transactions?
Does slot packing always work, or can Solidity reorder things?
How do engineers think about these optimizations at architecture level?
If someone has a clean mental model or cheat-sheet explanation, I’d appreciate it. I want to avoid blanking out again in the next round.