Coding & Algorithms Interview Questions
Practice 2,970 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."
Develop Auto-Complete System for Dish Suggestions
Scenario Search-as-you-type needs dish suggestions with popularity scores. Question Build an auto-complete system using the given (string, score) tupl...
Calculate 7-Day Rolling Average for Energy Consumption
Scenario Hiring manager wants a quick coding exercise to verify programming fluency. Question Write a Python function that takes a list of daily energ...
Solve Python Challenges: Reverse String, Palindrome, Fibonacci, Unique List
Scenario Live coding round – four quick Python exercises Question Implement a function that reverses a string in-place. Write code that returns True i...
Design Data Structure for Sparse Matrices Operations
Scenario Analytics engine stores extremely sparse numeric matrices. Question Design a data structure to store two sparse matrices and implement print(...
Maximize Non-Overlapping Task Scheduling Efficiency
Scenario Job scheduler on a single machine wants to maximise throughput. Question Given tasks with [start, end) times, return the maximum number of no...
Explain Python Virtual Environment Setup and Function Analysis
Scenario Technical screen where candidate and interviewer jointly walk through Python code snippets used in a data-science repository. Question Show h...
Find max consecutive elements with sum below target
You are given: - An integer array nums of length n, sorted in non-decreasing order. - An integer index such that 0 ≤ index < n. - An integer target. S...
Rotate a Matrix In Place
Given an n x n matrix of integers, rotate the matrix 90 degrees clockwise. Implement the function in Python. You may use a straightforward approach wi...
Generate outputs for images and pipelines
You are given m input images and n processing pipelines. - Each pipeline is an ordered list of k operations (e.g., resize, rotate, crop, blur, color t...
Find the Slowest Function from Profiler Events
You are given a time-ordered profiler event log for a single-threaded program. Each event is one of: - START functionName timestamp: execution enters ...
Determine if chasing points will meet
You are given N points in 2D, indexed 0..N-1, forming a cycle. - At time t = 0, point i is at coordinates (xi, yi). - All points move simultaneously a...
Find smallest N for 5-and-21 sums
You are given two positive integers: 5 and 21. We say a positive integer x is representable if it can be written in the form \[ x = 5a + 21b \] for so...
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 ...
Detect Winners in Nested Tic-Tac-Toe
Implement functions for two related board-evaluation problems. Part 1: Classic Tic-Tac-Toe Given a 3 x 3 board represented by characters 'X', 'O', and...
Find shortest substring with N unique characters
You are given a string s and an integer n. Find the shortest contiguous substring of s that contains exactly n distinct characters. If there is no suc...
Compute maximum perimeter among islands
Problem You are given an m x n binary grid grid where: - grid[r][c] = 1 represents land - grid[r][c] = 0 represents water An island is a maximal set o...
Compute moving and weighted averages from a stream
You are processing a stream of numeric events (e.g., user activity counts). You are given a fixed window size X. Part 1: Moving average over last X va...
Build referral chains and detect cycles
You are given a directed referral graph where each user may have at most one referrer. Input file 'referrals.csv' has columns: user_id (INT), referred...
Implement max profit with K transactions (DP)
Given an array prices[0..n-1] of daily stock prices and an integer k, implement a bottom-up dynamic program to compute the maximum achievable profit w...
Design robust group size limiting for calls
Design the admission-control and enforcement algorithm to limit group-call size under real-world race conditions. Constraints: multiple SFU edges in m...