Coding & Algorithms Interview Questions

Practice 3,469 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.5k Questions 368 Companies08.11.2026
Showing 20 results
Role
Microsoft logo
Microsoft
Medium
Data Scientist

Implement rotated array binary search with duplicates

Given an integer array nums that is a non-decreasing array rotated an unknown number of times. Duplicates may exist. Implement a function that returns...

Coding & Algorithms
5
0
66 people solved
Oct 13, 2025
TCS logo
TCS
Medium
Data Scientist

Find duplicates in a list efficiently

Given a Python list that can contain integers (possibly negative) and may be very large, write code and explain approaches to find all values that app...

Coding & Algorithms
18
0
178 people solved
Oct 13, 2025
Apple logo
Apple
Hard
Data Scientist

Compute optimal matrix-chain multiplication order

Matrix Chain Multiplication: Optimal Parenthesization and Analysis You are given five matrices to multiply: A1 (10×30), A2 (30×5), A3 (5×60), A4 (60×2...

Coding & Algorithms
6
0
62 people solved
Oct 13, 2025
Microsoft logo
Microsoft
Easy
Data Scientist

Reverse a list in-place

Coding Task: Reverse a List In-Place (Python) Context You're implementing a utility function during a technical screen. The function must reverse a Py...

Coding & Algorithms
11
0
94 people solved
Oct 13, 2025
Oracle logo
Oracle
Easy
Software Engineer

Design structure for first unique login user

You are given an online stream of user login events. Each event is a user ID (e.g., an integer or string) indicating that this user has just logged in...

Coding & Algorithms
4
0
50 people solved
Oct 12, 2025
TikTok logo
TikTok
Medium
Software Engineer

Maximize min+max of contiguous subarray

You are given an array of n positive integers nums. Find a contiguous subarray that contains at least two elements and maximizes the value: > (minimum...

Coding & Algorithms
6
0
51 people solved
Oct 11, 2025
Citadel logo
Citadel
Medium
Data Scientist Locked

Match a string with wildcard pattern recursively

This question evaluates proficiency in string pattern matching, recursive problem decomposition, and algorithmic optimization including handling wildc...

Coding & Algorithms
4
0
55 people solved
Oct 9, 2025
Bytedance logo
Bytedance
Hard
Machine Learning Engineer

Count Special Subarrays by Modular Frequency

You are given an integer array nums, and two integers modulo and target, where 0 <= target < modulo. Call an index i special if nums[i] % modulo == ta...

Coding & Algorithms
0
0
8 people solved
Oct 8, 2025
Arista logo
Arista
Easy
Software Engineer

Find missing value in sorted consecutive array

Given a sorted array nums of distinct integers. The numbers are supposed to form a consecutive sequence starting from some unknown integer start: - If...

Coding & Algorithms
4
0
50 people solved
Oct 4, 2025
Dropbox logo
Dropbox
Medium
Software Engineer Locked

Implement KV Store and Token Bucket

This question evaluates a candidate's skills in implementing core data structures and concurrent algorithms, specifically in-memory key-value store de...

Coding & Algorithms
7
0
74 people solved
Oct 3, 2025
IBM logo
IBM
Easy
Data Scientist

Find minimum operations to make array sorted

Problem You are given an integer array a of length n. Define one operation as follows: 1. Remove the first element x = a[0]. 2. Append x to the end of...

Coding & Algorithms
4
1
65 people solved
Oct 3, 2025
TikTok logo
TikTok
Hard
Software Engineer

Compute maximum path sum in a binary tree

Question You are given the root of a binary tree where each node contains an integer value (which may be positive, zero, or negative). Return the maxi...

Coding & Algorithms
5
0
59 people solved
Oct 3, 2025
Amazon logo
Amazon
Hard
Software Engineer

Minimize operations to reduce price difference

You are managing an inventory of products and want to adjust their prices. There are n products. The price of the i-th product is given by an integer ...

Coding & Algorithms
6
0
56 people solved
Oct 1, 2025
Amazon logo
Amazon
Hard
Software Engineer

Maximize memory capacity with primary-backup servers

You are helping to optimize the capacity of a cloud system. There are n servers, where n is always even. The memory capacity of the i-th server is giv...

Coding & Algorithms
3
0
58 people solved
Oct 1, 2025
TikTok logo
TikTok
Medium
Machine Learning Engineer

Find longest substring without repeating characters

Problem Given a string s, find the length of the longest contiguous substring that contains no repeated characters. Input - A string s (may contain le...

Coding & Algorithms
2
0
38 people solved
Sep 29, 2025
Easy
Data ScientistIntern

Find two numbers that sum to target

Problem You are given an integer array nums (length n) and an integer target. Return the indices (i, j) such that: - i != j - nums[i] + nums[j] == tar...

Coding & Algorithms
4
0
35 people solved
Sep 28, 2025
Roblox logo
Roblox
Medium
Software Engineer Locked

Implement a Log Rate Limiter

This question evaluates a candidate's ability to design and implement time-based rate limiting and stateful event tracking using appropriate data stru...

Coding & Algorithms
8
0
79 people solved
Sep 25, 2025
Zillow logo
Zillow
Medium
Machine Learning Engineer

Implement k-th largest in a number stream

You are designing a small library to monitor statistics over a stream of integers. Implement a data structure that, given an integer k and an initial ...

Coding & Algorithms
2
0
29 people solved
Sep 24, 2025
xAI logo
xAI
Medium
Software Engineer

Token Bucket Rate Limiter with Lazy Refill Backed by a Cache

Token Bucket Rate Limiter with Lazy Refill Backed by a Cache You are building the enforcement layer of a rate limiter. Every user has a token bucket s...

Coding & Algorithms
1
1
13 people solved
Sep 23, 2025
xAI logo
xAI
Medium
Machine Learning Engineer

Implement dynamic batching for token decoding

You are given a black-box “simulated language model” interface that can advance many sequences in a batch. Model interface - Tokens are integers. - mo...

Coding & Algorithms
44
0
323 people solved
Sep 22, 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