Sweaty Imposter

Mid-Level Track

Interviewing for a mid-level role. Expand pattern coverage, get fluent with the most common system design prompts, know the everyday tradeoffs well, and have stories that show ownership and scope cuts.

Overall Progress
0 / 232
0%

How to Prepare

Interview Within Two Weeks

Prioritize the core patterns, the medium problems, and the system design building blocks. Run the starter design prompts until you can sketch each one inside a 45-minute round. Production techniques and tradeoffs come next; object-oriented design, database design, and the scenarios can wait unless the posting calls them out.

Splitting Your Time

About half coding, a quarter system design, and the rest on behavioral plus whatever the role leans on: SQL for data-heavy teams, API design for backend roles, and code review where the loop includes one.

Finding Your Weak Spots

Triage shows whether you can spot a pattern, and Solve shows whether you can finish it. Start from the weakest areas in Progress, and if one feels solid in one mode and shaky in the other, drill the shaky side before moving on.

Open Your Progress →

Alongside the Drills

Talk through at least two design prompts out loud with a timer running, and rehearse each behavioral story as a story: the situation, the call you made, and the outcome. The Mixed Timed Drill and the Interview Simulator add the time pressure of a real round.

Set Up a Mixed Timed Drill →

Modules

Every pattern interviewers reach for at the mid level.

Sliding Window
Maintain a window of elements over a sequence; expand/shrink to satisfy a constraint while tracking an aggregate.
Two Pointers
Two indices walk a sorted (or paired) structure from different positions to converge on a target.
Fast & Slow Pointers (Floyd's)
Two pointers move at different speeds through a linked structure to detect cycles or find midpoints.
Merge Intervals
Sort intervals by start, then sweep merging overlaps.
Cyclic Sort
Place each number at its index by swapping; O(n) sort when values are a known bounded range like 1..n.
In-Place Reversal of LinkedList
Reverse pointers segment by segment without extra space using prev/curr/next bookkeeping.
Tree BFS
Level-order traversal using a queue; emit one level at a time.
Tree DFS
Recursive or stack-based depth-first traversal; pre/in/post order.
Two Heaps
Maintain a max-heap for the lower half and a min-heap for the upper half of a stream.
Subsets (BFS-style generation)
Iteratively or recursively build all subsets/permutations/combinations by extending prior results.
Modified Binary Search
Binary search on a non-trivial space: rotated arrays, infinite arrays, the answer itself.
Top K Elements
Maintain a heap of size k to track the k largest/smallest/most-frequent elements.
K-Way Merge
Use a min-heap of k pointers (one per list) to merge k sorted sources in O(N log k).
0/1 Knapsack (DP)
Choose/skip decisions over items with capacity; tabulate optimal value for subproblems.
Monotonic Stack/Queue
Stack/deque maintained in increasing or decreasing order to answer next-greater/smaller queries.
Graph BFS/DFS
Explore a graph by levels (BFS) or branches (DFS), tracking visited nodes.
Backtracking
DFS through a decision tree, undoing choices on failure to try alternatives.
Linked List
Walk and rewire node pointers directly, with a dummy head in front so changes at the start of the list need no special case.
Math & Geometry
Work from the structure of numbers and coordinates: index formulas for matrices, digit arithmetic with carries and overflow checks, repeated squaring for powers, and coordinate lookups for shapes.

Mostly Blind 75 mediums, the problems asked most often in mid-level loops.

Longest Substring Without Repeating Characters
medium · blind75
3Sum
medium · blind75
Container With Most Water
medium · blind75
Linked List Cycle II
medium · neetcode150
Merge Intervals
medium · blind75
Insert Interval
medium · blind75
Meeting Rooms II
medium · neetcode150
Find the Duplicate Number
medium · neetcode150
Binary Tree Level Order Traversal
medium · blind75
Validate Binary Search Tree
medium · blind75
Lowest Common Ancestor of a BST
medium · blind75
Subsets
medium · neetcode150
Permutations
medium · neetcode150
Search in Rotated Sorted Array
medium · blind75
Find Minimum in Rotated Sorted Array
medium · blind75
Top K Frequent Elements
medium · blind75
Kth Largest Element in an Array
medium · blind75
K Closest Points to Origin
medium · neetcode150
Coin Change
medium · blind75
Longest Increasing Subsequence
medium · blind75
Course Schedule
medium · blind75
Number of Islands
medium · blind75
Clone Graph
medium · blind75
Implement Trie (Prefix Tree)
medium · blind75
Daily Temperatures
medium · neetcode150
Jump Game
medium · blind75
Combination Sum
medium · blind75
Generate Parentheses
medium · neetcode150
Group Anagrams
medium · blind75
Product of Array Except Self
medium · blind75
Longest Consecutive Sequence
medium · blind75
Min Stack
medium · neetcode150
House Robber
medium · blind75
Word Break
medium · blind75
Unique Paths
medium · blind75
Longest Common Subsequence
medium · blind75
Kth Smallest Element in a BST
medium · blind75
Construct Binary Tree from Preorder and Inorder Traversal
medium · blind75
Remove Nth Node From End of List
medium · blind75
Reorder List
medium · blind75
Non-overlapping Intervals
medium · blind75
Rotting Oranges
medium · neetcode150
LRU Cache
medium · neetcode150

Techniques that come up in design discussions and code reviews.

Exponential Backoff + Jitter
Grow retry intervals exponentially and add randomization so clients don't synchronize their retries.
Idempotency Keys
Caller sends a unique key with each request; server dedupes on it so retries don't double-charge.
Circuit Breaker
Track failures from a dependency; once they exceed a threshold, open the circuit and fail fast for a cool-down period.
Bloom Filter
Probabilistic set membership in tiny memory. No false negatives; tunable false-positive rate.
Token Bucket
Bucket refills at rate R; each request takes one token. Allows controlled bursts up to bucket size.
Leaky Bucket
Requests enter a queue, processed at fixed rate. Smooths out bursts entirely, no spike ever reaches downstream.
Batching
Coalesce many small operations into one large one to amortize fixed per-request overhead.
Debounce
Wait until a flurry of events stops for N ms, then act once. Drops everything in between.
Throttle
Emit at most once per N ms regardless of how often it's called. Unlike debounce, never goes silent.
Snowflake IDs
64-bit unique IDs: [timestamp][machine-id][sequence]. Time-ordered, distributed, no central coordinator.
Leases + TTL
Grant time-bounded exclusive ownership. Holder must renew before expiry; if it dies, the lease auto-releases.
Heartbeats
Periodic 'I'm alive' signal. Absence of N consecutive heartbeats means the peer is presumed dead.
Optimistic Concurrency / CAS
Read a value with its version, send update conditional on version unchanged. Server rejects if someone else wrote in the meantime.

Pick the right endpoint: resource modeling, method semantics, status codes, idempotency, and pagination.

Practice API Design
Resource Modeling
You're designing the cart service for an e-commerce app. The frontend needs to add a specific item to a logged-in user's cart. Pick the best endpoint.
Method Semantics
Your profile screen lets users edit just their display name or just their avatar URL without touching other fields. Pick the best endpoint for saving the change.
Versioning
You're shipping the first public version of your API. You know breaking changes are inevitable and you need a versioning scheme that's easy to operate. Pick the best approach.
Status Codes
Your blog API needs to let an author delete one of their posts. Pick the best endpoint and response.
Filtering
Your storefront needs to list products filtered by category, price range, and in-stock status, with a free-text search query. Pick the best endpoint.
Method Semantics
Earlier you exposed POST /v1/exports to start an export job. Now you need to let the user cancel an in-progress job. Pick the best endpoint.
Auth and Scopes
Your API needs an endpoint that returns the orders belonging to the currently authenticated user. Pick the best design.
Rate Limiting
Your public API allows each API key 1,000 requests per hour. A client has just gone over the limit. Pick the best response, including the headers that help clients stay under it.
Error Format
A signup request fails validation: the email is malformed and the password is too short. The web and mobile clients need to highlight each bad field. Pick the best error response.
Pagination
Your internal admin tool shows a sortable table of about 3,000 employee records. Admins jump straight to page 12 and expect to see 'Page 12 of 60'. The list changes a few times a day. Pick the best endpoint.
Caching
Mobile clients download a 200 KB app configuration document on every launch, but it changes about once a week. Pick the best way to serve it.
Data Formats
Your checkout API returns order totals to web and mobile clients in several currencies, including JPY, which has no minor unit. Pick the best way to represent an amount.

JWT storage, CSRF defenses, IDOR and BOLA, secrets management, and OAuth flows.

Practice Security
Password storage
You are shipping a brand-new web app and need to pick how to store user passwords. There is no legacy hash format to be compatible with and your servers have modern CPUs. Which approach is the right default today?
JWT
A React SPA talks to a REST API on the same parent domain. You need to persist the user's session token across page reloads. Where should the access token live?
CSRF
Your app authenticates users with a session cookie and exposes POST /transfer to move money. A user reports that visiting a sketchy site while logged in caused a transfer. You confirm the cookie is Secure and httpOnly. What is the minimum fix?
SQL injection
A search endpoint receives a free-text query and your ORM exposes a raw() escape hatch. A teammate writes db.raw("SELECT * FROM items WHERE name LIKE '%" + q + "%'"). What is the correct fix?
Authorization (BOLA/IDOR)
GET /api/invoices/{id} returns an invoice. The handler looks up the invoice by id and returns it. Audit logs show user 42 successfully fetched invoice 9001, which belongs to user 77. What is missing?
Secrets management
Your service runs on an EC2 instance and needs to read objects from S3. A junior dev plans to bake AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY into the container image as environment variables. What should you do instead?
Logging & PII
A teammate adds middleware that logs every request and response body to make debugging easier in production. Endpoints include /login, /payments, and /users/me. What is your review feedback?
Input validation
An /upload endpoint accepts a file and a JSON metadata blob. The metadata includes a filename, size, and mime_type that the client computes. The server stores the file under filename and trusts mime_type for Content-Type on later downloads. What is the safer design?
Session management
After a user changes their password from the settings page, what should happen to their other active sessions on other devices?

Parking lot, vending machine, ATM, and library system: design the classes and the key tradeoffs.

Practice OOP Design
Parking Lot
Design an object-oriented parking lot with multiple levels, multiple spot sizes (motorcycle, compact, large), and dynamic pricing. A ticket is issued on entry and used to compute the bill on exit.
Library Check-out System
Design a library system that tracks books, members, check-outs, holds, and fines. A single title may have many physical copies; members can place holds when all copies are checked out.
Elevator System
Design an elevator control system for a building with N elevators and F floors. Riders press hall buttons on each floor (up/down) and car buttons inside each elevator. The system must dispatch efficiently and serve every request.
Vending Machine
Design a vending machine that holds inventory across slots, accepts coins and bills, dispenses a product, and returns correct change. Model the full transaction lifecycle including cancellation.
ATM
Design an ATM that authenticates a cardholder, then supports balance inquiry, withdrawal, deposit, and transfer. Enforce per-account daily withdrawal limits and machine cash limits.
Online Bookstore
Design an Amazon-style online bookstore: catalog, search, cart, checkout, orders, and payment. Focus on the domain model and how state moves through the order lifecycle.
In-Memory File System
Design an in-memory file system that supports directories and files, path-based operations (mkdir, ls, create, read, write, move, and delete), and metadata such as size and timestamps.
Snake and Ladder
Design a multiplayer Snake and Ladder game: a board of 100 cells with snakes and ladders, two or more players taking turns rolling a die, and a winner who lands exactly on the last cell.
Logging Framework
Design a logging library in the style of Log4j or Logback: named loggers, log levels, multiple destinations (console, file, and remote), configurable formats, and minimal overhead on the calling thread.

Schema design for chat, e-commerce, and multi-tenant SaaS: tables, indexes, and sharding keys.

Practice Database Design

Dijkstra, minimum spanning trees (Kruskal and Prim), graph traversal beyond BFS and DFS, and range queries.

Practice Algorithms
Graph - shortest path
You're building a ride-share ETA service. Roads have positive travel times that vary by segment, and you need the fastest route from a driver to a pickup point. The graph has ~50k intersections and ~200k road segments. What's the right approach?
Graph - MST
You're laying fiber to connect 10,000 cell towers using the minimum total cable. The candidate trench segments form a sparse graph with about 30,000 edges, each with a cost. What's the right approach?
Graph - shortest path
A multiplayer game server routes units across a 2,000 by 2,000 tile map with four-way movement. Roads cost 1 per tile, grass costs 2, and swamp costs 5. Each request has one start and one goal, the path must be the cheapest possible, and the server handles thousands of requests per second. What's the right approach?
Graph - ordering
A CI system runs 5,000 build targets with declared dependencies. It needs an order where every target runs after its dependencies, wants to start all ready targets in parallel waves, and must name the targets stuck in a cycle when the graph is broken. What's the right approach?
Graph - connectivity
An identity service ingests a stream of 50 million 'these two accounts belong to the same person' links. Links are never removed, and between links the service must answer 'are accounts A and B the same person?' in near constant time. What's the right approach?
Graph - connectivity
A league splits 3,000 players into two teams, with a list of 20,000 rival pairs who must land on opposite teams. You need to report whether a valid split exists and, if so, produce one. What's the right approach?
Selection
A nightly job loads 50 million request latencies into an in-memory array and needs the exact p99. It computes one percentile per run, and memory is too tight for a second copy of the array. What's the right approach?
Dynamic programming
A trading dashboard stores ten years of daily profit and loss per strategy, with both gains and losses. For each of 100,000 strategies, it must find the contiguous run of days with the largest total. What's the right approach?
Arrays and streams
A consensus layer logs 100 million leader votes, and a candidate wins only with a strict majority. The log can be read twice, there could be millions of distinct candidate IDs, and the checker must run in constant memory. What's the right approach?
Binary search
A scheduler must split an ordered queue of one million jobs with known durations into at most 24 contiguous shifts. Jobs must stay in order, and the goal is to minimize the length of the longest shift. What's the right approach?
Sliding window
An autoscaler tracks the maximum CPU reading over the trailing 300 samples for each of 200,000 hosts, recomputed every second as a new sample arrives. What's the right approach?
Heaps
A monitoring agent must report the exact median response time after every request across an unbounded stream. Inserts arrive constantly and the median is read after each one. What's the right approach?
Greedy
A shared lab room receives 20,000 booking requests for next quarter, each with a fixed start and end time. You must accept the largest possible number of bookings with no overlaps. What's the right approach?
Dynamic programming
A search box suggests corrections by ranking candidate terms against the typed query. The cost should count the fewest single-character insertions, deletions, and substitutions needed to turn one string into the other, and terms differ in length. What's the right approach?
Dynamic programming
A mobile app ships with a 50 MB download budget and 200 optional assets, each with a size in whole KB and a value score. Assets can't be split, and the goal is the highest total value that fits within 50,000 KB. What's the right approach?

Concurrency, distributed systems, database internals, and networking techniques that mid-level engineers are expected to recognize.

Open the Systems Quiz
Read-Write Lock
Allow many concurrent readers OR one exclusive writer, but never both, boosts throughput on read-heavy state.
Condition Variable / Monitor
Wait on a predicate while holding a lock; another thread signals when the predicate may now be true, atomically releasing and re-acquiring the lock.
Thread Pool / Executor
Pre-allocated worker threads pull tasks from a shared queue, so you pay thread-creation cost once and bound concurrency.
Producer-Consumer with Bounded Queue
Producers offer work to a fixed-capacity queue; consumers drain it. Bound provides natural backpressure when consumers fall behind.
Thread-Local Storage
Per-thread variable: every thread sees its own copy, eliminating sharing and therefore eliminating the need to synchronize.
Futures / async-await
Represent an in-flight computation as a value you can compose, chain, and await, no manual callback threading.
Raft Consensus
Leader-based consensus protocol: one elected leader replicates an append-only log to followers; entries commit once a majority quorum acknowledges.
Quorum Reads/Writes (R + W > N)
Tune per-operation consistency by requiring W replicas to ack writes and R replicas to answer reads. If R + W > N, every read overlaps the latest write.
Gossip Protocol
Each node periodically picks a random peer and exchanges state. Information spreads epidemically in O(log n) rounds with bounded per-node bandwidth.
Leader Election via Leases
A would-be leader acquires a time-bounded lease in a consensus store; it must renew before expiry or lose leadership. Bounds split-brain to one lease window.
Two-Phase Commit (2PC)
Coordinator asks all participants to PREPARE; if all vote yes it sends COMMIT, otherwise ABORT. Blocks if the coordinator crashes between phases.
LSM Tree + Compaction
Buffer writes in an in-memory memtable, flush sorted runs (SSTables) to disk, then merge them in background compaction passes.
Covering Index (Index-Only Scan)
Add the columns you SELECT into the index so the query plan never visits the heap. The index alone covers the read.
Multi-Version Concurrency Control (MVCC)
Each write produces a new row version tagged with the transaction id; readers see the version visible to their snapshot. Readers never block writers, writers never block readers.
Write-Ahead Log (WAL)
Append every change to a sequential log and fsync before touching the data pages. On crash, replay the log to recover committed work.
Materialized View
Persist the result of a query as a real table; refresh on schedule, on demand, or incrementally as base tables change.
TLS Handshake (1.2 vs 1.3)
TLS 1.2 needs 2 round trips before app data flows. TLS 1.3 collapses that to 1 round trip (1-RTT) for new sessions and 0 round trips (0-RTT) for resumed ones using pre-shared keys (PSK).
HTTP/2 Multiplexing
Many concurrent streams over a single TCP connection, each with its own flow control. Fixes HTTP 1.1 head-of-line blocking at the HTTP layer but not at TCP.
Connection Pooling and Keepalive
Reuse TCP and TLS connections across requests instead of opening a new one each time. Avoids the 3-way handshake plus TLS handshake on every call.
TCP_NODELAY (disable Nagle)
Nagle's algorithm coalesces small writes to reduce tinygrams. Combined with delayed-ACK on the receiver, it can stall small request/response pairs for ~40ms waiting for the next ack.

The systems-level either-or questions that come up in nearly every mid-level loop.

Thread-per-Request With a Large Pool Versus Async / Event-Loop With Futures
A service makes ~5 downstream HTTP calls per request, 80% of request time is waiting on I/O, and you
One Global Lock Around the Whole Map Versus Striped Locks
You're locking a 1M-entry in-memory map. One big lock is simple but throughput is poor under writes.
Synchronous I/O With a Large Thread Pool Versus Asynchronous Non-Blocking I/O With Futures/Await
Your service issues many DB and HTTP calls per request. You're choosing the I/O style for the platfo
Strong Consistency (Single-Region Raft) Versus Eventual Consistency
Shopping cart service for a global e-commerce site. Users add items from mobile, web, and tablet; so
Synchronous Replication Versus Asynchronous Replication
Primary Postgres in us-east-1 replicating to a us-west-2 standby for DR. Writes are user-facing chec
Two-Phase Commit Across the Services Versus Saga With Compensating Actions
An order checkout spans cart, payment, inventory, and shipping services, each with its own database.
B-Tree / B+tree Storage Versus LSM Tree
Storage engine for a write-heavy time-series ingest service. Reads are mostly recent data; durabilit
READ COMMITTED Isolation Versus SERIALIZABLE Isolation
OLTP service mostly does single-row updates with the occasional multi-row consistency check (e.g., '
Run Analytics on the OLTP Database Directly Versus Move Analytics to a Separate OLAP Store
A reporting team wants to run hour-long aggregate queries against the same Postgres serving your che
synchronous_commit = on (fsync Before Ack) Versus synchronous_commit = off (Ack Before fsync)
Postgres `synchronous_commit`: leave it ON (fsync WAL before ack) or set it OFF (ack early, fsync la
Thread-per-Connection Versus Event Loop on epoll / kqueue
Server expected to hold 100k concurrent long-lived connections. Thread-per-connection or event loop?
Separate Process Versus Separate Thread in the Same Process
Running untrusted plugin code or risky native libraries. Process or thread?
Round Robin Versus Least Connections
Load balancing across backends where request durations vary wildly (some 1ms, some 5s). Round robin

Every complexity class, with the average and worst cases for hash maps, quicksort, and similar structures.

Open the Big O Quiz