Coding & Algorithms Interview Questions
Practice 3,013 real Coding & Algorithms interview questions for 2026. Coding & Algorithms interview questions for top tech firms like Meta, Amazon, Google, Uber, and TikTok — real questions from actual interviews with detailed solutions — to power your interview preparation. This collection is sharply focused on algorithmic patterns (arrays, strings, sliding windows, trees/graphs, dynamic programming, greedy, two-pointers, and hashing), clean, review-ready code, and the explanation skills that distinguish hires. In 2026 expect familiar medium-to-hard problems plus newer twists: AI-enabled or multi-file coding rounds at some companies, more emphasis on explainability and edge-case reasoning, and occasional real-world performance constraints (streaming, concurrency, memory limits). Interviewers evaluate problem framing, algorithm choice, complexity trade-offs, test-case thinking, and communication under time pressure. Best prep mixes pattern-based practice, timed mock interviews, code-review style polishing, and rehearsed explanations of complexity and tradeoffs. Focus your last-mile prep on writing correct, readable code quickly and on explaining why your solution is robust and efficient for production scenarios.

"I got asked a hardcore MCM DP question and I saw it on PracHub as well. Solved that question in 5 minutes. Without PracHub I doubt I could solve it in 5 hours. Though somehow didn't get hired, perhaps I guess I solved it too fast? /s"

"Believe me i'm a student here jn US. Recently interviewed for MSFT. They asked me exact question from PracHub. I saw it the night before and ignored it cause why waste time on random sites. I legit wanna go back and redo this whole thing if I had chance. Not saying will work for everyone but there is certainly some merit to that website. And i'm gonna use it in future prep from now on like lc tagged"

"10 years of experience but never worked at a top company. PracHub's senior-level questions helped me break into FAANG at 35. Age is just a number."

"I was skeptical about the 'real questions' claim, so I put it to the test. I searched for the exact question I got grilled on at my last Meta onsite... and it was right there. Word for word."

"Got a Google recruiter call on Monday, interview on Friday. Crammed PracHub for 4 days. Passed every round. This platform is a miracle worker."

"I've used LC, Glassdoor, and random Discords. Nothing comes close to the accuracy here. The questions are actually current — that's what got me. Felt like I had a cheat sheet during the interview."

"The solution quality is insane. It covers approach, edge cases, time complexity, follow-ups. Nothing else comes close."

"Legit the only resource you need. TC went from 180k -> 350k. Just memorize the top 50 for your target company and you're golden."

"PracHub Premium for one month cost me the price of two coffees a week. It landed me a $280K+ starting offer."

"Literally just signed a $600k offer. I only had 2 weeks to prep, so I focused entirely on the company-tagged lists here. If you're targeting L5+, don't overthink it."

"Coaches and bootcamp prep courses cost around $200-300 but PracHub Premium is actually less than a Netflix subscription. And it landed me a $178K offer."

"I honestly don't know how you guys gather so many real interview questions. It's almost scary. I walked into my Amazon loop and recognized 3 out of 4 problems from your database."

"Discovered PracHub 10 days before my interview. By day 5, I stopped being nervous. By interview day, I was actually excited to show what I knew."

"I recently cleared Uber interviews (strong hire in the design round) and all the questions were present in prachub."
"The search is what sold me. I typed in a really niche DP problem I got asked last year and it actually came up, full breakdown and everything. These guys are clearly updating it constantly."
Enforce ordered execution across threads
Implement a class with three methods alpha(), beta(), and gamma() that may be called by three different threads in arbitrary order, but must print the...
Design streaming stats with sliding window
Design a data structure that ingests an integer stream and supports online queries for maximum, mean, and mode. 1) Describe your update and query oper...
Validate course catalog dependencies
Design a function to validate an e-learning course catalog. You are given: ( 1) a set of course IDs, and ( 2) a list of prerequisite pairs (u, v) mean...
Sample index from probability distribution
You are given a discrete probability distribution for an \(M\)-sided die as an array p[0..M-1], where each p[i] is non-negative. Design a function sam...
Validate parent array forms a tree
Problem You are given an integer array parent of length n describing a directed parent pointer for each node i (nodes are labeled 0..n-1). - parent[i]...
Find user who can access every camera
You are given permissions data describing which users and groups have ownership access to which cameras, and which entities are members of which group...
Solve three array/string/graph coding tasks
You are given three separate coding tasks. Implement each as a function. 1) Merge three sorted arrays Input: Three integer arrays A, B, C, each sorted...
Extend a BFS maze solver stepwise
Maze Solver (4 incremental tasks) You are given an existing codebase for a maze solver that finds a path in a 2D grid. The maze is represented as a re...
Implement a single-thread task scheduler API
Design and implement a simple task scheduler for a single CPU, single thread environment. You need to support scheduling callbacks (tasks) using the f...
Implement sliding-window moving average
Design a class MovingAverage that supports a constructor MovingAverage(k) and a method next(val) returning the average of the last k values from a dat...
Parse and evaluate nested expressions with validation
Design and implement a parser/evaluator for a parenthesized expression language where the input string may be invalid. The language uses spaces as tok...
Merge two sorted linked lists
Given the heads of two singly linked lists sorted in non-decreasing order, merge them into a single sorted singly linked list and return its head. Imp...
Find palindrome-forming string pairs
Given an array of distinct lowercase strings words, return all index pairs (i, j) with i != j such that the concatenation words[i] + words[j] is a pal...
Implement string matching with follow-up
Question Given a text T and a pattern P, implement a function firstIndex(T, P) that returns the starting index of the first occurrence of P in T, or -...
Compute and optimize average wait time
You are given n pickup orders for a grocery delivery counter. Each order i is described by orders[i] = [arrival_i, service_i] in minutes, where arriva...
Implement Disease and Friend Snapshot Models
You are asked to solve two independent coding problems. Problem 1: Simulate disease spread on a contact graph There are n people labeled 0 through n -...
Solve Five Coding Problems
The interview included several coding tasks. Solve each of the following and discuss time and space complexity: 1. Given a 2D grid where '1' represent...
Implement KNN from Scratch
Implement a k-nearest neighbors (KNN) classifier from scratch in Python without using scikit-learn's KNN implementation. Given training features X_tra...
Implement in-memory DB querying
Question Implement an in-memory database that supports: 1. Querying the whole table and returning only selected columns (projection). 2. Adding WHERE ...
Implement cloud storage with quotas and compression
Problem Implement an in-memory cloud storage service that supports multiple users, per-user storage quotas, changing quotas with eviction, and file co...