You are designing a new lending protocol. What are the biggest security risks and how do you address them?
What the interviewer wants to hear
- Oracle manipulation and stale prices
- Liquidation design and bad debt during fast price moves
- Reentrancy and unusual token behaviour
- Access control, upgrade and governance risk
- Rounding and precision errors
- Testing, audits, monitoring, caps and pause mechanisms
Model answer
The biggest risk is pricing. I use robust oracles like Chainlink with staleness and deviation checks, never single-pool spot prices, because flash loans make manipulation cheap. Next is solvency: liquidations must work even when prices move fast or gas is high, so I set conservative collateral factors, liquidation bonuses that attract liquidators, and supply and borrow caps per asset, especially for illiquid tokens, to limit bad debt. I follow checks-effects-interactions with reentrancy guards and treat every token as potentially strange: fee-on-transfer, rebasing, callbacks or missing return values, often by allow-listing assets. Rounding always favours the protocol, and I watch for share inflation attacks. Admin and upgrade powers sit behind a multisig and timelock with limited scopes. Testing includes invariant fuzzing, such as total borrows never exceeding deposits, plus multiple audits and a bug bounty. After launch, real-time monitoring and a guardian pause help contain incidents.
Can you answer it under time pressure?
Take a timed hard round and get scored on every answer.
More hard Blockchain Developer questions
- Why have cross-chain bridges been a common target for large hacks, and how would you design a safer cross-chain system?
- What is MEV, and how would you protect your protocol's users from harmful MEV?
- How do you prepare a codebase for a security audit, and what happens after the audit?
- How do you decide what logic and data should live on chain versus off chain in a dApp?
- Your protocol is being exploited right now on mainnet. What do you do in the first hour and afterwards?
- How does EIP-7702 change assumptions that smart contracts and dApps make about EOAs, and what would you change in your code?
- How do you make sure an upgrade to a proxy-based contract does not corrupt storage or break the system?
- You are building an ERC-4626 yield vault. What design and security issues do you consider?
- Your team wants to deploy the same protocol to five EVM chains, including L2s. What can go wrong and how do you prepare?