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

Validate a bracket string

Given a string s containing only the characters '(', ')', '{', '}', '[', and ']', determine whether the input string is valid. A string is valid if: 1...

Coding & Algorithms
5
0
39 people solved
Oct 14, 2025
Jane Street logo
Jane Street
Medium
Data Scientist

Solve queue switch and coin change puzzles

This entry contains two separate interview-style quantitative/algorithmic questions. --- 1. Queue switching decision problem You are standing in a sin...

Coding & Algorithms
17
0
149 people solved
Oct 14, 2025
Apple logo
Apple
Medium
Data Scientist

Remove shortest subarray to sort array

Given an integer array nums (length up to 2×10^5), return the shortest subarray [L,R] you can remove so that the remaining elements form a non‑decreas...

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

Implement streaming autocomplete under tight memory

Build an autocomplete service: Input: a list of up to 5,000,000 UTF-8 words (may include accents and hyphens), each with an integer popularity score t...

Coding & Algorithms
5
0
52 people solved
Oct 13, 2025
Dropbox logo
Dropbox
Medium
Data Scientist

Review checkout code for defects and privacy

You are reviewing a supermarket checkout implementation. Identify and prioritize issues and fixes across: (a) monetary correctness (avoid floating poi...

Coding & Algorithms
4
0
70 people solved
Oct 13, 2025
Uber logo
Uber
Medium
Data Scientist

Design airport dispatch with ETA uncertainty

You control airport pickups with streaming ETAs for arriving flights and live driver locations/queues. Design an online dispatch algorithm that minimi...

Coding & Algorithms
15
0
103 people solved
Oct 13, 2025
Google logo
Google
Medium
Data Scientist

Implement piecewise linear interpolation for time-to-empty

Time-to-Empty from a Discharge Curve (Piecewise Linear Interpolation) Implement a function time_to_empty(checkpoints, current_soc) that returns the nu...

Coding & Algorithms
4
0
41 people solved
Oct 13, 2025
Tencent logo
Tencent
Medium
Data Scientist

Implement robust k-means with k-means++ initialization

Implement from scratch in Python (no scikit‑learn) a function kmeans(X, k, max_iter=300, tol=1e-4, random_state=0) that returns (centroids, labels). R...

Coding & Algorithms
5
0
77 people solved
Oct 13, 2025
Thumbtack logo
Thumbtack
Hard
Data Scientist

Design streaming new-vs-returning monthly metrics

Streaming design: Monthly NEW vs RETURNING request shares (event-time, with late/out-of-order and duplicates) Context You receive a high-volume event ...

Coding & Algorithms
8
0
73 people solved
Oct 13, 2025
NVIDIA logo
NVIDIA
Hard
Data Scientist

Design and secure a REST inference API

Design a REST API for Image Inference with Grad-CAM You are designing a public REST API for an image-inference service that accepts large images and r...

Coding & Algorithms
4
0
62 people solved
Oct 13, 2025
TikTok logo
TikTok
Medium
Data Scientist

Implement K-means and run two iterations

Given points P={(0,0),(0,2),(2,0),(2,2),(8,8),(8,10),(10,8),(10,10)} and k=2, (1) initialize centroids with k-means++ using seed=42 and Euclidean dist...

Coding & Algorithms
4
0
46 people solved
Oct 13, 2025
Cognitiv logo
Cognitiv
Medium
Machine Learning Engineer

Maintain a Streaming Median

You are designing a component that receives integers one at a time and must return the current median after each update. Example: - After processing [...

Coding & Algorithms
4
0
33 people solved
Feb 9, 2026
Roblox logo
Roblox
Medium
Software Engineer

Track Highest-Earning Experience

You are building a core component for a real-time analytics system that tracks the profitability of experiences on a large online platform. Implement ...

Coding & Algorithms
10
0
130 people solved
Feb 9, 2026
Palo logo
Palo
Medium
Software Engineer

Find minimum tanks to cover all houses

You are given a string S representing a street: - 'H' = a house - '-' = an empty plot where you may place a water tank A house is considered covered (...

Coding & Algorithms
1
0
25 people solved
Feb 9, 2026
Microsoft logo
Microsoft
Medium
Machine Learning EngineerIntern

Find pairs with the minimum absolute difference

Given an integer array (not necessarily sorted), find the minimum absolute difference between any two distinct elements. Return all pairs of values th...

Coding & Algorithms
4
0
73 people solved
Feb 9, 2026
Microsoft logo
Microsoft
Medium
Machine Learning Engineer Locked

Implement K-means clustering from scratch

This question evaluates competency in clustering algorithms, numerical computation, and practical algorithm implementation, focusing on core K-means c...

Coding & Algorithms
3
0
50 people solved
Feb 9, 2026
Anthropic logo
Anthropic
Hard
Software Engineer Locked

Build a least-recently-used cache

This question evaluates a candidate's competence in designing and implementing efficient in-memory cache mechanisms, focusing on data structures, evic...

Coding & Algorithms
4
0
35 people solved
Feb 8, 2026
Meta logo
Meta
Medium
Machine Learning Engineer AI Locked

Maximize Unique Letters

This question evaluates proficiency in combinatorial optimization, bit manipulation, and state-compression techniques for selecting subsets under uniq...

Coding & Algorithms
2
0
35 people solved
Feb 8, 2026
Amazon logo
Amazon
Hard
Software EngineerIntern Locked

Merge two sorted arrays in-place

This question evaluates array-manipulation and in-place algorithm skills, including understanding of sorted-data merging, index/pointer management, an...

Coding & Algorithms
8
0
107 people solved
Feb 8, 2026
Databricks logo
Databricks
Medium
Machine Learning EngineerSenior+ Locked

Delete a Character From Cover

This question evaluates proficiency in string manipulation, interval arithmetic, and data-structure updates with attention to index mapping and edge-c...

Coding & Algorithms
11
0
82 people solved
Feb 7, 2026

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