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

Compute peak parking lot occupancy intervals

You are given logs from a parking lot system. Each log entry has the form: [carId, time, eventType] - carId is an integer identifying a car. - time is...

Coding & Algorithms
6
0
99 people solved
Dec 2, 2025
Applied logo
Applied
Easy
Software Engineer

Evaluate variables in simple arithmetic DSL

You are given a small DSL (domain-specific language) consisting of variable assignments, one per line. Each line has the form: `text <identifier> = <e...

Coding & Algorithms
5
0
40 people solved
Dec 1, 2025
Grammarly logo
Grammarly
Easy
Software Engineer

Implement string reduction and time map

In a coding interview, you are asked to solve two algorithm problems. 1. String reduction with adjacent duplicates - Basic version: Given a string ...

Coding & Algorithms
10
0
84 people solved
Nov 29, 2025
Two Sigma logo
Two Sigma
Hard
Data Scientist

Assign 2n Workers to Two Tasks to Minimize Total Time

You manage 2n workers and two tasks, A and B. Every worker must be assigned to exactly one task, and each task must be staffed by exactly n workers. W...

Coding & Algorithms
0
0
7 people solved
Nov 28, 2025
Stripe logo
Stripe
Medium
Software Engineer Locked

Implement JSON parsing and HTTP integration tasks

This question evaluates proficiency in JSON parsing, file I/O, HTTP client integration, request/response handling, payload construction, mapping data ...

Coding & Algorithms
10
0
127 people solved
Nov 26, 2025
Snapchat logo
Snapchat
Medium
Software Engineer

Implement sin(x) with precision constraints

Coding Question: Implement sin(x) Implement a function that returns an approximation of the trigonometric sine function. Function signature - Input: a...

Coding & Algorithms
4
0
67 people solved
Nov 26, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Find longest substring without repeating characters

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

Coding & Algorithms
3
0
65 people solved
Nov 25, 2025
Google logo
Google
Medium
Data ScientistSenior+

Implement Fibonacci with efficiency constraints

Write a function fib(n) that returns the nth Fibonacci number (0-indexed: fib(0)=0, fib(1)=1). Requirements: - Handle n up to at least 10^6. - Discuss...

Coding & Algorithms
6
0
56 people solved
Nov 24, 2025
Meta logo
Meta
Medium
Data Scientist

How do you expand nested placeholders in strings?

You are given a dictionary of string templates. Keys are identifiers like X, Y, Z. A template may contain placeholders of the form %KEY%, which should...

Coding & Algorithms
3
0
35 people solved
Nov 24, 2025
Turing logo
Turing
Medium
Software Engineer

Count permutations with exactly n inversions

You are given two integers m and n. Consider all permutations of the array [1, 2, ..., m] (each number from 1 to m appears exactly once). A permutatio...

Coding & Algorithms
7
0
85 people solved
Nov 24, 2025
Coinbase logo
Coinbase
Medium
Software Engineer

Implement a versioned recipe management system

You are asked to implement an in-memory Recipe Management System (similar in difficulty to a simple banking/in-memory DB exercise). The system support...

Coding & Algorithms
19
0
232 people solved
Nov 23, 2025
Google logo
Google
Hard
Software Engineer

Count same-color squares in a character grid

You are given a 2D grid (matrix) of characters. Each character represents a color: cells with the same character are considered the same color. Formal...

Coding & Algorithms
13
1
157 people solved
Nov 22, 2025
Snowflake logo
Snowflake
Hard
Software Engineer

Implement course scheduling and rate limiter analysis

You are given two independent coding problems. --- Problem 1: Course Scheduling You are planning to take a set of courses and are given prerequisite r...

Coding & Algorithms
16
0
218 people solved
Nov 22, 2025
Atlassian logo
Atlassian
Medium
Machine Learning Engineer

Compute moving average over last N stream

You are given an integer N and an unbounded stream of integers arriving one by one. After each new integer arrives, output the average of the last N i...

Coding & Algorithms
2
0
42 people solved
Nov 21, 2025
LinkedIn logo
LinkedIn
Medium
Software Engineer

Count connected land components in a grid

You are given a 2D grid of characters where: - '1' represents land - '0' represents water A group of land cells forms an island if they are connected ...

Coding & Algorithms
9
0
85 people solved
Nov 21, 2025
Amazon logo
Amazon
Medium
Machine Learning Engineer

Find two numbers that sum to target

Given an integer array nums of length n and an integer target, return the indices (i, j) (0-based) of two distinct elements such that nums[i] + nums[j...

Coding & Algorithms
2
0
27 people solved
Nov 20, 2025
Tripadvisor logo
Tripadvisor
Medium
Software Engineer

Build blog UI with API data and likes

You are asked to implement a small single-page web application in JavaScript (you may use any modern framework or plain JavaScript) to display and int...

Coding & Algorithms
5
0
46 people solved
Nov 20, 2025
Deshaw logo
Deshaw
Medium
Machine Learning Engineer

Implement sqrt and parity-based array rearrangement

You are given two independent coding tasks. --- Task 1: Implement Square Root Without Math Library Implement a function that computes the square root ...

Coding & Algorithms
8
0
60 people solved
Nov 20, 2025
Mavensecurities logo
Mavensecurities
Medium
Data Scientist

Compute probability of random arithmetic progression triple

You have the integers from 1 to 30 inclusive. You randomly choose 3 distinct numbers without replacement, and all 3-element subsets are equally likely...

Coding & Algorithms
1
0
23 people solved
Nov 20, 2025
Sigmacomputing logo
Sigmacomputing
Easy
Software Engineer

Implement a basic pivot table with totals

You are given a small in-memory table of data and are asked to implement a simplified pivot table operation and a printer for it. Assume the input dat...

Coding & Algorithms
6
0
97 people solved
Nov 20, 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