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
Roblox logo
Roblox
Medium
Software Engineer

Detect shuffle-mode sequence

Question Given a playlist of distinct songs and two player modes—Random (each next song chosen independently and uniformly at random, with replacement...

Coding & Algorithms
103
0
167 people solved
Jul 29, 2025
DoorDash logo
DoorDash
Medium
Software Engineer

Find names similar by one swap

Question LeetCode 859. Buddy Strings – Given a target string and a list of strings, return all list entries that can match the target by swapping at m...

Coding & Algorithms
9
0
27 people solved
Jul 29, 2025
Meta logo
Meta
Medium
Software Engineer

Check Palindrome and Add Decimal Strings

Question LeetCode 266. Palindrome Permutation – Given a string, determine whether any permutation can form a palindrome. Follow-up: If a palindrome pe...

Coding & Algorithms
24
0
66 people solved
Jul 29, 2025
Character.AI logo
Character.AI
Medium
Software Engineer

Design timestamped key-value map

Question Design a class that supports insert(key, value, timestamp) and get(key, timestamp) where get returns the value whose timestamp is the smalles...

Coding & Algorithms
16
0
42 people solved
Jul 29, 2025
xAI logo
xAI
Medium
Software Engineer

Explain and Implement Strings

Question What is a string in programming languages? Inside a struct string{} in Rust, what fields are stored and how would you design and implement on...

Coding & Algorithms
2
0
19 people solved
Jul 29, 2025
Meta logo
Meta
Medium
Software Engineer

Handle palindrome & decimal addition

Question LeetCode 266. Palindrome Permutation Given two non-negative decimal number strings, implement addition that supports a decimal point. https:/...

Coding & Algorithms
11
0
35 people solved
Jul 29, 2025
Character.AI logo
Character.AI
Medium
Software Engineer

Explain strings and copy complexity

Question What is a string? What fields does a struct string contain, and how would you implement it yourself? What is the time complexity of copying a...

Coding & Algorithms
4
0
15 people solved
Jul 29, 2025
xAI logo
xAI
Medium
Software Engineer

Explain strings, moves, and concurrency

Question What is a string in programming languages? What fields are stored in a typical struct string and how would you implement one yourself? What i...

Coding & Algorithms
24
0
68 people solved
Jul 29, 2025
Meta logo
Meta
Medium
Software Engineer

Solve vertical order & diameter variants

Question LeetCode 314. Binary Tree Vertical Order Traversal LeetCode 543. Diameter of Binary Tree – modified to return the number of nodes (edges + 1)...

Coding & Algorithms
1
0
4 people solved
Jul 29, 2025
Pinterest logo
Pinterest
Medium
Software Engineer

Round numeric string values

Question Given a numeric string, implement rounding to the nearest integer (e.g., '3.5' → '4', '100.01' → '100'). Follow-up: round to the last signifi...

Coding & Algorithms
14
0
32 people solved
Jul 29, 2025
Amazon logo
Amazon
Medium
Software Engineer

Solve array and list algorithms

Question LeetCode 315. Count of Smaller Numbers After Self LeetCode 23. Merge k Sorted Lists Design algorithm for Amazon Locker getPackage (retrieve p...

Coding & Algorithms
5
0
14 people solved
Jul 29, 2025
Amazon logo
Amazon
Medium
Software Engineer

Compute minimum passes to collect numbers

Question You are given an array shelf of n distinct integers that is a permutation of 1…n. Starting with target = 1, you repeatedly scan shelf from le...

Coding & Algorithms
76
0
200 people solved
Jul 29, 2025
Amazon logo
Amazon
Medium
Software Engineer

Compute maximum distinct-product pickup days

Question Given an array of positive integers representing quantities of different products, on day i (starting from 1) you must pick exactly i distinc...

Coding & Algorithms
21
0
56 people solved
Jul 29, 2025
Snapchat logo
Snapchat
Medium
Software Engineer

Determine blockage and parse HTML tokens

Question Given a set of 2-D circular stones, determine whether they can completely block the width of a river. You may define the input format. Given ...

Coding & Algorithms
19
0
52 people solved
Jul 29, 2025
Amazon logo
Amazon
Medium
Software Engineer

Find most frequent log user

Question You are given a list of log entries in string format, where each entry contains a username and an access timestamp separated by a delimiter (...

Coding & Algorithms
24
0
49 people solved
Jul 29, 2025
Google logo
Google
Medium
Software Engineer

Parse strings and find meeting slots

Question Given a text file where each line contains raw information, extract the user identifier and the numeric quantity on that line and store the r...

Coding & Algorithms
31
0
61 people solved
Jul 29, 2025
DoorDash logo
DoorDash
Medium
Software Engineer

Implement string-path file system operations

Question LeetCode 1166. Design File System – extended to support Create(path, value), Get(path), Set(path, value) and Delete(path) with validation rul...

Coding & Algorithms
6
0
30 people solved
Jul 29, 2025
Instacart logo
Instacart
Medium
Software Engineer

Implement matrix-indexing and expression resolver

Question Given a text file path whose contents include a single block starting with a line like "[2,4]" followed by rows of equal-length characters (e...

Coding & Algorithms
90
0
231 people solved
Jul 29, 2025
Instacart logo
Instacart
Medium
Software Engineer

Evaluate dependent variable expressions

Question Given a target variable name and a list of assignment strings of the form 'Ti = expression' where the expression is either a number, a single...

Coding & Algorithms
26
0
101 people solved
Jul 29, 2025
DoorDash logo
DoorDash
Medium
Software Engineer

Determine equality after limited swaps

Question LeetCode 1790. Check if One String Swap Can Make Strings Equal Follow-up: Given two strings, determine if they can become anagrams of each ot...

Coding & Algorithms
10
0
5 people solved
Jul 29, 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