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
xAI logo
xAI
Medium
Machine Learning Engineer

Design O(1) random-sampling set

Design a data structure that supports insert(x), remove(x), and get_random() that returns a uniformly random element among the present items, all in e...

Coding & Algorithms
18
0
143 people solved
Sep 6, 2025
Snowflake logo
Snowflake
Medium
Software Engineer

Find longest unique-character substring

Given a string s, return the length of the longest substring without repeating characters. Explain and implement an O(n) sliding-window solution using...

Coding & Algorithms
6
0
59 people solved
Sep 6, 2025
Shein logo
Shein
Medium
Software Engineer

Solve array modulo and parentheses tasks

Implement two tasks: 1) Count subarrays by modulo remainder - Input: integer array nums (length n), integers K (1 ≤ K ≤ 10^ 4) and R (0 ≤ R < K). - Ou...

Coding & Algorithms
1
0
29 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Convert BST to sorted doubly list

Convert a binary search tree into a sorted doubly linked list in-place. Reuse the existing tree nodes: the left pointer becomes prev and the right poi...

Coding & Algorithms
3
0
32 people solved
Sep 6, 2025
Akuna Capital logo
Akuna Capital
Medium
Software Engineer

Compute max profit across dated stock quotes

You are given an unsorted list of price records for multiple stocks, each record as (date, symbol, price). Dates may be repeated across different symb...

Coding & Algorithms
17
0
132 people solved
Sep 6, 2025
Anthropic logo
Anthropic
Medium
Software Engineer

Implement file deduplication at scale

Implement a command-line tool to find duplicate files in a directory tree. Use OS/pathlib primitives to recursively enumerate files. Apply prefilters ...

Coding & Algorithms
18
0
152 people solved
Sep 6, 2025
Bilt Rewards logo
Bilt Rewards
Medium
Software Engineer

Write SQL to Join Merchants and Triple Restaurant Points

You are given: ( 1) a CSV file merchants.csv with columns: merchant_name, merchant_code, category; ( 2) a database table transactions(user_id INT, mer...

Data Manipulation (SQL/Python)
0
0
5 people solved
Sep 6, 2025
Tesla logo
Tesla
Medium
Machine Learning Engineer

Implement and vectorize NumPy Conv2D

Implement a 2D convolution operation from scratch using NumPy only (no TensorFlow or PyTorch). Assume NCHW input shape (N, C_in, H_in, W_in) and weigh...

Data Manipulation (SQL/Python)
0
0
8 people solved
Sep 6, 2025
Snapchat logo
Snapchat
Medium
Software Engineer

Compute islands in a binary grid

You are given an m-by-n grid of characters where '1' represents land and '0' represents water. Count the number of connected land masses (islands) usi...

Coding & Algorithms
3
0
46 people solved
Sep 6, 2025
eBay logo
eBay
Medium
Software Engineer

Write SQL with window functions for analytics

Given a table events(user_id, event_time, event_type, value), write SQL to: a) compute each user's rolling 7-day sum of value by day, b) rank each use...

Data Manipulation (SQL/Python)
0
0
5 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Implement BST vertical traversal and list conversion

Given the root of a binary search tree (BST): 1) Implement vertical order traversal: assign the root column 0, left child column −1, right child colum...

Coding & Algorithms
2
0
46 people solved
Sep 6, 2025
Anthropic logo
Anthropic
Medium
Software Engineer

Implement hostname-restricted web crawler

Implement a single-threaded web crawler that, given a starting URL startUrl and an interface getUrls(url) that returns all hyperlinks on the page at u...

Coding & Algorithms
10
0
166 people solved
Sep 6, 2025
Google logo
Google
Medium
Software Engineer

Count user sessions from logs

Given a large log file where each line is "timestamp,user,action", compute the number of sessions per user. Assume a session ends if the gap between c...

Coding & Algorithms
11
0
82 people solved
Sep 6, 2025
Akuna Capital logo
Akuna Capital
Medium
Software Engineer

Count inversions in an array efficiently

Given the array [5, 7, 9, 2, 3, 12, 8, 4], compute the number of inversion pairs (i, j) where i < j and arr[i] > arr[j]. Describe both a naive O(n^ 2)...

Coding & Algorithms
7
0
69 people solved
Sep 6, 2025
Snowflake logo
Snowflake
Medium
Software Engineer

Serialize and deserialize a dictionary trie

Question Design and implement serialization and deserialization for a trie (prefix tree) that stores a large dictionary of lowercase English words. Th...

Coding & Algorithms
7
0
101 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Compute left and right views once

Given the root of a binary search tree, output two lists: the nodes visible from the left side and the nodes visible from the right side, from top to ...

Coding & Algorithms
4
0
32 people solved
Sep 6, 2025
LinkedIn logo
LinkedIn
Medium
Software Engineer

Detect intersection of two linked lists

Given two singly linked lists that may converge to share a common tail, determine whether they intersect and return the first node at which they join....

Coding & Algorithms
4
0
59 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Reverse sublist between equal-value nodes

Given the head of a singly linked list and a target value v that appears at least twice, reverse the sublist starting at the first node with value v a...

Coding & Algorithms
4
0
38 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Optimize ribbon piece length by binary search

Given an array lengths of positive integers and an integer k, you may cut each element into pieces of integer length L > 0. Find the maximum L such th...

Coding & Algorithms
3
0
48 people solved
Sep 6, 2025
Akuna Capital logo
Akuna Capital
Medium
Software Engineer

Compute min operations to transform integers

Given integers A and B, transform A into B using the minimum number of operations. Allowed operations: ( 1) subtract 1 from the current value; ( 2) mu...

Coding & Algorithms
3
0
50 people solved
Sep 6, 2025