Tech Interview Questions

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

Popular Interview Questions

Interview Questions

Practice the exact questions companies are asking right now.

9.6k Questions 505 Companies08.05.2026
Showing 20 results
Role
Microsoft logo
Microsoft
Medium
Software Engineer

Compute sum of longest positive subarray

Compute sum of longest positive subarray Given an integer array that may contain positive and negative numbers, find the sum of the longest contiguous...

Coding & Algorithms
5
0
46 people solved
Jul 16, 2025
TikTok logo
TikTok
Medium
Software Engineer

Parse chemical formula with multipliers

Parse chemical formula with multipliers Given a string representing a chemical formula, parse it and return the total count of each element. The formu...

Coding & Algorithms
3
0
34 people solved
Jul 16, 2025
Optiver logo
Optiver
Medium
Software Engineer

Detect currency arbitrage with costs

You are given a K×K matrix R of currency exchange rates where R[i][j] is the amount of currency j obtainable for one unit of currency i, and R[i][i] =...

Coding & Algorithms
36
0
261 people solved
Jul 16, 2025
Affirm logo
Affirm
Medium
Software Engineer

Implement and debug event filtering in Python

You are given a list of event dictionaries with keys: id (str), type (str), ts (int, seconds since epoch), payload (dict). Implement filter_events(eve...

Data Manipulation (SQL/Python)
1
0
5 people solved
Jul 15, 2025
Apple logo
Apple
Medium
Data Scientist

Implement sparse vector dot product and cosine similarity

Sparse Vector Class Implement a SparseVector class for high-dimensional vectors where most entries are zero. Representation Assume each vector has: - ...

Coding & Algorithms
6
0
56 people solved
Jul 15, 2025
TikTok logo
TikTok
Medium
Data Engineer

Explain a SQL query result

Given two tables and a specific SQL query, precisely explain the expected result set: which rows are returned, what each column contains, how joins/fi...

Data Manipulation (SQL/Python)
1
0
10 people solved
Jul 15, 2025
Meta logo
Meta
Medium
Software Engineer

Solve two string algorithm tasks

Solve two string algorithm tasks Answer both parts. A) Parentheses correction: Given a string s consisting only of '(' and ')', output the minimum num...

Coding & Algorithms
3
0
25 people solved
Jul 15, 2025
TikTok logo
TikTok
Medium
Software Engineer

Write complex SQL for cohorts and retention

Given tables users(uid, created_at, country), orders(order_id, uid, amount, created_at, status), and events(uid, ts, event_type, campaign), write one ...

Data Manipulation (SQL/Python)
0
0
9 people solved
Jul 15, 2025
Uber logo
Uber
Medium
Software Engineer

Implement uniform sampling in squares

Implement uniform sampling in squares Implement a class Square representing an axis-aligned square on the 2D plane that supports sampling a uniformly ...

Coding & Algorithms
6
0
75 people solved
Jul 15, 2025
SoFi logo
SoFi
Medium
Software Engineer

Design a key-value store with getLast

Design a key-value store with getLast Design and implement an in-memory key–value store with this API: add(key, value), get(key), remove(key), and get...

Coding & Algorithms
11
0
82 people solved
Jul 15, 2025
Google logo
Google
Medium
Software Engineer

Decide string transform with directional tokens and walls

Decide string transform with directional tokens and walls You are given two equal-length strings start and target of length n, each consisting only of...

Coding & Algorithms
4
0
59 people solved
Jul 15, 2025
TikTok logo
TikTok
Medium
Software Engineer

Reconstruct a tree from two traversals

Reconstruct a tree from two traversals Given two arrays representing the preorder and inorder traversals of a binary tree with unique values, reconstr...

Coding & Algorithms
4
0
45 people solved
Jul 15, 2025
TikTok logo
TikTok
Medium
Software Engineer

Check if two-group seating is possible

Check if two-group seating is possible Given an undirected graph represented as an adjacency list where adj[i] lists the indices of guests who know gu...

Coding & Algorithms
2
0
26 people solved
Jul 15, 2025
Meta logo
Meta
Medium
Software Engineer

Implement weighted random index picker

Implement weighted random index picker Design a class WeightedPicker that is initialized with an array of positive integer weights w and supports pick...

Coding & Algorithms
2
0
24 people solved
Jul 15, 2025
Amazon logo
Amazon
Medium
Software Engineer

Design 2D DP on a DAG

Design 2D DP on a DAG Given a directed acyclic graph G(V, E) with N nodes, M edges, a designated source s, and an integer L, design a 2D dynamic progr...

Coding & Algorithms
6
0
54 people solved
Jul 15, 2025
Meta logo
Meta
Medium
Software Engineer

Evaluate arithmetic expression without parentheses

Evaluate arithmetic expression without parentheses Write evaluate(s: string) to compute the value of an arithmetic expression containing non-negative ...

Coding & Algorithms
3
0
38 people solved
Jul 15, 2025
TikTok logo
TikTok
Medium
Data Engineer

Debug a Hive insert query

Given a Hive table schema and an incoming table plus an INSERT/SELECT statement meant to inject data, identify why the query fails and provide step-by...

Data Manipulation (SQL/Python)
0
0
5 people solved
Jul 15, 2025
Meta logo
Meta
Medium
Data Engineer

Write SQL and Python for data prep

Given clickstream events (user_id, event_type, ts, properties) and a users table (user_id, signup_ts, plan), write SQL to compute DAU/WAU/MAU, D1/W1 r...

Data Manipulation (SQL/Python)
1
1
8 people solved
Jul 15, 2025
DoorDash logo
DoorDash
Medium
Software Engineer

Debug and refactor a legacy module

Given a legacy module named DasherPicker and a failing test suite, systematically debug and refactor the code while following a provided review checkl...

Coding & Algorithms
40
0
310 people solved
Jul 15, 2025
Amazon logo
Amazon
Medium
Software Engineer

Brainstorm a business problem approach

Brainstorm a business problem approach Analytics & Experimentation Brainstorm (Scenario Provided) Context You are evaluating a feature proposal for a ...

Analytics & Experimentation
4
0
42 people solved
Jul 15, 2025