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
Mavensecurities logo
Mavensecurities
Medium
Data Scientist

Compute probability of random arithmetic progression triple

You have the integers from 1 to 30 inclusive. You randomly choose 3 distinct numbers without replacement, and all 3-element subsets are equally likely...

Coding & Algorithms
1
0
23 people solved
Nov 20, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Find lowest common ancestor in tree

You are given the root of a binary search tree (BST) and two distinct nodes p and q that are guaranteed to exist in the tree. Task (BST case): - Find ...

Coding & Algorithms
6
0
56 people solved
Nov 19, 2025
Meta logo
Meta
Medium
Software EngineerIntern

Solve tree diameter and grid path problems

You are interviewing for a software engineer / ML intern role and are given the following algorithmic problems. --- Question 1: Longest Path in a Tree...

Coding & Algorithms
2
0
38 people solved
Nov 18, 2025
Amazon logo
Amazon
Medium
Machine Learning Engineer

Implement decoder-only GPT-style transformer

Goal Implement a simplified decoder-only Transformer language model (similar in spirit to GPT) for next-token prediction. The implementation should be...

Coding & Algorithms
19
0
172 people solved
Nov 18, 2025
Uber logo
Uber
Hard
Software Engineer

Maximize stock profit with one or two trades

You are given an array prices where prices[i] is the price of a given stock on day i (0-indexed). You want to maximize your profit by choosing when to...

Coding & Algorithms
5
0
82 people solved
Nov 17, 2025
Amazon logo
Amazon
Medium
Software EngineerSenior+ Locked

Solve Shipping and Bundle-Cost Problems

This question evaluates algorithmic reasoning for scheduling and capacity planning (minimum daily shipping capacity) and combinatorial optimization wi...

Coding & Algorithms
2
0
37 people solved
Nov 17, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Count integer pairs satisfying 1/x + 1/y = 1/N

You are given a positive integer N (\(1 \le N \le 10^6\)). Consider the Diophantine equation: \[ \frac{1}{x} + \frac{1}{y} = \frac{1}{N}, \] where x a...

Coding & Algorithms
6
0
56 people solved
Nov 17, 2025
Google logo
Google
Medium
Software Engineer

Find mode in a trinary search tree

You are given the root of a trinary search tree where each node has up to three children: `text class Node { int val; Node left; // all values ...

Coding & Algorithms
12
0
135 people solved
Nov 16, 2025
Optiver logo
Optiver
Hard
Software EngineerNew Grad

Cargo Order Allocation Across Departing Planes

A freight company assigns incoming shipping orders to a fixed fleet of cargo planes. You must implement the order-processing logic: decide whether eac...

Coding & Algorithms
0
0
9 people solved
Nov 16, 2025
Meta logo
Meta
Easy
Data Scientist Locked

Define hand-waving accuracy and launch decision

This question evaluates a data scientist's ability to define and operationalize detection metrics, design instrumentation and diagnostics, connect mod...

Analytics & Experimentation
4
0
52 people solved
Nov 16, 2025
Two Sigma logo
Two Sigma
Hard
Data ScientistIntern

Maximum-Product Simple Path in a Complete Directed Graph

You are given a complete directed graph with n nodes labeled 0 through n - 1. For every ordered pair of distinct nodes (i, j), there is a directed edg...

Coding & Algorithms
0
0
5 people solved
Nov 15, 2025
Two Sigma logo
Two Sigma
Hard
Data ScientistIntern

Implement Univariate Linear Regression with Ordinary Least Squares

Implement univariate (simple) linear regression fitted in batch with the ordinary least squares (OLS) closed-form solution. You must implement the for...

Coding & Algorithms
0
0
4 people solved
Nov 15, 2025
Two Sigma logo
Two Sigma
Hard
Data ScientistIntern

Count Distinct Island Shapes in a Binary Grid

You are given an m x n binary grid grid, where grid[i][j] is either 0 (water) or 1 (land). An island is a maximal group of 1-cells connected 4-directi...

Coding & Algorithms
0
0
7 people solved
Nov 15, 2025
Databricks logo
Databricks
Medium
Software Engineer

Compute last-5-minute QPS in memory

Problem You are building a lightweight in-memory component that tracks the query load (QPS) of a service. Design a data structure with two operations:...

Coding & Algorithms
5
0
97 people solved
Nov 14, 2025
Agoda logo
Agoda
Medium
Software Engineer

Compute triangle min path and dice stopping stats

You are given two independent interview questions. 1) Triangle minimum path sum (DP) Given a triangular array triangle with n rows, find the minimum p...

Coding & Algorithms
9
0
88 people solved
Nov 14, 2025
Salesforce logo
Salesforce
Medium
Software Engineer

Find longest subsequence of x that is a substring of y

Given two strings x and y, compute the maximum length of a string s such that: - s is a subsequence of x (can delete zero or more characters from x wi...

Coding & Algorithms
24
1
178 people solved
Nov 13, 2025
Meta logo
Meta
Hard
Software Engineer Locked

Guide a mouse to find cheese with APIs

This question evaluates the ability to reason about graph exploration and stateful API interaction in an unknown 2D grid, assessing competencies in se...

Coding & Algorithms
3
0
45 people solved
Nov 12, 2025
Bytedance logo
Bytedance
Medium
Data Scientist

Find top-paid employee per department

Given the following tables: 1) employees - employee_id INT PRIMARY KEY - employee_name VARCHAR 2) employee_department - employee_id INT - department_i...

Data Manipulation (SQL/Python)
4
0
39 people solved
Nov 12, 2025
Apple logo
Apple
Medium
Machine Learning Engineer

Rotate a Matrix In Place

Given an n x n matrix of integers, rotate the matrix 90 degrees clockwise. Implement the function in Python. You may use a straightforward approach wi...

Coding & Algorithms
0
0
8 people solved
Nov 11, 2025
Meta logo
Meta
Medium
Software Engineer

Determine if subarray sums to target

You are given an array of non-negative integers and a non-negative integer target. Determine whether there exists a contiguous subarray (continuous se...

Coding & Algorithms
7
0
59 people solved
Nov 11, 2025