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."
Apply bitwise tricks for performance
For an integer-heavy inner loop, propose bit-level optimizations that reduce branches and memory traffic: e.g., population count usage, fast modulo by...
Detect runs and collapse a numeric grid
You are given an m x n grid of digits (0– 9). Phase 1: Find every horizontal or vertical run of length ≥ 3 consisting of the same digit. For each run,...
Implement hostname-restricted web crawler
Implement a single-threaded web crawler that, given a starting URL startUrl and an interface getUrls(url) that returns all hyperlinks on the page at u...
Solve word count, node, segmentation, stock tasks
You have four tasks: 1) Count words with explicit rules: Given a text document, return the number of words. First define precisely what qualifies as a...
Find first error and propagate failures
You are given a chronological log history where each entry is a string prefixed with one of [Info], [Warn], or [Error]. Two invariants hold: ( 1) once...
Implement weighted random choice
Implement a simplified version of np.random.choice without calling the built-in function. You are given an array items of length n and an optional pro...
Find max min-plus-max over all subarrays
You are given an array arr of n integers. A subarray is a contiguous non-empty segment of the array. For any subarray arr[l..r] (0-indexed), define: \...
Implement cheapest itinerary with date filters
Implement a function that computes the cheapest itinerary from a given origin to a destination using a list of flights, where each flight has (id, sou...
Simulate pouring water onto a 1D terrain
You are given a 1D terrain represented by an integer array heights, where heights[i] is the height of the column at index i. Part 1 — Render terrain W...
Maximize funds with capital-gated projects
You start with initial funds W and may undertake at most K projects. Each project i has a required capital C[i] and yields profit P[i]; you can only s...
Compute sum of longest positive subarray
Given an integer array that may contain positive and negative numbers, find the sum of the longest contiguous subarray consisting only of positive num...
Solve two DS&A optimization problems
Problem 1 — Maximize alternating-sum over four array partitions: Given an integer array arr[1..n] (1-based). Choose indices a, b, c with 1 ≤ a ≤ b ≤ c...
Simulate Grid Infection
Implement a grid infection simulator. Base problem: - You are given a 2D grid. - X means infected. - . means healthy. - Each day, every currently infe...
Infer Generic Return Types
Build a small type-inference engine for a toy language. Do not parse raw strings; the input is already constructed as Python objects. Type model: - Pr...
Decrypt a twice-encrypted message using known pairs
Three people pass notes A → B → C → A. Notes are encrypted using a character-substitution cipher (a one-to-one mapping per character). You are given t...
Track Expiring GPU Credits
Implement a GPU credit tracking system that processes time-stamped events arriving out of order. Operations: - add_credit(amount, start_time, duration...
Check if two-group seating is possible
Given an undirected graph represented as an adjacency list where adj[i] lists the indices of guests who know guest i, determine whether all guests can...
Validate word abbreviation and reconcile two abbreviations
Implement a function isValidAbbreviation(word: string, abbr: string) that returns true if abbr is a valid abbreviation of word, where a positive integ...
Reconstruct a tree from two traversals
Given two arrays representing the preorder and inorder traversals of a binary tree with unique values, reconstruct the tree and return its root. Achie...
Implement DelayQueue with Idempotent Task Execution
Scenario Message broker offers DelayQueue where tasks execute at future timestamps, ensuring idempotency on duplicate IDs. Question Implement a delay ...