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."
Format words into wrapped/justified lines
You are given a list of words (strings with no spaces) and an integer maxWidth. Implement text formatting in two variants: Variant A — Basic word wrap...
Build a next-word frequency predictor
You are given a sequence of tokens (words) representing a corpus, e.g.: tokens = [w0, w1, w2, ..., wK-1] You need to build a next-word predictor that ...
Count islands in a binary grid
Problem You are given an m x n grid of characters where each cell is either '1' (land) or '0' (water). An island is formed by connecting adjacent land...
Implement a debounce function
Problem: Implement debounce(fn, wait) Implement a debounce utility function. Behavior Given a function fn and a delay wait (milliseconds), debounce(fn...
Remove nodes with a given value
Problem You are given the head of a singly linked list and an integer target. Remove all nodes whose value equals target, and return the (possibly new...
Find intersection of two line segments
Problem Given two 2D line segments AB and CD, determine whether they intersect. Each segment is defined by its endpoints: - A(x1, y1), B(x2, y2) - C(x...
Find shortest relationship path using BFS
Problem You are given a set of pairwise relationships between entities (people/services/etc.). Treat each relationship as an undirected edge in a grap...
Compute minimum number of rooms needed
Problem You are given a list of meetings, each with a start time and end time. A single room can host only one meeting at a time. Two meetings overlap...
Compute minimum servers for cyclic tasks
You are given a list of tasks running on servers. Each task is represented as a pair (start, duration): - start is the start time in minutes from the ...
Stream output until stop token appears
You are implementing a simplified streaming conversational AI output filter. Text arrives in chunks (strings) in order. There is a special stop token ...
Maximize unique characters from a word list
Maximize Unique Characters From a Word List You are given a list of strings words. You may select any subset of these strings (each string used at mos...
Extend BFS maze solver with keys and arrows
Problem You are given a rectangular maze represented as a 2D grid of characters. Implement and iteratively fix/extend a solver that finds a shortest p...
Find smallest permutation under constraints
Given a non-negative integer n, consider its decimal digits as a multiset (digits can repeat). 1) Return the smallest possible integer that can be for...
Find max consecutive elements with sum below target
You are given: - An integer array nums of length n, sorted in non-decreasing order. - An integer index such that 0 ≤ index < n. - An integer target. S...
Count distinct palindromic subsequences
Given a string s consisting of lowercase English letters, compute how many distinct palindromic subsequence strings of lengths 2, 3, and 4 can be form...
Solve a 9x9 Sudoku puzzle
Given a partially filled 9×9 Sudoku board, fill the empty cells so that the completed board is valid. A valid Sudoku satisfies: - Each row contains di...
Maximize tokens from nested crates
You are given n crates, each either locked or unlocked. Each crate i contains: an integer tokens[i]; a list of keys that can unlock other crates; and ...
Validate a simplified numeric string
Implement isValidNumber (s) that returns true if and only if the ASCII string s represents a valid number under these simplified rules: - Optional lea...
Compute maximum sum in a tree without adjacency
Given a tree where each node has an integer value, select a subset of nodes to maximize the sum under the constraint that if you choose a node, you ca...
Define and compare smart pointers
What is a smart pointer? How do smart pointers manage ownership and lifetimes compared with raw pointers? Describe common types (unique, shared, weak)...