Interview practice question
A counter row causes contention
Backend Engineering · Relational Databases · Intermediate
Every page view increments a counter in one row, and the database shows heavy lock waits. How do you fix it?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Single hot row serialises writes.
- Batch increments in memory/Redis.
- Sharded counter rows.
- Async aggregation.
- Accept approximate counts.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.