Start by clarifying the scenario and defining what 'slow' means (latency, throughput, errors). Then walk through a systematic diagnosis: check metrics, logs, and traces to identify the bottleneck, form a hypothesis, and validate it. Finally, propose fixes with trade-offs, and discuss how to prevent recurrence.
Pro tip: Always mention the importance of establishing a baseline and using observability tools before making changes. Also, consider both short-term mitigations (e.g., scaling, caching) and long-term solutions (e.g., code optimization, architecture changes).
Ask clarifying questions to understand the symptoms, scope, and impact. Define what 'slow' means (e.g., increased latency, timeouts, errors) and when it occurs.
Use monitoring tools (metrics, logs, traces) to pinpoint where the slowdown occurs. Check server resources (CPU, memory, I/O, network), application performance, and dependencies.
Based on data, hypothesize the root cause (e.g., database contention, memory leak, inefficient code). Validate with targeted tests or experiments, such as load testing or profiling.
Propose and prioritize solutions, considering short-term mitigations (e.g., scaling, caching) and long-term fixes (e.g., code optimization, architecture changes). Discuss trade-offs of each.
After applying fixes, verify performance improvements and monitor for regressions. Implement preventive measures like better monitoring, auto-scaling, or capacity planning.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.