InterviewStack.io LogoInterviewStack.io

Debugging, Testing, and Optimization Questions

Core engineering skills for identifying, diagnosing, testing, and improving code correctness and performance. Covers approaches to finding and fixing bugs including reproducible test case construction, logging, interactive debugging, step through debugging, and root cause analysis. Includes testing strategies such as unit testing, integration testing, regression testing, test driven development, and designing tests for edge cases, boundary conditions, and negative scenarios. Describes performance optimization techniques including algorithmic improvements, data structure selection, reducing time and space complexity, memoization, avoiding unnecessary work, and parallelism considerations. Also covers measurement and verification methods such as benchmarking, profiling, complexity analysis, and trade off evaluation to ensure optimizations preserve correctness and maintainability.

EasyTechnical
67 practiced
What is test driven development (TDD)? Describe a short workflow for adding a new feature using TDD in an agile sprint, including how you would balance failing tests, refactoring, and collaboration with product/design stakeholders.
MediumSystem Design
62 practiced
Design a lightweight profiling strategy to measure request latency distribution for a web API that serves 10k RPS. Discuss sampling rate, overhead limits, where to collect traces, and how to aggregate and visualize hotspots without storing full traces for every request.
EasyTechnical
54 practiced
Write unit tests in Python using pytest for the following function signature: def normalize_username(s: str) -> str. The function should trim whitespace, lower-case the string, and replace consecutive internal spaces with a single underscore. Provide 5 test cases including edge, empty, and unicode inputs.
EasyTechnical
67 practiced
Given a function that sometimes throws an exception deep in a library, explain how you would instrument the codebase to get a stack trace and contextual variables without changing the library code. Describe approaches for Python, Java, or Node.js environments.
MediumTechnical
95 practiced
Describe an approach to measure the real-world impact of changing a sorting algorithm used in a user-facing list UI from O(n log n) to a specialized O(n) algorithm for typical inputs. Include A/B testing, telemetry, and fallbacks if the specialized algorithm fails for some inputs.

Unlock Full Question Bank

Get access to hundreds of Debugging, Testing, and Optimization interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.