Coding & Algorithms Interview Questions
Practice 2,960 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 expiring credit ledger
Implement an expiring-credit ledger that supports out-of-order events. Expose three functions with the following semantics: - add_credit(id, amount, t...
Design adjustable ID allocator
Question You manage a fixed global integer ID space [0, 999] (1000 IDs total) and a set of named buckets. Each bucket has a unique name and occupies a...
Solve 15 common Apple coding questions
The post summarizes high-frequency coding problems reported for Apple Software Engineer interviews. Practice the following algorithm and data-structur...
Find Maximum Path Sum in N-ary Tree
You are given the root of an N-ary tree. Each node contains an integer value and a list of zero or more children. A path is a sequence of nodes where ...
Minimize L2, L1, and quantile losses
Given an array X of n real numbers, derive the value θ that minimizes the sum of squared deviations Σ(xi−θ)² (mean) and the sum of absolute deviations...
Implement DFS with cycle detection and topo order
Implement DFS (recursive and iterative) with topo sort, cycle detection, and timestamps You are given a directed graph G with N nodes labeled 1..N and...
Implement lower_bound on unknown-size sorted array
Lower Bound in Unknown-Length Nondecreasing Array via API Setup You are given a non-decreasing integer array A of unknown length n. You cannot access ...
Implement an in-memory database with record locking
Implement an in-memory key–record database that supports basic CRUD on fields plus an exclusive lock per record. You are given a sequence of queries. ...
Find first 5-7-5 haiku in sentence
Question Given a sentence containing mixed case and punctuation, and a syllable dictionary mapping lowercase words to their syllable counts, implement...
Implement a calendar with non-overlapping bookings
Problem Design a calendar booking system that stores half-open time intervals [start, end) (inclusive of start, exclusive of end). Implement a class w...
Find Maximum Candies With Two Types
You are given a row of candies represented by an array candies, where candies[i] is the type of the candy at position i. You may choose any starting p...
Compute Total Manual Distance
A package must be delivered on a one-dimensional line from position 0 to position target. You are given an array stations, where each element is the p...
Implement a reference-counted smart pointer
Implement a minimal C++ reference-counted smart pointer similar to std::shared_ptr. Requirements: - Create a class template SharedPtr<T> that manages ...
Detect cycle in directed dependency graph
You are given a directed dependency graph representing services in a system. - There are n services, labeled from 0 to n - 1. - You are given a list o...
Find a valid dependency order
You are given n tasks labeled from 0 to n - 1 and a list of dependency pairs dependencies, where each pair [a, b] means task b must be completed befor...
Count Valid Infection Orders
You are given an integer n representing houses arranged in a line and indexed from 0 to n - 1, and a sorted array infected containing the indices of h...
Compute Piecewise Linear Interpolation
You are given an unsorted list of distinct 2D points (x_i, y_i). When the points are sorted by x_i, connecting adjacent points forms a polyline. Given...
Solve non-repeating show substring
Question LeetCode 3. Longest Substring Without Repeating Characters – variant where the elements are show names instead of numbers. https://leetcode.c...
Find longest substring with ≥k repeats
Problem You are given: - a string s (consisting of lowercase English letters), and - an integer k. Return the length of the longest contiguous substri...
Compute minimum escape time in a grid
You are given a 2D floor plan grid. Each cell is one of: - . empty space (walkable) - # wall/blocked (not walkable) - P a person - E an exit A person ...