Code reviewInterview preparation
Intermediate·Concept·2 min read

How do I check performance?

Practice this question

Short explanation:

A performance review checks whether the amount of work stays reasonable as input size and traffic increase. Database calls, large allocations and synchronous CPU work can be more important than small syntax choices. Use measurements for suspected hotspots rather than adding optimizations everywhere.

Key points:

  • Look for queries in loops, unbounded lists and CPU-heavy synchronous work.

  • Inspect generated SQL, query plans and selected fields.

  • Measure before adding caching or memoization.

  • Estimate query count for one request with 100 items and consider whether every selected field is actually used.

Interview point:

  • Explain how the cost grows and which resource becomes constrained, then propose a measurable fix.
Adapted from 11_AI_CODE_REVIEW.md · “How do I check performance?”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.