Algorithm analysis is a core interview skill because it shows whether you can reason about scalability before optimizing code. Interviewers want to see that you can estimate runtime, memory usage, and pinpoint the operation that dominates performance.
Explain how you would calculate time complexity and space complexity for an algorithm, and how you would identify its bottleneck.
Address these sub-questions:
Give a practical interview-style explanation rather than a formal proof. You should define the concepts, walk through how to analyze code step by step, and use small code examples to show how bottlenecks are identified.