Tech Interview Questions

Practice 9,031+ interview questions from top companies including Google, Meta, Amazon, and more. Filter by company, role, and category.

Popular Interview Questions

Machine Learning Engineer + Data Scientist + Software Engineer Interview Questions

Practice the exact questions companies are asking right now.

9.0k Questions 486 Companies08.11.2026
Showing 20 results
Role
Anthropic logo
Anthropic
Medium
Software Engineer

Compute matrix trace and support updates

Given an n x n integer matrix M, implement a function trace (M) that returns the sum of its main diagonal. Follow-ups: (a) If you receive q point upda...

Coding & Algorithms
15
0
185 people solved
Aug 13, 2025
Snapchat logo
Snapchat
Medium
Software Engineer

Count islands with eight-direction adjacency

You are given an m×n grid of characters '1' (land) and '0' (water). Count the number of islands, where cells are connected if they touch in any of the...

Coding & Algorithms
2
0
39 people solved
Aug 13, 2025
Apple logo
Apple
Medium
Machine Learning Engineer

Implement bag-of-words similarity search from scratch

Implement a bag-of-words–based text similarity search engine from scratch. Write code that: ( 1) tokenizes text (lowercasing, punctuation handling, Un...

Coding & Algorithms
16
0
131 people solved
Aug 13, 2025
Meta logo
Meta
Medium
Software Engineer

Solve tree traversal and interval merging tasks

Part A — Column-wise Binary Tree Grouping: You are given the root of a binary tree. Group nodes by vertical column index, where the root has column 0,...

Coding & Algorithms
4
0
37 people solved
Aug 13, 2025
IXL Learning logo
IXL Learning
Medium
Software Engineer

Find value on most distinct levels

Given a binary tree whose nodes store values (e.g., characters), find the value that appears on the greatest number of distinct depth levels. For exam...

Coding & Algorithms
7
0
63 people solved
Aug 13, 2025
Remitly logo
Remitly
Medium
Software Engineer

Solve k-Nearest Places by Latitude/Longitude

Given a set of geographic coordinates and a query point, return the k nearest locations. Describe how you compute great-circle distance (e.g., Haversi...

Coding & Algorithms
6
0
54 people solved
Aug 13, 2025
Meta logo
Meta
Medium
Software Engineer

Solve permutation successor and evaluate expressions

Part A: Given a sequence of integers that forms a permutation, rearrange it in-place to produce the immediate next sequence in lexicographic order. If...

Coding & Algorithms
3
0
27 people solved
Aug 12, 2025
ZipHQ logo
ZipHQ
Medium
Software Engineer

Compute maximum sum in a tree without adjacency

Given a tree where each node has an integer value, select a subset of nodes to maximize the sum under the constraint that if you choose a node, you ca...

Coding & Algorithms
21
0
189 people solved
Aug 12, 2025
BitGo logo
BitGo
Hard
Software Engineer

Compare core system design tradeoffs with scenarios

System Design Tradeoffs for a Web-Scale Service Context You are designing a web-scale, user-facing transactional service. Compare key architectural ch...

System Design
6
0
61 people solved
Aug 12, 2025
Meta logo
Meta
Medium
Software Engineer

Find the kth largest element

Given an unsorted array of n integers and an integer k (1 ≤ k ≤ n), return the k-th largest element without fully sorting the array. Design two method...

Coding & Algorithms
3
0
26 people solved
Aug 12, 2025
Meta logo
Meta
Medium
Software Engineer

Implement in-place duplicate removal

Given a non-decreasing array of integers, overwrite it in-place so that each distinct value appears exactly once while preserving the order of the uni...

Coding & Algorithms
2
0
35 people solved
Aug 12, 2025
Meta logo
Meta
Medium
Software Engineer

Remove runs of length at least k

Given a string s and an integer k (k >= 2), repeatedly remove every maximal contiguous group of the same character whose length is at least k, deletin...

Coding & Algorithms
2
0
24 people solved
Aug 12, 2025
Airbnb logo
Airbnb
Medium
Software Engineer

Maximize tokens from nested crates

You are given n crates, each either locked or unlocked. Each crate i contains: an integer tokens[i]; a list of keys that can unlock other crates; and ...

Coding & Algorithms
22
1
234 people solved
Aug 12, 2025
Akuna Capital logo
Akuna Capital
Medium
Data Scientist

Solve sliding window, graph top-k, and greedy tasks

You have three coding tasks. Task 1 — Sliding window on strings: Given a string s and an integer k, find one longest substring of s that contains at m...

Coding & Algorithms
3
0
43 people solved
Aug 12, 2025
Bank of America logo
Bank of America
Medium
Data Scientist

Compute maximum beauty of a string

Given a string s, define the beauty of each letter a–z as a distinct integer between 1 and 26, case-insensitive. The beauty of a string is the sum ove...

Coding & Algorithms
2
0
43 people solved
Aug 11, 2025
ZipHQ logo
ZipHQ
Medium
Software Engineer

Find root IDs and paths

You are given a collection of string blocks, each represented as a JSON object with fields {"id": string, "parentId": string | null}. A block is a roo...

Coding & Algorithms
34
0
236 people solved
Aug 11, 2025
Shopify logo
Shopify
Medium
Data Scientist

Implement an LRU Cache

Problem: LRU Cache (LeetCode 146) Design and implement a Least Recently Used (LRU) Cache that supports the following operations in average O(1) time. ...

Coding & Algorithms
18
0
133 people solved
Aug 10, 2025
MathWorks logo
MathWorks
Medium
Software Engineer

Determine string transform via end-append moves

Given two strings s and t of equal length over lowercase English letters, in one move you may delete any character from s and append it to the end of ...

Coding & Algorithms
2
0
42 people solved
Aug 10, 2025
MathWorks logo
MathWorks
Medium
Software Engineer

Maximize disjoint k-sum pairs

You are given an integer array nums and an integer k. In one operation you may remove two indices i < j if nums[i] + nums[j] == k; each index can be u...

Coding & Algorithms
3
0
33 people solved
Aug 10, 2025
Rippling logo
Rippling
Medium
Software Engineer

Compute peak busy dashers with overlaps

You are given delivery logs as (dasherId, startTime, endTime) with integer times, where endTime is exclusive. A single dasher may accept multiple orde...

Coding & Algorithms
15
0
198 people solved
Aug 10, 2025