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."
Solve permutation successor and evaluate expressions
Part A: Given a sequence of integers that forms a permutation, rearrange it in-place to produce the immediate next sequence in lexicographic order. If...
Implement stack and interval algorithms with tests
Implement three coding tasks and design your own unit tests for each. 1) Validate Bracket String with a Stack - Input: a string s containing only '(',...
Solve matrix components, median, and traversals
1) Binary matrix component: Given an m x n grid of 0s (background) and 1s (objects), return the size of the largest connected component where connecti...
Find Maximum Envelope Nesting
You are given a list of envelopes, where each envelope is represented by [width, height]. One envelope can be placed inside another only if both its w...
Find Final Ball Holder
You are given an array receiver of length n, where friends are numbered from 1 to n. If friend i currently holds the ball, then after one second they ...
Find Shortest Clear Grid Path
Given an n x n binary grid, where 0 means open and 1 means blocked, return the length of the shortest clear path from the top-left cell to the bottom-...
Determine string transform via end-append moves
Given two strings s and t of equal length over lowercase English letters, in one move you may delete any character from s and append it to the end of ...
Find k closest values in a BST
Given a binary search tree with n nodes and a real target t, return k node values whose distances to t are smallest. Implement an algorithm with O(log...
Implement an unbiased array shuffle
Implement an in-place function shuffle(arr) in JavaScript that returns a uniformly random permutation of the input array. The algorithm must be unbias...
Minimize adjacent-color assignment cost
You are given H linear items (e.g., houses) and an H×C cost matrix where cost[i][c] is the cost of assigning color c to item i. Adjacent items cannot ...
Find lexicographically smallest string and elimination order
You remember two coding questions from an online assessment. Question 1: Return the lexicographically smallest string after a prefix/suffix reverse Yo...
Process time intervals and detect overlaps/gaps
You are given n time intervals representing debug log segments. Each interval has a start time, an end time, and an associated text message. - Each in...
Compute island size in grid
Given an m x n binary matrix grid of 0s (water) and 1s (land), where an island is a group of 1s connected 4-directionally, implement sizeOfIsland(grid...
Find longest substring with at least k repeats
Longest substring where each character appears at least k times You are given: - a string s consisting of lowercase English letters - an integer k Ret...
Compute distance of each node to a cycle
Problem You are given an undirected graph with n nodes labeled 0..n-1 and a list of edges. The graph is connected and contains exactly one simple cycl...
Maintain streaming median and loosemedian
Design a data structure for an online stream of positive integers supporting insert (x). After each insertion, output: (a) the median of all values se...
Solve swaps, graph paths, and movie DP
Design and implement solutions for three tasks derived from a HackerRank-style assessment. 1) Minimum swaps to reverse sort an array: - Input: an inte...
Find second-minimal word segmentation count
Given a string s and a dictionary D of non-empty words, define a 'segmentation' as splitting s into a sequence of words from D whose concatenation equ...
Decide palindrome within k deletions
Given a string s and integer k, decide whether s can be transformed into a palindrome by deleting at most k characters. Provide an algorithm to comput...
Design Minesweeper and Optimize Click Performance
Design a Minesweeper game. At game start, initialize an m×n board by randomly placing k bombs. Implement: ( 1) printBoard(): return a human-readable s...