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."
Implement string compression and decompression
Implement two functions for a simple string compression format. - compress(s): convert a string into groups of consecutive equal characters written as...
Explain a shader compiler pipeline
Describe the architecture of a shader compiler that ingests GLSL/HLSL and outputs SPIR-V or ISA. Cover lexical analysis, parsing to AST, conversion to...
Solve array merge and tree flattening problems
1) Given two sorted arrays, merge them into a single sorted array. Provide both an in-place approach (when the first array has enough trailing capacit...
Compute top three scores per student
You are given a list of (student_id, score) records. Return, for each student, their highest three scores in descending order. First, describe and imp...
Find k-th largest element in array
You are given an unsorted array of integers nums and a positive integer k. Design an efficient algorithm to find the k-th largest element in the array...
Fix a BST with two misplaced keys
You are given the root of a binary search tree in which exactly two nodes’ keys were accidentally swapped. Restore the tree so that its in-order trave...
Differentiate virtual and pure virtual functions
In C++, what is the difference between a virtual function and a pure virtual function? Provide syntax examples, describe dynamic dispatch via the vtab...
Solve scheduling and collision problems
The interview included multiple algorithm questions in the same category: 1. Minimum concurrent resources for intervals You are given a list of t...
Design a single- and multi-threaded web crawler
Web Crawler (single-threaded, then multi-threaded) You are given: - A starting URL startUrl (e.g., "http://news.example.com/a/index.html"). - An inter...
Design a streaming median structure
Design a data structure for a number stream that supports: add(num: int) in O(log n) time and median() -> float in O( 1) or O(log n) time. It must han...
Compute optimal locker placement with obstacles
Given house coordinates H = {(xi, yi)} and tree coordinates T = {(xj, yj)} on a 2D integer grid, choose a locker location L = (x, y) such that L ∉ T a...
Check near-palindrome with one deletion
Given a string s, determine whether it can become a palindrome after deleting at most one character. Return both the boolean result and one valid inde...
Find buildings with rightward view
You are given an array of building heights aligned along a street that faces the ocean to the right. Return the indices of buildings that can see the ...
Compare write-back vs write-through caches
Compare write-back and write-through caching policies. Explain how each handles writes, coherence, durability, latency, and bandwidth; discuss typical...
Compute Minimum L-Moves on Infinite Grid
On an infinite 2D grid, a chess-like piece moves in L-shapes: from (x, y) it can go to (x±1, y± 2) or (x±2, y± 1). Given integer target coordinates (t...
Group a tree by vertical columns
Given the root of a binary tree, produce a vertical listing of nodes: assign each node an x-coordinate (root at x=0; left child x−1; right child x+ 1)...
Implement a consistent hashing ring
Implement a class ConsistentHashRing that distributes keys across servers using a hash ring with virtual nodes. Required API: - ConsistentHashRing(rep...
Count Cross-Group Employee Pairs
You are given n employees labeled from 0 to n - 1 and a list of relationships relations, where each pair [a, b] means employees a and b belong to the ...
Recommend friends-of-friends
Question Given a dictionary such as {A:[B,C], B:[C,D], C:[E]}, return for a user U all people followed by U’s followees but not already followed by U....
Compute minimum delivery days
Question Given N distribution centers numbered 1..N and an orderCityList of length M where orderCityList[i] denotes the city that the i-th order must ...