Software Engineer Coding & Algorithms Interview Questions
Practice 2,306 real Coding & Algorithms interview questions for Software Engineer roles. From companies including Meta, Amazon, Google, Uber, Microsoft.

"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."
Count players reaching end with moving watchers
You are given a 1D line of L cells indexed 0..L-1. The end cell is L-1. There are: - W watchers with initial integer positions watchers[]. - P players...
Enforce ordered execution across threads
Enforce ordered execution across threads Implement a class with three methods alpha(), beta(), and gamma() that may be called by three different threa...
Minimize Total Assignment Distance
You are given the coordinates of n analysts and m field devices on a 2D grid, where 1 <= n <= 10 and n <= m <= 15. Each analyst must be assigned exact...
Implement IPv4 and CIDR iterators
Problem: IPv4 / CIDR Iterator You are building utilities to iterate through IPv4 addresses. Definitions - An IPv4 address is in dotted decimal form: a...
Find nearest common manager for multiple employees
Given an organizational hierarchy modeled as a rooted tree, build the tree from (employee, manager) pairs and implement a function that, for k ≥ 2 emp...
Implement a uniq-like function
Implement a function similar to the Unix uniq utility. You are given a sequence of strings representing lines of text in the order they appear in a fi...
Design LRU cache and pick k closest points
Design LRU cache and pick k closest points 1) Design a fixed-capacity in-memory cache that evicts the least recently used key when full. Support get(k...
Compute nearest-exit distances in a grid
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...
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 ...
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 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...
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...
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...
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 ...
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 [...
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...
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...
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...
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, ...