Interview practice question
Large API responses cause memory spikes
Backend Engineering · Language Runtimes · Intermediate
An export endpoint builds a 500 MB JSON response in memory, causing memory spikes and occasional crashes. How do you fix it?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Stream response incrementally.
- Paginate or cursor-based export.
- Generate async to object storage, return link.
- Stream from DB with cursors.
- Compression on the fly.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.