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 480 Companies08.05.2026
Showing 20 results
Role
HubSpot logo
HubSpot
Medium
Software Engineer

Find spammer with minimal hasMessaged calls

Question You have n accounts labeled 0..n-1 and an oracle API: ` boolean hasMessaged(a, b) // true iff account a has sent at least one message to ac...

Coding & Algorithms
16
0
148 people solved
Aug 14, 2025
Meta logo
Meta
Medium
Software Engineer

Implement sparse vector dot product

Question Design a SparseVector class for vectors of integers in which most entries are zero, and support an efficient dot product between two such vec...

Coding & Algorithms
2
0
39 people solved
Aug 14, 2025
Meta logo
Meta
Medium
Software Engineer

Compute BST range sum

Given the root of a binary search tree and two integers low and high (inclusive), compute the sum of values of all nodes with low <= val <= high. Prov...

Coding & Algorithms
3
0
29 people solved
Aug 14, 2025
Snowflake logo
Snowflake
Medium
Software Engineer

Compute task order with prerequisites

Given an integer n representing tasks labeled 0..n-1 and a list of prerequisite pairs (a, b) meaning b must be completed before a, return any valid or...

Coding & Algorithms
9
0
80 people solved
Aug 14, 2025
Anthropic logo
Anthropic
Medium
Software Engineer

Design file deduplication across nested directories

Design and implement a file deduplication tool that, given a root directory, identifies groups of duplicate files. Requirements: traverse nested direc...

Coding & Algorithms
20
0
202 people solved
Aug 14, 2025
Amazon logo
Amazon
Medium
Software Engineer

Implement tree left/right views via BFS and DFS

Given a binary tree, output the left view and right view: for each depth, the first node visible from the left and the first node visible from the rig...

Coding & Algorithms
1
0
32 people solved
Aug 13, 2025
Amazon logo
Amazon
Medium
Software Engineer

Maximize points with limited coworker skips

You and a coworker must unload a sequence of warehouses. For warehouse i there are c[i] items (non‑negative integers). Turns alternate starting with y...

Coding & Algorithms
3
0
44 people solved
Aug 13, 2025
Uber logo
Uber
Medium
Machine Learning Engineer

Compute currency conversion via graph search

Given a list of currency pairs, e.g., [('USD','CAD'), ('CAD','EUR'), ...], and a parallel list of conversion ratios [1.1, 1.2, ...] where ratio r mean...

Coding & Algorithms
8
0
122 people solved
Aug 13, 2025
Amazon logo
Amazon
Medium
Software Engineer

Maximize equal values via one subarray shift

Given an integer array A of length n, you may perform at most one operation: choose any contiguous subarray A[l..r] and add an integer Δ (which may be...

Coding & Algorithms
3
0
32 people solved
Aug 13, 2025
Meta logo
Meta
Medium
Software Engineer

Solve windowed duplicates and target expression

1) Windowed duplicate check: Given an integer array nums and an integer k, determine whether there exist indices i and j such that nums[i] == nums[j] ...

Coding & Algorithms
2
0
31 people solved
Aug 13, 2025
Amazon logo
Amazon
Medium
Software Engineer

Compute product excluding index without division

Given an integer array nums, return an array ans where ans[i] equals the product of all elements of nums except nums[i], without using division. Achie...

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

Validate and restore IPv4 addresses

Design and implement the following IPv4 tasks. a) Validate dotted IPv4: Write a function isValidIPv4 (s) that returns true if s is a valid dotted-deci...

Coding & Algorithms
5
0
49 people solved
Aug 13, 2025
Snapchat logo
Snapchat
Medium
Machine Learning Engineer

Find nearest room; extend to two users

You are given an m×n grid where 1 is a wall (impassable), 0 is an empty cell, and 2 is a meeting room. From a starting coordinate [r, c], you may move...

Coding & Algorithms
2
0
44 people solved
Aug 13, 2025
TikTok logo
TikTok
Medium
Software Engineer

Solve four algorithm design tasks

Solve the following four algorithmic tasks: 1) Implement wildcard pattern matcher: Given a text s and a pattern p where '?' matches any single charact...

Coding & Algorithms
5
0
62 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
36 people solved
Aug 13, 2025
Optiver logo
Optiver
Medium
Software Engineer

Decide and implement DP/heap and approximation

You have 90 minutes to complete three related coding tasks: a) Dynamic programming: Given an integer array nums (n ≤ 2e 5) and a threshold T, design a...

Coding & Algorithms
22
0
167 people solved
Aug 13, 2025
Databricks logo
Databricks
Medium
Software Engineer

Design BFS to detect forced win in Tic-Tac-Toe

You are given an n×n Tic-Tac-Toe–like board and a target k (1 ≤ k ≤ n). From the current board state and the player to move, design an algorithm to de...

Coding & Algorithms
18
0
165 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
53 people solved
Aug 13, 2025
Marshall Wace logo
Marshall Wace
Medium
Software Engineer

Find users with multi-country successful logins

Given a table login_attempts with columns: user_id (TEXT), timestamp (TIMESTAMP), status (TEXT), and country (TEXT), write an SQL query to return the ...

Data Manipulation (SQL/Python)
1
0
12 people solved
Aug 13, 2025
TikTok logo
TikTok
Medium
Software Engineer

Solve array and tree algorithm challenges

Solve the following three algorithmic tasks: 1) Unique triplet sum: Given an integer array nums and an integer target (default 0), return all unique t...

Coding & Algorithms
4
0
38 people solved
Aug 13, 2025