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
Apple logo
Apple
Medium
Machine Learning EngineerNew Grad

Implement TF-IDF scoring for documents

Problem Implement a simplified TF–IDF scorer. You are given: - A list of documents docs, where each document is a string. - A query string q. Tokeniza...

Coding & Algorithms
7
0
71 people solved
Dec 15, 2025
Tesla logo
Tesla
Easy
Machine Learning Engineer

Implement 2D convolution forward pass

Problem Implement the forward pass of a 2D convolution (conv2d) from scratch (no deep learning libraries). You are given: - Input tensor x with shape ...

Coding & Algorithms
27
0
222 people solved
Dec 15, 2025
Salesforce logo
Salesforce
Hard
Software Engineer

Implement an LFU cache

Problem: LFU Cache Design and implement a Least Frequently Used (LFU) cache with a fixed capacity. The cache supports the following operations: - get(...

Coding & Algorithms
10
0
85 people solved
Dec 15, 2025
Moveworks logo
Moveworks
Medium
Software Engineer

Compute Jaccard similarity between two strings

Jaccard Similarity of Two Strings Given two strings a and b, compute their Jaccard similarity based on token sets. Tokenization rules - Convert to low...

Coding & Algorithms
10
0
150 people solved
Dec 15, 2025
Meta logo
Meta
Medium
Software Engineer

Validate near-palindrome and course prerequisite feasibility

Coding round (40 minutes): two problems You do not need to run code, but you should: - Explain your approach clearly. - Walk through the logic on exam...

Coding & Algorithms
2
0
30 people solved
Dec 15, 2025
Scale AI logo
Scale AI
Medium
Software Engineer

Compute party hours per town and city gaps

You are given (1) a region table describing a hierarchy of locations and (2) a list of party attendance time intervals (all timestamps occur within a ...

Coding & Algorithms
39
0
273 people solved
Dec 15, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Implement weighted random city and sparse dot product

Question 1: Weighted random city picker You are given a mapping from city → population (all populations are positive integers). Implement a random gen...

Coding & Algorithms
11
0
80 people solved
Dec 15, 2025
TikTok logo
TikTok
Medium
Machine Learning Engineer

Determine if a string can be segmented

Given a string s and a list of strings wordDict, determine whether s can be segmented into a sequence of one or more dictionary words. - You may reuse...

Coding & Algorithms
3
0
50 people solved
Dec 15, 2025
Uber logo
Uber
Medium
Machine Learning Engineer

Compute minimal time to finish dependent tasks

Coding: Task Scheduling With Prerequisites (Parallel Allowed) You have n tasks labeled 1..n. Each task takes exactly 1 unit of time to complete. Some ...

Coding & Algorithms
11
0
140 people solved
Dec 15, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Solve shipping capacity and expression insertion

Problem A: Minimum shipping capacity You are given an array weights where weights[i] is the weight of the i-th package. Packages must be shipped in or...

Coding & Algorithms
10
0
92 people solved
Dec 15, 2025
Meta logo
Meta
Medium
Software Engineer

Convert 32-bit integer to hexadecimal

Problem Given a 32-bit signed integer num, return its hexadecimal representation as a string. Requirements - Use lowercase letters a-f. - Do not inclu...

Coding & Algorithms
1
0
25 people solved
Dec 15, 2025
Meta logo
Meta
Medium
Software Engineer

Return all root-to-leaf path sums

Problem You are given the root of a binary tree where each node contains an integer value (may be negative). Return an array/list containing the sum o...

Coding & Algorithms
2
0
40 people solved
Dec 15, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Assemble DNA payload strings from tagged fragments

You are given a list of DNA-like fragments. Each fragment is a tuple: - start_tag: string - end_tag: string - payload: string A valid DNA chain is for...

Coding & Algorithms
14
0
224 people solved
Dec 15, 2025
Meta logo
Meta
Easy
Machine Learning Engineer Locked

Solve two linked list/array tasks

This two-part question evaluates proficiency with fundamental data structures and algorithmic problem-solving—specifically linked list manipulation an...

Coding & Algorithms
3
0
62 people solved
Dec 14, 2025
Agoda logo
Agoda
Medium
Software Engineer

Find two numbers that sum to a target

Array sum lookup Given an integer array nums and an integer target, find two distinct indices i and j such that: - nums[i] + nums[j] == target - i != ...

Coding & Algorithms
7
0
66 people solved
Dec 14, 2025
Coupang logo
Coupang
Medium
Software Engineer

Find shortest distance between two islands

Problem You are given an R x C binary grid where: - 1 represents land - 0 represents water The grid contains exactly two 4-directionally connected isl...

Coding & Algorithms
7
0
46 people solved
Dec 13, 2025
Voleon logo
Voleon
Medium
Software Engineer

Implement sparse matrix addition and multiplication

Implement sparse-matrix operations with explicit error handling. Sparse matrix A matrix A has dimensions r x c and is sparse, meaning most entries are...

Coding & Algorithms
37
0
355 people solved
Dec 9, 2025
Voleon logo
Voleon
Medium
Software Engineer

Simulate an exchange and participation-rate trading

Implement a simplified trading simulation in three parts. Part 1 — Process market data / exchange interaction (order book) Design a minimal limit-orde...

Coding & Algorithms
86
0
703 people solved
Dec 9, 2025
Upstart logo
Upstart
Easy
Data Scientist

Implement factorial and count trailing zeros

Answer the following coding questions in Python. 1) Implement factorial Implement a function factorial(n) that returns \(n!\) for a non-negative integ...

Coding & Algorithms
8
0
139 people solved
Dec 9, 2025
Walmart Labs logo
Walmart Labs
Easy
Software EngineerSenior+

Merge two sorted arrays in-place

You are given two integer arrays sorted in non-decreasing order, and two integers m and n: - nums1 has length m + n. The first m elements of nums1 con...

Coding & Algorithms
7
0
71 people solved
Dec 9, 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