Data Scientist Coding & Algorithms Interview Questions
Master your tech interview with our curated database of real questions from top companies.
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...
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...
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...
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...
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...
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...
Calculate 7-Day Rolling Average for Energy Consumption
Scenario Hiring manager wants a quick coding exercise to verify programming fluency. Question Write a Python function that takes a list of daily energ...
Calculate 95% Bootstrap Confidence Interval for Order Values
Scenario An e-commerce firm wants a 95% confidence interval for the average order value but only has a single historical sample of order amounts. Ques...
Maximize Distinct Purchases Within Budget Constraints
Scenario Given a customer budget and a list of product prices, determine the maximum number of distinct products the customer can afford. Question Des...
Maximize Stock Trading Profits Using Dynamic Programming
Scenario Evaluating dynamic-programming skills on stock-trading profits. Question Given an array of daily stock prices and an integer K, write Python ...
Determine Circle Intersection Status for Rendering Order
Scenario Graphics engine must evaluate multiple pairs of circles to decide rendering order based on intersection. Question Given an array where each e...
Identify Number Pairs Adding to Target in Array
Scenario Coding round to identify all number pairs that add up to a target in an array containing duplicates. Question Given an integer array (may con...
Implement Reservoir Sampling; Analyze Time and Space Complexity
Scenario Process an unbounded stream of user IDs and maintain a uniform random sample of k users in memory. Question Implement reservoir sampling for ...
Compute Averages of Unique Numbers in Dictionary Lists
Scenario Python tech screen: given a dictionary mapping keys to numeric lists, e.g., {'a':[1,2,1],'b':[1,2,3]}, compute the average of each list after...
Implement Data Structure for Top-K Elements in Streams
Scenario Analytics feature that must constantly report the K largest numbers seen so far. Question Implement a data structure that ingests a stream of...
Implement DelayQueue with Idempotent Task Execution
Scenario Message broker offers DelayQueue where tasks execute at future timestamps, ensuring idempotency on duplicate IDs. Question Implement a delay ...
Identify Bugs in Python Script for User Assignment
Scenario A simple Python script assigns users to experiment groups and triggers the free-trial offer. Question Inspect the script and list any bugs or...