Tiktok Data Scientist Coding & Algorithms Interview Questions
Master your tech interview with our curated database of real questions from top companies.
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...
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...
Optimize Job Routing in Parallel Machine Scheduling
Scenario In the Production Factory game, jobs with varying processing times arrive and must be routed through two parallel machines to minimize total ...
Optimize Station Sequence for Maximum Car Output in Simulation
Scenario The Car-Building mini-game lets you sequence chassis, engine, and paint stations with limited buffers. Question Describe a strategy to maximi...
Analyze DFS, BFS, and A* trade-offs
Given a weighted graph with nodes {S,A,B,C,D,G} and edges: S–A(2), S–B(5), A–C(2), B–C(1), C–D(2), D–G(1), B–G(20). Heuristic for A: h(A)=4, h(B)=3, h...
Implement K-means and run two iterations
Given points P={(0,0),(0,2),(2,0),(2,2),(8,8),(8,10),(10,8),(10,10)} and k=2, (1) initialize centroids with k-means++ using seed=42 and Euclidean dist...