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."
Compute tree diameter
Given a (potentially large) binary tree, compute its diameter (the number of edges on the longest path between any two nodes). Implement an O(n) solut...
Compute split-stay listing pairs
Given a set of Airbnb listings, each with availability represented as a sorted list of day integers, and a requested inclusive date range [S, E], comp...
Implement deep clone for complex objects
Implement a deep-clone function for nested objects in JavaScript (or a language of your choice) without using JSON serialization or third-party librar...
Compute longest rising path in a grid
Given an m×n grid of integers, find the length of the longest path where each step moves up, down, left, or right to a strictly larger value. Return t...
Compute minimal flips connecting two islands
Given an n x n binary grid of 0s (water) and 1s (land) containing exactly two disjoint islands (cells with 1 connected 4-directionally), return the mi...
Find substring where all chars appear at least k
You are given a string s and an integer k (1 ≤ k ≤ |s|). Return the length of the longest substring in which every distinct character occurs at least ...
Maintain pair-sum counts under replacements
You are given two integer arrays A and B and a list of operations: ( 1) Query(T): return the number of pairs (i, j) such that A[i] + B[j] = T. ( 2) Re...
Simulate views on an n-ary tree
Given a rooted, ordered n-ary tree (each node has a value and an ordered list of children), simulate an observer who starts at the bottom-left, moves ...
Parse and Reconstruct Stack Trace
Given a multi-line stack trace string from a single thread (e.g., each frame is in the form 'at Module::Function(file:line)'), design and implement a ...
Implement Python LRU cache with varargs
Implement an LRU cache in Python as a decorator cache(maxsize) that memoizes a target function's results. Must support positional args, args, and *kwa...
Compute shared free time intervals
You are given schedules for multiple employees. schedules[i] is a list of busy intervals for employee i, where each interval is half-open [start, end)...
Justify choosing JavaScript for interviews
If given a choice of language, why would you choose JavaScript for front-end interview coding? Compare trade-offs versus TypeScript or Python regardin...
Detect words formed by multiple dictionary parts
Given an array words of up to 100,000 non-empty lowercase strings (total characters ≤ 1,000, 000), return all strings that can be formed by concatenat...
Simulate 1-D collisions and scale to huge inputs
Given an array of integers representing objects on a 1-D track, where the sign indicates direction (positive moves right, negative moves left) and the...
Implement tree traversals, BFS, and subsets generation
1) Define a TreeNode class for a binary tree with an integer value and left/right pointers. Implement preorder, inorder, and postorder traversals: (a)...
Compute grid shortest path with obstacles
You are given an m x n grid of integers where cells with value -1 represent obstacles and all other cells are traversable. Starting at (0, 0) and targ...
Solve four data structure and algorithms tasks
1) Print the numbers at each level of a binary tree. Given the root, output the values level-by-level (each level on a new line or as a list of lists)...

Implement a Task Processor
Design a task processor that supports two operations: - AddTask(task): add a new task. - ConsumeTask(): remove and return the id of the next task to e...
Count subarrays with odd zero count
Count subarrays with odd zero count Given an integer array nums, return how many contiguous subarrays contain an odd number of zeros. Provide an O(n) ...
Find shortest path in a Fibonacci-ordered tree
You are given a recursively-defined binary tree T(order) whose shape depends only on order (not on node values). Nodes are labeled 0..N-1 using preord...