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 Jackknife and Random Choice
Write Python code for two implementation tasks without using np.random.choice directly: 1. Jackknife-style resampling. Given a one-dimensional collect...
Compute nearest-exit distances in a grid
You are given a 2D grid representing a building floor with three cell types: -1 for walls, 0 for exits, and a large sentinel value for empty rooms. Up...
Solve Banana Speed and Interval Merge
During two technical phone screens for a new graduate software engineering role, the candidate was asked to solve two coding problems: minimum eating ...
Find Kth Largest and Tree Ancestors
In a technical phone interview, the candidate was asked two coding problems in the same round: 1. K-th largest element in an array Given an unsor...
Implement an expiring GPU credits ledger
Implement an expiring GPU credits ledger for multiple users with three operations: 1) add_credit(user_id, amount, expiry_time): add a lot of credits t...
Find max node-value range across components
Problem You are given an undirected graph with: - n: number of nodes (assume nodes are labeled 1..n) - from[]: list of edge start nodes - to[]: list o...
Solve Digit-Square and Grid BFS Problems
Solve the following coding problems. Problem 1: Digit-square convergence Given a positive integer n, repeatedly replace n with the sum of the squares ...
Implement LRU cache and prime products array
You are given two separate coding tasks. Task 1: Implement an LRU cache Implement an in-memory cache with a fixed capacity that evicts the least recen...
Design a token manager with lazy expiration
Problem Design a token manager that tracks authentication tokens with a fixed time-to-live (TTL). Each token is valid in the half-open time interval [...
Find shortest unique substring per word
Shortest unique substring for each word You are given an array of distinct strings words. For each word w in words, find a non-empty contiguous substr...
Design a Recency-Eviction Cache
Implement a fixed-capacity key-value cache that removes the least recently used entry when it becomes full. Support the following operations: - get(ke...
Check if adding edge creates cycle in digraph
You work with a system that stores items and directed relationships between them (for example, item A points to item B). The relationships form a dire...
Compute minimum added stones to balance a tree
You are given a rooted tree with n nodes labeled 1..n (root is node 1). Each node i initially contains stones[i] stones. Define the subtree sum of a n...
Find Maximum Rectangle in Bar Chart
Given an array heights of n non-negative integers, where each value represents the height of a vertical bar in a bar chart and every bar has width 1, ...
Count connected islands using Union-Find
You are given an m x n grid of characters where '1' represents land and '0' represents water. An island is a group of horizontally or vertically adjac...
Solve array-sum and city-community problems
Two coding problems were asked in a phone screen for a Software Engineer role: 1. Count contiguous segments with a target sum Given an integer arra...
Generate All Well-Formed Parenthesis Strings
A string of parentheses is called well-formed if every opening bracket ( has a matching closing bracket ) and the brackets are correctly nested. For e...
Find maximum-occurring character in a string
Problem Given a non-empty string s, return the character that occurs the most times in s. Tie-breaking If multiple characters have the same maximum fr...
Answer static and streaming Top-K queries
Top-K in static and streaming settings (3 variants) You are given integers and asked to answer Top-K queries under three different scenarios. Variant ...
Find index with positive suffix sums
Given an unsorted integer array \(A\), find an index \(i\) such that every cumulative sum starting from \(i\) to the end of the array is strictly posi...