Coding & Algorithms Interview Questions

Practice 3,469 real coding and algorithms interview questions reported from interviews at Meta, Amazon, Google, Uber and Microsoft. The mix follows what these loops actually ask: arrays and strings, hash maps, two pointers and sliding windows, binary search, linked lists, trees and graphs, BFS and DFS, recursion and backtracking, dynamic programming, heaps and priority queues, and the occasional design-a-data-structure round. Roughly four in five are rated medium, which is where most technical screens sit; 477 are hard and cluster in onsite loops. 3,033 of them open in a console where you can run your solution against the test cases in Python, Java, C++ or JavaScript. 2,712 come from Software Engineer interviews, with the rest from Machine Learning Engineer, Data Scientist and Data Engineer loops, and 404 were set as take-home projects rather than live sessions.

3.5k Questions 368 Companies08.11.2026
Showing 20 results
Role
Microsoft logo
Microsoft
Medium
Data Scientist

Implement rotated array binary search with duplicates

Given an integer array nums that is a non-decreasing array rotated an unknown number of times. Duplicates may exist. Implement a function that returns...

Coding & Algorithms
5
0
67 people solved
Oct 13, 2025
TikTok logo
TikTok
Medium
Data Scientist

Analyze DFS, BFS, and A* trade-offs

Given a weighted graph with nodes {S,A,B,C,D,G} and edges: S–A(2), S–B(5), A–C(2), B–C(1), C–D(2), D–G(1), B–G(20). Heuristic for A*: h(A)=4, h(B)=3, ...

Coding & Algorithms
4
0
62 people solved
Oct 13, 2025
NVIDIA logo
NVIDIA
Hard
Data Scientist

Reverse a singly linked list robustly

Reverse a Singly Linked List In-Place Context: You are given the head of a standard singly linked list (each node has value and next). Implement and e...

Coding & Algorithms
4
0
48 people solved
Oct 13, 2025
HBO logo
HBO
Medium
Data Scientist

Implement Director awards with Python OOP

Python OOP Exercise: Director extends Cast Context You are working with a simple class hierarchy where Director extends Cast. Implement a robust, test...

Coding & Algorithms
1
0
29 people solved
Oct 13, 2025
Verkada logo
Verkada
Hard
Software Engineer

Implement WordGuess feedback scoring

WordGuess (Wordle-like) scoring Implement a function that scores a guess against a secret word of the same length. Scoring rules (per character) Retur...

Coding & Algorithms
9
0
67 people solved
Oct 13, 2025
LinkedIn logo
LinkedIn
Medium
Software EngineerSenior+ Locked

Solve substring and top‑K pair problems

This multi-part question evaluates algorithm design and data-structure proficiency across string processing (minimum window substring), pair-selection...

Coding & Algorithms
11
0
82 people solved
Oct 13, 2025
Intuit logo
Intuit
Medium
Software Engineer

Find largest filename from ls -l output

You are given a multi-line string (via stdin) that represents the output of ls -l, with one entry per line. Each file line follows the typical ls -l f...

Coding & Algorithms
3
0
67 people solved
Oct 13, 2025
DoorDash logo
DoorDash
Hard
Analytics Engineer

Find Maximum Window Sum

Given an integer array nums and an integer k, write code to find the maximum sum of any contiguous subarray of length exactly k. Assume 1 <= k <= len(...

Coding & Algorithms
5
0
66 people solved
Oct 12, 2025
Atlassian logo
Atlassian
Medium
Machine Learning Engineer Locked

Find LCA in a tree and extend to a DAG

This question evaluates proficiency in graph algorithms and data structures, focusing on lowest common ancestor computation in rooted trees and its ge...

Coding & Algorithms
2
0
34 people solved
Oct 11, 2025
Atlassian logo
Atlassian
Medium
Machine Learning Engineer Locked

Compute inverse-depth weighted sum of a nested list

This question evaluates competency in working with nested data structures and depth-based aggregation, measuring the ability to reason about hierarchi...

Coding & Algorithms
4
0
44 people solved
Oct 11, 2025
Coreweave logo
Coreweave
Medium
Software EngineerSenior+

Implement web data fetch and storage tool

Problem You are asked to implement a small program that retrieves data from a remote web service protected by token-based authentication, parses the r...

Coding & Algorithms
18
0
272 people solved
Oct 11, 2025
Stripe logo
Stripe
Medium
Software Engineer Locked

Implement Billing Coding Exercises

This question evaluates skills in billing and payment reconciliation, datetime normalization and comparison, subscription-based scheduling, API integr...

Coding & Algorithms
4
0
42 people solved
Oct 7, 2025
Accenture logo
Accenture
Medium
Software Engineer

Find minimum racks for 2D bin packing

You are given N machines. Machine i requires two types of resources: (x_i, y_i). Each rack has capacity (A, B) for the two resources, and a machine mu...

Coding & Algorithms
11
0
95 people solved
Oct 7, 2025
TikTok logo
TikTok
Easy
Software Engineer

Find start indices of anagram substrings

You are given two strings: - s: the text string - p: the pattern string Return a list of all starting indices i such that the substring s[i : i + len(...

Coding & Algorithms
3
0
45 people solved
Oct 7, 2025
Lyft logo
Lyft
Medium
Software EngineerIntern

Implement Cache and Key-Value Store

The interview report mentions coding tasks similar to the following: 1. Bounded cache Implement a cache with a fixed capacity. Support: - get(ke...

Coding & Algorithms
2
1
48 people solved
Oct 5, 2025
Google logo
Google
Medium
Software Engineer Locked

Compute sliding-window average excluding top k

This question evaluates a candidate's understanding of sliding-window algorithms, order-statistics maintenance, and data-structure techniques for incr...

Coding & Algorithms
8
0
67 people solved
Oct 5, 2025
Crowdstrike logo
Crowdstrike
Medium
Software Engineer

Implement templated string replacement

You are given: 1. A dictionary (map) of placeholder keys to values, for example: `python values = { "db_host": "example.com", "db_port": 5001 } ` ...

Coding & Algorithms
6
0
84 people solved
Oct 5, 2025
Amazon logo
Amazon
Medium
Software Engineer

Design a no-repeat top-frequency music player

Design and implement a music player that receives song lists from new users and returns songs to play in frequency order without repeating a song in t...

Coding & Algorithms
4
0
51 people solved
Mar 22, 2025
WeRide logo
WeRide
Medium
Software Engineer

Implement matrix multiplication and fast exponentiation

1) - A n × m - B m × p C = A × Bn × p - - - MOD MOD 2) Exponentiation by Squaring x k MOD - x^k - x^k mod MOD - O(log k) - k = 0x = 0 3) ...

Coding & Algorithms
9
0
68 people solved
Oct 2, 2025
Amazon logo
Amazon
Hard
Software Engineer

Maximize total bandwidth of data channel pairs

You are optimizing how information flows through a network of processing nodes. There are n processing nodes. The bandwidth capability of the i-th nod...

Coding & Algorithms
3
0
37 people solved
Oct 1, 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