How To Review Code In Interviews
A practical checklist for reviewing interview code: correctness, edge cases, readability, complexity, maintainability, and testing.
Interview Prep
Practice finding bugs, design flaws, performance issues, and maintainability problems in real interview-style Java and Python code.
Start Here
Learn the checklist: correctness, edge cases, complexity, readability, maintainability, and design.
Showing 22 of 22 questions
A practical checklist for reviewing interview code: correctness, edge cases, readability, complexity, maintainability, and testing.
Review a Python function that accidentally shares a default list across calls.
Review Java code that compares strings or objects using == instead of equals().
Review Java code that removes items from a collection inside an enhanced for-loop.
Review Python code that catches every exception and hides failures.
Review Java code that assumes inputs and object fields are never null.
Review a Python class that accidentally shares a mutable list across all instances.
Review Java code that uses a mutable object as a HashMap key and causes lookups to fail after the key changes.
Review Python code where missing type hints make the function contract unclear.
Review Java code that reads a file using a stream but forgets to close the underlying resource.
Review Java code where HashSet or HashMap behaves incorrectly because a domain object does not implement equals() and hashCode().
Review Java code where an object is inserted into a HashSet and then mutated, causing contains() to fail unexpectedly.
Review Java code that uses Optional in a way that adds complexity or defeats its purpose.
Review Java service code that uses a shared HashMap cache without considering concurrent requests.
Review a Java service method that mixes validation, pricing, payment, persistence, inventory, and notifications in one place.
Review backend code that performs one database query for a list, then one additional query for each item in the list.
Review a Python class that accidentally shares a list across all instances.
Review Python code that repeatedly checks membership in a list and accidentally creates an O(n²) performance problem.
Review Python code that uses broad try/except blocks for normal lookup logic and silently hides different failure cases.
Review Python code that unexpectedly mutates a caller's list and dictionaries while appearing to return cleaned data.
Review Python code that hides business rules behind unexplained numeric values.
Review Python code where the main logic is buried under many nested if statements.