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

Compute maximum later-earlier difference

This question evaluates array-processing and algorithmic optimization skills, testing reasoning about element relationships in sequences; it falls und...

Coding & Algorithms
6
0
100 people solved
Feb 11, 2026
Microsoft logo
Microsoft
Easy
Data Engineer

Design a scalable URL shortener

Design a highly scalable URL shortening service, similar to Bitly or TinyURL. The service converts long URLs into short links and redirects short-code...

Coding & Algorithms
18
0
122 people solved
Jan 22, 2025
Tubitv logo
Tubitv
Medium
Machine Learning Engineer

Weighted Random Sampling by Index

Weighted Random Sampling by Index You are given an array of positive integer weights weights, where weights[i] is the weight assigned to index i. Impl...

Coding & Algorithms
0
0
6 people solved
Feb 10, 2026
Voleon logo
Voleon
Medium
Software Engineer

Count queen attacks on points with blockers

You are given positions on an (unbounded) 2D integer grid. - queens: coordinates of queens - points: query coordinates A queen attacks along 8 directi...

Coding & Algorithms
52
0
392 people solved
Dec 9, 2025
Voleon logo
Voleon
Medium
Software Engineer

Validate whether a binary string is good

You are given a binary string s consisting only of characters '0' and '1'. Define a good string recursively by the grammar: - '0' is a good string. - ...

Coding & Algorithms
42
0
329 people solved
Dec 9, 2025
Meta logo
Meta
Medium
Machine Learning Engineer Locked

Solve array merge, tree view, and maze tasks

This question evaluates array manipulation and in-place algorithms, binary tree traversal and visibility reasoning, and grid graph traversal for path ...

Coding & Algorithms
3
0
38 people solved
Dec 9, 2025
Scale AI logo
Scale AI
Medium
Software Engineer

Compute party time blocks per neighborhood

You are given two datasets: 1. Parties: - party_id (string or integer) - start_timestamp (e.g., UNIX timestamp or datetime) - end_timestamp (...

Coding & Algorithms
29
0
266 people solved
Dec 8, 2025
Databricks logo
Databricks
Medium
Software Engineer

Implement a rate-limited hit counter

You are designing a hit counter that records the number of hits received in the past 5 minutes. Implement a class HitCounter with the following method...

Coding & Algorithms
20
0
327 people solved
Dec 8, 2025
Coinbase logo
Coinbase
Medium
Software Engineer

Design crypto trading order control API

You are implementing part of a simple crypto trading system that manages client orders. Each order can be in one of several states: NEW, ACTIVE, PAUSE...

Coding & Algorithms
9
0
138 people solved
Dec 8, 2025
Meta logo
Meta
Medium
Data Scientist

Identify trees, lists, and array search costs

Answer all parts concisely and justify time complexities. a) A data model requires each node to have at most two children and a single parent. Name th...

Coding & Algorithms
6
0
57 people solved
Oct 13, 2025
Gemini logo
Gemini
Medium
Data Scientist

Detect k events in a sliding window

Implement an algorithm that, for each user, determines whether there exists a set of at least k ACH credit events from distinct device_ids within any ...

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

Prove reservoir sampling correctness

Design an algorithm to sample k items uniformly at random from a stream of unknown and potentially massive length N, using O(k) memory and one pass. (...

Coding & Algorithms
4
0
46 people solved
Oct 13, 2025
Airbnb logo
Airbnb
Medium
Software Engineer

Print Sentences as Table

Implement a function that formats a list of sentences as a bordered table. Given: - sentences: a list of strings - width: the fixed content width of e...

Coding & Algorithms
3
1
16 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
Tinder logo
Tinder
Medium
Software Engineer Locked

Design a data structure to find streaming median

This question evaluates proficiency in data structure and streaming algorithm design for maintaining the median of a dynamic integer stream, testing c...

Coding & Algorithms
4
0
35 people solved
Feb 9, 2026
Cortex logo
Cortex
Medium
Software Engineer

Parse API JSON and print org chart

You will solve two practical coding tasks. Task 1: Call an HTTP API and parse JSON You are given an HTTP endpoint that returns JSON describing transit...

Coding & Algorithms
7
0
67 people solved
Dec 8, 2025
Whatnot logo
Whatnot
Easy
Software Engineer

Solve Adjacent-Deletion and Sorted-Square Problems

Solve the following coding problems. Discuss the approach and complexity before implementation. Problem 1: Remove adjacent duplicate pairs Given a str...

Coding & Algorithms
0
0
14 people solved
Apr 24, 2026
Capital One logo
Capital One
Medium
Software EngineerSenior+

Place Pieces on a Grid

Given integers n and m, and an ordered list figures where each element is one of "A", "B", "C", "D", or "E", construct an n x m integer matrix grid. T...

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

Extend a Maze Solver

This question evaluates proficiency in implementing and debugging graph search algorithms and state-space modeling, including correct visited-state ha...

Coding & Algorithms
3
0
34 people solved
Feb 8, 2026
Axon logo
Axon
Medium
Software Engineer Locked

Implement encryption and constant-time random set

This question evaluates understanding of symmetric shared-secret string transformation and the design of a randomized set supporting expected O(1) ope...

Coding & Algorithms
12
0
133 people solved
Feb 8, 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