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

Find kth smallest pair sum with heaps

You are given two nondecreasing arrays A (length n) and B (length m) of non-negative integers and an integer k (1 <= k <= n*m). Return the k-th smalle...

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

Set second tree values by subtree sums

Given the roots of two complete binary trees T1 and T2 that have identical structure and the same number of nodes, replace each value in T2 with the s...

Coding & Algorithms
11
0
91 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Solve jumps and anagram-similarity problems

You are given two independent tasks. Task A (Maximize calories over jumps): - There are n blocks with integer heights height[i] ≥ 0. - You start on th...

Coding & Algorithms
2
0
27 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
Scale AI logo
Scale AI
Medium
Software Engineer

Compute community ranges and town idle hours

You are given two in-memory datasets for a party-planning app. 1) PartyWindow: {partyId: string, startTime: ISO-8601 UTC datetime, endTime: ISO-8601 U...

Coding & Algorithms
12
0
135 people solved
Sep 6, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Count k for consecutive-sum generator

An array generator service produces a consecutive-integers array starting at a positive integer k: [k, k+1, ..., k+m−1] for some m ≥ 1. The service re...

Coding & Algorithms
13
0
93 people solved
Sep 6, 2025
Stripe logo
Stripe
Medium
Software Engineer

Generate user notifications from schedules

Given a schedule template format and user profile data (timezone, locale, delivery preferences), implement a program that generates a user notificatio...

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

Search a word in a grid

Given a 2D grid of characters and a target word, determine if the word can be traced by moving up, down, left, or right, using each cell at most once....

Coding & Algorithms
3
0
45 people solved
Sep 6, 2025
Uber logo
Uber
Medium
Software Engineer

Find next and closest palindromes

Given a non-negative integer represented as a string n (no leading zeros unless n == "0"), return the smallest palindromic integer strictly greater th...

Coding & Algorithms
6
0
65 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Find minimum time for irrecoverable password

A password is a string s of length n. A virus attacks positions in a 1-indexed order given by a permutation attackOrder[1..n]. At second t (1 <= t <= ...

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

Design an O(1) recency-evicting cache

Design and implement a fixed-capacity in-memory cache that supports get(key) and put(key, value) in average O( 1) time. When capacity is exceeded, evi...

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

Count subarrays summing to target

Given an integer array nums and an integer target T, return the number of contiguous subarrays whose sum equals T. Provide an algorithm that runs in l...

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

Design an in-memory database with TTL and history

Design and implement an in-memory key–field–value store with monotonic timestamps. Keys and fields are strings; values are integers. Provide these API...

Coding & Algorithms
9
0
100 people solved
Sep 6, 2025
LinkedIn logo
LinkedIn
Medium
Software Engineer

Solve six algorithmic problems

Answer the following independent algorithmic prompts. For each, explain your approach, justify data structures, analyze time/space complexity, and pro...

Coding & Algorithms
7
0
135 people solved
Sep 6, 2025
Google logo
Google
Medium
Software Engineer

Find minimum covering substring

Given two strings s and t, return the shortest contiguous substring of s that contains every character of t with at least the same multiplicities. If ...

Coding & Algorithms
6
0
81 people solved
Sep 6, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Count non-decreasing arrays by digit sums

You are given an array required_sums of length n. Count how many non-decreasing arrays result[1..n] of integers satisfy all of the following: ( 1) for...

Coding & Algorithms
5
0
60 people solved
Sep 6, 2025
UiPath logo
UiPath
Medium
Machine Learning Engineer

Implement cocktail shaker sort and analyze

Implement the cocktail shaker sort (bidirectional bubble sort) for an array of integers. Optimize it with early termination and shrinking bounds, and ...

Coding & Algorithms
4
0
33 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Find earliest time password becomes irrecoverable

You are given a password string of length n and an attack order array attackOrder[1..n], a permutation of 1..n. At second i (1-indexed), the virus rep...

Coding & Algorithms
1
0
9 people solved
Sep 6, 2025
Apple logo
Apple
Medium
Software Engineer

Design a rolling five-minute hit counter

Design an in-memory hit counter that supports: ( 1) recordHit(timestamp) to log an event, and ( 2) getCountLast5Minutes(now) to return the number of e...

Coding & Algorithms
5
0
74 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Insert and merge an interval

You are given a list of pairwise non-overlapping closed intervals [si, ei] sorted by start time, and a new interval [s, e]. Insert [s, e] into the lis...

Coding & Algorithms
5
0
44 people solved
Sep 6, 2025