Coding & Algorithms Interview Questions
Master your tech interview with our curated database of real questions from top companies.
Convert stack samples to trace events
Question Implement convertToTrace(samples) that, given a chronologically ordered vector of stack samples (each sample contains a timestamp and a call-...
Implement in-memory DB querying
Question Implement an in-memory database that supports: 1. Querying the whole table and returning only selected columns (projection). 2. Adding WHERE ...
Generate Synthetic Clickstream Data with Python Function
Scenario The analytics team needs to generate synthetic click-stream records to test a new reporting pipeline before real traffic arrives. Question Wr...
Detect shuffle-mode sequence
Question Given a playlist of distinct songs and two player modes—Random (each next song chosen independently and uniformly at random, with replacement...
Implement matrix-indexing and expression resolver
Question Given a text file path whose contents include a single block starting with a line like "[2,4]" followed by rows of equal-length characters (e...
Calculate area, flush probability, egg drops
Question Given two quarter-circles inside a 1×1 square (centers at bottom-left and top-right corners), find the exact area of their overlapping region...
Solve string merge and grid path tasks
Question Given two equal-length strings s1 and s2, create a new string by iterating i = 0 … n-1, comparing s1[i] with s2[n-1-i]: append s1[i]; if the ...
Compute minimum passes to collect numbers
Question You are given an array shelf of n distinct integers that is a permutation of 1…n. Starting with target = 1, you repeatedly scan shelf from le...
Automate Python Virtual Environment Setup on Linux Terminal
Scenario Shell script that automates Python virtual-environment setup on a Linux terminal during a tech interview Question Walk through the script lin...
Allocate refund across payments
Question Given a list of completed payment transactions (each with payment method, date, and amount) and a refund amount R, write an algorithm that is...
Identify Pirate Themes Using Similarity Score Algorithm
Scenario Engineering wants an automated way to spot custom themes that are probably just pirate themes in disguise. Question Write Python that takes t...
Explain Python Virtual Environment Setup and Function Analysis
Scenario Technical screen where candidate and interviewer jointly walk through Python code snippets used in a data-science repository. Question Show h...
Compute minimum passes over permutation
Question You are given an array shelf representing a permutation of the integers 1..n. Starting with target = 1, you repeatedly scan the array left-to...
Solve Aptitude Test: Logical, Numerical, Verbal Reasoning
Scenario Pre-employment aptitude screen assessing logical, numerical and verbal reasoning within a strict time limit Question You have 15 minutes to s...
Find exit URL via BFS API calls
Question Design and implement a function that, given a starting URL "/", performs BFS or DFS by repeatedly sending HTTP GET requests of the form GET "...
Explain Shell Script Line-by-Line for Data Science Workflows
Scenario Technical screening for a Principal Data Scientist: reviewing shell script and Python classes Question Explain, line by line, what the provid...
Solve Search Insert Position Using Binary Search
Scenario Live coding round for an Amazon Applied Scientist position; candidate must solve LeetCode 35 (Search Insert Position) without helper librarie...
Process auth requests with fraud rules
Question Implement a function that, given a list of Authorization Requests (timestamp_seconds, unique_id, amount, card_number, merchant), outputs a hu...
Solve Data Structure Challenges with Python Algorithms
Scenario You are given coding challenges in Python to manipulate simple data structures. Question Remove duplicates from a list of integers while pres...
Optimize Driver Repositioning for Minimal Pickup Time
Scenario Design and implement algorithms for ride-sharing dispatch and capacity planning. Question Given historical rider demand density and current d...