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

Validate word abbreviation and reconcile two abbreviations

Validate word abbreviation and reconcile two abbreviations Implement a function isValidAbbreviation(word: string, abbr: string) that returns true if a...

Coding & Algorithms
3
0
35 people solved
Jul 15, 2025
Amazon logo
Amazon
Medium
Software Engineer

Find first unique character

Find first unique character Given a lowercase/uppercase alphanumeric string s, return the index of the first character that appears exactly once; if n...

Coding & Algorithms
3
0
32 people solved
Jul 15, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

Design Efficient Multi-Level Access Control System

Scenario Multi-level access control lists (country → city) must be queried quickly. Question Design and implement a permission system where each geogr...

Coding & Algorithms
7
0
7 people solved
Jul 12, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

Maximize Non-Overlapping Task Scheduling Efficiency

Scenario Job scheduler on a single machine wants to maximise throughput. Question Given tasks with [start, end) times, return the maximum number of no...

Coding & Algorithms
13
0
9 people solved
Jul 12, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

Implement Data Structure for Top-K Elements in Streams

Scenario Analytics feature that must constantly report the K largest numbers seen so far. Question Implement a data structure that ingests a stream of...

Coding & Algorithms
27
0
79 people solved
Jul 12, 2025
Google logo
Google
Medium
Data Scientist

Implement Sampling and Minimize Loss in Numerical Coding

Scenario Numerical coding challenges on sampling and loss minimization. Question a) Implement functions to sample from truncated normal distributions ...

Coding & Algorithms
24
0
92 people solved
Jul 12, 2025
TikTok logo
TikTok
Medium
Data Scientist

Maximize Distinct Purchases Within Budget Constraints

Scenario Given a customer budget and a list of product prices, determine the maximum number of distinct products the customer can afford. Question Des...

Coding & Algorithms
28
0
53 people solved
Jul 12, 2025
Google logo
Google
Medium
Data Scientist

Determine If Two Strings Are Anagrams Efficiently

Scenario Backend service needs to verify whether two user-provided strings are anagrams for text-matching features. Question Implement a Python functi...

Coding & Algorithms
12
0
49 people solved
Jul 12, 2025
Jane Street logo
Jane Street
Medium
Software Engineer

Merge Two Insertion Diffs in Linear Time

A text-editing system represents changes to a document as insertion diffs. An insertion diff is a set of (position, value) pairs, where each pair mean...

Coding & Algorithms
1
0
18 people solved
Jul 11, 2025
xAI logo
xAI
Easy
Software Engineer

In-Memory Key-Value Database with Nested Transactions

In-Memory Key-Value Database with Nested Transactions Implement an in-memory key-value database that processes a sequence of commands and supports nes...

Coding & Algorithms
1
0
8 people solved
Jun 7, 2025
xAI logo
xAI
Hard
Machine Learning Engineer

Constant-Time Insert, Remove, and Uniform Random Sampling

A data-sampling service maintains a dynamically changing pool of integer example IDs. Examples are continuously added and retired, and the service mus...

Coding & Algorithms
0
0
4 people solved
May 30, 2025
Google logo
Google
Medium
Data Engineer

User Activity Analytics: Unique Users per Activity and Average Time on Site

User Activity Analytics You are given a collection of records, where each record captures a single user's action on a website. Each record is a dictio...

Coding & Algorithms
0
0
8 people solved
May 15, 2025
Two Sigma logo
Two Sigma
Easy
Data Scientist

Median, Variance, and Linear Trend of a Daily Temperature Dataset

Median, Variance, and Linear Trend of a Daily Temperature Dataset You are given n daily temperature readings collected in New York City. The data is a...

Coding & Algorithms
0
0
7 people solved
May 13, 2025
Two Sigma logo
Two Sigma
Easy
Data Scientist

Fill Missing Time-Series Values with Linear Interpolation (Duplicate Timestamps Allowed)

Fill Missing Time-Series Values with Linear Interpolation (Duplicate Timestamps Allowed) You are given readings from a single sensor as a list of reco...

Coding & Algorithms
0
0
5 people solved
May 13, 2025
Pinterest logo
Pinterest
Medium
Machine Learning Engineer Locked

Solve prefix, array, and string problems

This set of problems evaluates proficiency in string and array algorithm design—covering prefix search, subsequence matching, and maximal-area computa...

Coding & Algorithms
2
0
18 people solved
Apr 9, 2025
Amazon logo
Amazon
Medium
Software EngineerIntern

Find Most Frequent Values

Given an integer array nums and an integer k, return the k distinct values that occur most frequently in nums. The result may be returned in any order...

Coding & Algorithms
1
0
14 people solved
Mar 18, 2025
Glean logo
Glean
Medium
Machine Learning Engineer

Determine Reachability in Train Schedule

You are given a train schedule represented as a list of train routes. Each route is a list of station names, where the element at index t is the stati...

Coding & Algorithms
17
0
134 people solved
Feb 7, 2025
Google logo
Google
Medium
Data Scientist

Implement sampling and subarray scan

A coding interview included the following algorithm questions: 1. You are given access to a function rand01() that returns an independent sample from ...

Coding & Algorithms
4
0
56 people solved
Feb 5, 2025
OpenAI logo
OpenAI
Medium
Software Engineer Locked

Implement IPv4 and CIDR iterators

This question evaluates understanding of IPv4 addressing and CIDR notation, along with competency in binary/bitwise arithmetic, iterator construction,...

Coding & Algorithms
12
0
129 people solved
Jan 10, 2025
Google logo
Google
Easy
Data Scientist

Count super-streak segments in an event stream

You are given a time-ordered sequence of events. Each event has: - type, a string or integer event type. - ts, an integer timestamp in milliseconds or...

Coding & Algorithms
12
0
92 people solved
Jan 2, 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