Performance questions in interviews: how to answer?
Essence
Performance questions test not knowledge of "magic" optimizations but approach: can you find a bottleneck by measuring, explain the cause through how the system works, and verify that the fix helped. A good answer almost always follows "symptom → how I'll measure → likely causes → fix → how I'll verify".
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep