Coding & Algorithms Interview Questions

Practice 3,429 real Coding & Algorithms interview questions for 2026. Covers companies like Meta, Amazon, Google, Uber, and Microsoft. Real questions from actual interviews with detailed solutions — ideal for focused interview preparation. Coding & Algorithms interview questions are the single most common technical gate for software engineering roles and are used to evaluate problem framing, algorithm selection, complexity trade-offs, correctness, edge-case reasoning, and clear communication under time pressure. Expect this category to appear in early technical screens and repeatedly across onsite loops at companies that weight it heavily (notably Meta, Google, and Amazon). Interviews will test arrays and strings, trees and graphs, dynamic programming, hashing and two‑pointer techniques, and the candidate’s ability to test and optimize code in a shared editor. Prepare with timed mock interviews, practice in the same editor you’ll use live, and build a progressive schedule that moves from fundamentals to medium/hard problems; typical candidates invest several weeks to a few months of focused practice depending on seniority and target company.

3.4k Questions 368 Companies08.11.2026
Showing 20 results
Role
Citadel logo
Citadel
Medium
Software Engineer

Minimize changes for k-periodic palindrome

Question Given a string currentPassword (length N) and an integer k (1 ≤ k < N, N ≤ 2·10^5, lowercase letters, N divisible by k), find the minimum num...

Coding & Algorithms
7
0
116 people solved
Aug 4, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Solve binary-search knapsack & graph shortest path

Question Given a sorted list of items, design an efficient solution (using binary search) to achieve the target objective instead of a dynamic-program...

Coding & Algorithms
5
0
59 people solved
Aug 4, 2025
Meta logo
Meta
Medium
Data Engineer

Recommend friends-of-friends

Question Given a dictionary such as {A:[B,C], B:[C,D], C:[E]}, return for a user U all people followed by U’s followees but not already followed by U....

Coding & Algorithms
3
1
65 people solved
Aug 4, 2025
Airbnb logo
Airbnb
Medium
Software Engineer

Implement Connect Four game

Question Design and implement the Connect Four game board, player moves, and winner-detection logic. Discuss time/space complexity and possible follow...

Coding & Algorithms
23
0
199 people solved
Aug 4, 2025
Jump Trading logo
Jump Trading
Medium
Machine Learning Engineer

Solve stock trading with pattern rules

Question Given an array of daily stock prices and two pattern arrays: sellPattern and buyPattern, each consisting of 1 (price up) and -1 (price down) ...

Coding & Algorithms
7
0
69 people solved
Aug 4, 2025
Akuna Capital logo
Akuna Capital
Medium
Data Scientist

Compute statistics in data stream

Question Design a data structure that supports computing the current max, mean, and mode for an unbounded integer data stream. Estimate the memory usa...

Coding & Algorithms
2
0
46 people solved
Aug 4, 2025
Amazon logo
Amazon
Medium
Software Engineer

Count partitions and equal-cost packages

Question Given a string itemCategories, count the number of ways to partition it into exactly two contiguous non-empty substrings (a prefix and a suff...

Coding & Algorithms
8
0
59 people solved
Aug 4, 2025
Meta logo
Meta
Medium
Software Engineer

Count uniques in sparse sorted array

Question A sorted array contains many duplicates but only a very small number of distinct values. Design an algorithm that counts how many unique numb...

Coding & Algorithms
29
0
10 people solved
Aug 4, 2025
Meta logo
Meta
Medium
Software Engineer

Maximize vacation streak with PTO

Question Given an array of characters containing 'w' (workday) and 'h' (holiday) and an integer n representing the number of PTO days you can convert ...

Coding & Algorithms
12
0
10 people solved
Aug 4, 2025
Uber logo
Uber
Medium
Software Engineer

Handle invalid Lisp expression parsing

Question LeetCode 736. Parse Lisp Expression – Given a string representing a Lisp-like expression containing let/add/mult operations and variable bind...

Coding & Algorithms
2
0
50 people solved
Aug 4, 2025
Airbnb logo
Airbnb
Medium
Software Engineer

Solve palindrome pairs and key path

Question LeetCode 336. Palindrome Pairs; LeetCode 864. Shortest Path to Get All Keys https://leetcode.com/problems/palindrome-pairs/description/ https...

Coding & Algorithms
8
0
14 people solved
Aug 4, 2025
Snapchat logo
Snapchat
Medium
Software Engineer

Solve Open the Lock BFS

Question LeetCode 752. Open the Lock – Given an initial lock state "0000", a target combination, and a list of deadend combinations that cannot be use...

Coding & Algorithms
4
0
65 people solved
Aug 4, 2025
Applied Intuition logo
Applied Intuition
Medium
Software Engineer

Delete duplicate files via DFS

Question LeetCode 609. Find Duplicate File in System – Implement an algorithm (using DFS/backtracking) to delete files with duplicate content in a fil...

Coding & Algorithms
12
0
34 people solved
Aug 4, 2025
Applied Intuition logo
Applied Intuition
Medium
Software Engineer

Find duplicate files by size

Question LeetCode 609. Find Duplicate File in System — find duplicate files using file size instead of content comparison https://leetcode.com/problem...

Coding & Algorithms
15
0
116 people solved
Aug 4, 2025
Amazon logo
Amazon
Medium
Software Engineer

Solve Rotting Oranges and Bus Walk Reachability

Question LeetCode 994. Rotting Oranges. 2) Given start and end grid coordinates, an integer k (maximum walking distance), and a bidirectional graph of...

Coding & Algorithms
4
0
38 people solved
Aug 4, 2025
J.P. Morgan logo
J.P. Morgan
Medium
Software Engineer

Compute max-ons and deletion indices

Question Given a circular array of n computers represented by 0 (off) and 1 (on), determine the maximum possible number of on computers within any con...

Coding & Algorithms
17
0
46 people solved
Aug 4, 2025
Bloomberg logo
Bloomberg
Medium
Software Engineer

Solve Number of Islands

Question LeetCode 200. Number of Islands – Given a 2D grid of '1's (land) and '0's (water), count the number of islands. Follow-up: implement the solu...

Coding & Algorithms
6
0
77 people solved
Aug 4, 2025
OpenAI logo
OpenAI
Medium
Software Engineer

Merge overlapping intervals

Question LeetCode 56. Merge Intervals – Given a collection of intervals, merge all overlapping intervals into one and return an array of the non-overl...

Coding & Algorithms
23
0
218 people solved
Aug 4, 2025
Vanta logo
Vanta
Medium
Software Engineer

Implement test failure analytics APIs

Question Design a data structure that supports: log(testId, timestamp, status) — record the status ('pass'/'fail') of a test run; timestamps are stric...

Coding & Algorithms
31
1
313 people solved
Aug 4, 2025
Meta logo
Meta
Medium
Data Scientist

Solve Data-Structure Problems in Python Interview Round

Scenario Interview coding round focusing on simple data-structure problems in Python. Question Given an integer, rearrange its digits (considering onl...

Coding & Algorithms
4
0
47 people solved
Aug 4, 2025

Frequently Asked Questions

How difficult are Coding & Algorithms interview questions?
Difficulty spans a wide range: from quick easy warm-ups to multi-stage hard problems that require advanced data structures or algorithmic proofs. Most companies place a majority of live coding rounds at the medium level, with occasional hard questions used to distinguish senior candidates. Interviewers evaluate problem framing, algorithm choice, time/space complexity, clean implementation, and thoughtful testing under time pressure. Expect more conceptual depth at Google, more consistent medium-to-hard screens at Meta, and Amazon to mix coding with leadership signals. Leveling depends on role and seniority: entry-level focuses on fundamentals; senior roles emphasize design, optimizations, and tradeoffs.
Where does Coding & Algorithms appear in a typical interview loop, and which companies weight it most heavily?
Coding & Algorithms is usually the first technical hurdle: it appears in phone/online screens, followed by one or more onsite or virtual coding rounds during the loop. Typical sequences are a technical screen, two to three in-loop coding sessions, then system design or behavioral rounds. Companies that weight this category heavily include Google, Meta, and Amazon, where coding performance often determines whether you progress. Candidates commonly concentrate practice for weeks or months beforehand; most targeting large tech firms prepare intensively for 6–12 weeks, while some spend 3–6 months for deeper mastery or level changes.
How long should I prepare and how should I structure that preparation?
Plan focused, progressive practice over a realistic timeline. A practical structure is an 8–12 week block: weeks 1–2 solidify fundamentals and language fluency; weeks 3–6 target core patterns (arrays, trees, graphs, DP) with timed problem sessions and pattern tagging; weeks 7–9 emphasize mock interviews, end-to-end problem solving, and optimization tradeoffs; final weeks simulate real loops with full-length sessions and targeted weak-point drills. Candidates with less experience may extend to 12–16 weeks. Regularly review mistakes, practice communicating solutions aloud, and include at least one weekly mock interview with peer or coach feedback.
What key subtopics and patterns should I master for Coding & Algorithms interviews?
Master a consistent set of patterns and their variations: arrays and strings (two pointers, sliding window), hash maps and frequency counts, sorting and binary search, recursion and backtracking, dynamic programming, trees and traversals, graphs (BFS/DFS, shortest paths, union-find), heaps and priority queues, and greedy algorithms. Also practice complexity analysis, space-time tradeoffs, and writing bug-resistant code with tests. For higher levels, focus on amortized analysis, advanced graph algorithms, segment trees or Fenwick trees, and system-aware optimizations. Interviewers value reusable problem templates and the ability to generalize patterns to new prompts.
What are standout tips and common pitfalls to avoid in Coding & Algorithms interviews?
Start by clarifying requirements and constraints, then outline your approach before coding. Write a correct, readable baseline solution first, then iterate to improve complexity while narrating tradeoffs. Test with simple and edge cases, and handle nulls, off-by-one, and empty inputs explicitly. Communicate continuously; silence looks like confusion. Avoid premature optimization, overcomplicating solutions, or ignoring interviewer hints. Time management matters: if stuck, discuss alternate approaches and code a partial solution. Finally, practice mock interviews to reduce anxiety and build the habit of clear, structured explanations under pressure.

Explore more Coding & Algorithms interview questions

Jump straight to Coding & Algorithms questions at a specific company or for a specific role.

By company
By role