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
Machine Learning Engineer

Check diagonal and compute window statistics

Question Given a square matrix, determine whether all elements on its main diagonal are identical. LeetCode 346. Moving Average from Data Stream – des...

Coding & Algorithms
9
0
70 people solved
Aug 4, 2025
Vanta logo
Vanta
Medium
Software Engineer

Design test-run logging and query functions

Question Implement log(test_id, timestamp, status) to record a test run, where timestamps are strictly increasing across all test IDs. Implement get_m...

Coding & Algorithms
29
0
243 people solved
Aug 4, 2025
Shopify logo
Shopify
Medium
Data Scientist

Implement Cosine Similarity Function for String Vectors

Scenario Technical phone screen in Python; assess ability to implement similarity metric. Question Implement a Python function that computes the cosin...

Coding & Algorithms
9
0
103 people solved
Aug 4, 2025
Upstart logo
Upstart
Medium
Data Scientist

Simulate Radioactive Decay to Validate Analytical Solution

Scenario Same radioactive-decay problem, but now validate the analytical answer via simulation during the interview. Question Share screen and write r...

Coding & Algorithms
10
0
101 people solved
Aug 4, 2025
Walmart Labs logo
Walmart Labs
Medium
Data Scientist

Find Index Pairs of Matching Elements in Arrays

Scenario Marketing analytics team needs to find common elements between two sorted arrays of user IDs. Question Given two sorted integer arrays withou...

Coding & Algorithms
3
0
51 people solved
Aug 4, 2025
Experian logo
Experian
Medium
Data Scientist

Sort and Rearrange: Efficient Algorithms for Diverse Challenges

Sort and Rearrange: Efficient Algorithms for Diverse Challenges Scenario Coding rounds and infrastructure-style algorithm questions. Question Write an...

Coding & Algorithms
2
0
44 people solved
Aug 4, 2025
Amazon logo
Amazon
Medium
Data Scientist

Design Efficient Data Structure for Median Retrieval

Scenario Senior problem-solving round assessing algorithmic thinking under time pressure. Question Design a data structure that supports inserting int...

Coding & Algorithms
2
0
27 people solved
Aug 4, 2025
Meta logo
Meta
Medium
Data Scientist

Optimize Oculus Data Streaming with Bandwidth Constraints

Scenario Algorithmic screening for Meta VR/AR teams covering Oculus data streaming and geometric optimization. Question Oculus: Given an array frame_s...

Coding & Algorithms
4
0
47 people solved
Aug 4, 2025
Shopify logo
Shopify
Medium
Data Scientist

Identify Pirate-Themed Custom Themes Using Jaccard Similarity

Scenario Engineering receives two lists and must identify custom themes that look like Pirate themes. Question a) Write a Python function that compute...

Coding & Algorithms
2
0
17 people solved
Aug 4, 2025
OpenAI logo
OpenAI
Medium
Data Scientist

Identify Bugs in Python Script for User Assignment

Scenario A simple Python script assigns users to experiment groups and triggers the free-trial offer. Question Inspect the script and list any bugs or...

Coding & Algorithms
28
0
87 people solved
Aug 4, 2025
Upstart logo
Upstart
Medium
Data Scientist

Design Algorithm for Longest Substring with K Distinct Characters

Scenario Tech interview round 2 – sliding-window algorithm Question Design an algorithm that finds the length of the longest substring containing at m...

Coding & Algorithms
19
0
32 people solved
Aug 4, 2025
Lyft logo
Lyft
Medium
Data Scientist

Optimize Driver Repositioning for Minimal Pickup Time

Scenario Design and implement algorithms for ride-sharing dispatch and capacity planning. Question Given historical rider demand density and current d...

Coding & Algorithms
55
0
104 people solved
Aug 4, 2025
Intuit logo
Intuit
Easy
Data Scientist

Implement nth Fibonacci number

Implement nth Fibonacci number Problem Write a function that returns the n-th Fibonacci number. The Fibonacci sequence is defined as: - \(F(0)=0\) - \...

Coding & Algorithms
6
0
75 people solved
Aug 1, 2025
Netflix logo
Netflix
Medium
Software Engineer

Find longest unique show window

Given an array of show names (strings) representing a user's viewing history, return the start and end indices of a longest contiguous subarray that c...

Coding & Algorithms
7
0
118 people solved
Aug 1, 2025
Anthropic logo
Anthropic
Medium
Software Engineer

Implement Python LRU cache with args and persistence

Implement an LRU cache in Python as a decorator or class that correctly supports variable-length positional arguments and keyword arguments. Ensure th...

Coding & Algorithms
46
0
314 people solved
Aug 1, 2025
Anthropic logo
Anthropic
Medium
Software Engineer

Implement a same-host web crawler

Implement a web crawler. Given a start URL and a function get_links(url) -> list of URLs, return all URLs that share the same hostname as the start. A...

Coding & Algorithms
14
0
102 people solved
Aug 1, 2025
Box logo
Box
Medium
Software Engineer

Flip a specific bit in an integer

Given a non-negative integer num and a zero-based bit position p, return the integer resulting from flipping only the bit at position p (i.e., 0 becom...

Coding & Algorithms
9
0
91 people solved
Aug 1, 2025
Instacart logo
Instacart
Medium
Software Engineer

Evaluate arithmetic expression with precedence

Question Implement an evaluator for a string arithmetic expression. The input contains non-negative integers, the operators +, -, `, /, parentheses ( ...

Coding & Algorithms
8
0
78 people solved
Aug 1, 2025
Meta logo
Meta
Medium
Software Engineer

Solve PTO window and sparse unique counting

Solve PTO window and sparse unique counting Design algorithms for two problems: A) Longest vacation with limited PTO: Given an array A of characters w...

Coding & Algorithms
2
0
38 people solved
Aug 1, 2025
Uber logo
Uber
Medium
Software Engineer

Parse and evaluate nested expressions with validation

Design and implement a parser/evaluator for a parenthesized expression language where the input string may be invalid. The language uses spaces as tok...

Coding & Algorithms
3
0
60 people solved
Jul 31, 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