Code Review Interview Library10 exercises

Code Review Interview Exercises for JavaScript & TypeScript

Evaluate the way engineers investigate bugs, communicate trade-offs, and improve real-world code. Each exercise is ready to run as a live Pairlet interview with a shared editor and in-browser execution.

Real engineering signals

Surface security, performance, async, and design trade-offs beyond algorithm trivia.

Communication included

Ask candidates to explain findings, prioritize issues, and propose a safe refactor.

Low-friction setup

Share one room link. Candidates join without creating an account or installing an IDE.

Simple interviewer rubric

Score the signal, not the typo count

Use the same four dimensions for every candidate. Ask for evidence and trade-offs before discussing a preferred implementation.

Bug detection

Finds the highest-impact correctness and edge-case issues.

Security & performance

Spots authorization, N+1, concurrency, and resource risks.

Design judgment

Explains trade-offs and keeps the proposed change focused.

Communication

Prioritizes findings, asks clarifying questions, and gives useful feedback.

Exercise library

Choose a code review scenario

Back to all problems
Code Revieweasy
API & Backend

Code Review: Inefficient API Implementation

Review the following search API route handler. Identify unnecessary work, missing database pagination, over-fetching raw data, and security exposures.

Code Revieweasy
TypeScript & Architecture

Code Review: Bad TypeScript Design

Review the following TypeScript data mapper. Identify type safety flaws, excessive `any` usage, unsafe type assertions (`as any`), and weak interfaces. Refactor for strict type safety.

Code Revieweasy
Observability & Error Handling

Code Review: Poor Logging & Error Design

Review the following checkout payment gateway integration. Identify security logging violations, swallowed errors, lack of contextual logging, and leaking internal database stack traces to clients.

Code Reviewmedium
Database & Performance

Code Review: N+1 Database Queries

Review the following user profile enrichment service. Identify performance issues (specifically N+1 database query patterns), explain the architectural impact on database connection pools, and propose an optimized batching/joining solution.

Code Reviewmedium
Async & Promises

Code Review: Async Error Handling

Review the following payment notification pipeline. Identify problematic async behavior, missing error handling, floating unawaited promises, and failure propagation issues.

Code Reviewmedium
Async & Concurrency

Code Review: Promise Concurrency Exhaustion

Review the following batch notification dispatcher. Identify why firing thousands of HTTP requests with unrestricted `Promise.all()` leads to socket exhaustion, memory spikes, and API rate limit bans. Refactor with controlled concurrency.

Code Reviewmedium
Security & Auth

Code Review: Authorization & Security Bug

Review the following document sharing API endpoint. Identify the critical security flaw (Insecure Direct Object Reference - IDOR), explain how an attacker could exploit it, and implement proper authorization checks.

Code Reviewmedium
Software Design

Code Review: Overengineered Code

Review the following user name formatting module. Identify unnecessary design abstractions, premature generalization, and refactor it into a clean, simple, readable function.

Code Reviewhard
Concurrency & State

Code Review: Race Condition & State Mutability

Review the following wallet balance transfer handler. Identify how concurrent operations produce inconsistent state, explain the race condition window, and refactor using atomic operations or database transactions.

Code Reviewhard
Node.js & Memory

Code Review: Node.js Memory Leak

Review the following WebSocket stream manager and query cache. Identify why process memory grows continuously over time, locate uncleaned event listeners/timers, and propose a leak-free implementation.

Interviewer checklist

Run a consistent 45-minute code review loop

Give context, ask for prioritized findings, then require a small refactor and a short explanation of trade-offs. Use the same rubric across candidates for a fairer signal.

Open the full guide