Tiktok Machine Learning Engineer Interview Questions
Practice the exact questions companies are asking right now.
Count subarrays summing to target
Question LeetCode 560. Subarray Sum Equals K – Given an integer array nums and an integer k, return the total number of continuous subarrays whose sum...
Design query generation system
System Design: Query-Generation to Maximize CTR Context You are designing a real-time system that generates and ranks search query suggestions shown t...
Walk through resume under pressure and critique
Behavioral & Leadership: Projects, Trade-offs, Feedback, and Communication Context You are interviewing for a Machine Learning Engineer role. The inte...
Discuss resume projects under pressure
Behavioral Prompt: Walk Through Four Resume Projects (ML Engineer Onsite) Provide an in-depth walkthrough of four projects from your resume. For each ...
Compute longest increasing subsequence
Given an integer array nums, compute the length of a longest strictly increasing subsequence and also output one valid subsequence. Aim for an O(n log...
Determine frog reachability across stones
You are given a sorted array of distinct integers stones representing stone positions in a river, where stones[0] = 0. A frog starts on stone 0; its f...
Implement attention and nucleus sampling; compare to top-k
Implement Multi‑Head Attention and Nucleus (Top‑p) Sampling Context You are building core components used in Transformer-based language models. Implem...
Explain overfitting, imbalance, undersampling, and attention heads
Context You are designing and evaluating production machine learning models, with emphasis on classification, reliability, and efficient architectures...
Fix a BST with two misplaced keys
You are given the root of a binary search tree in which exactly two nodes’ keys were accidentally swapped. Restore the tree so that its in-order trave...
Describe internship and research projects
Behavioral/Leadership Prompt: Two Projects (Internship + Research) Context You are interviewing for a Machine Learning Engineer role during a technica...
Design LLM-enhanced recommendation solutions
System Design: Incorporating Large Language Models (LLMs) into a Large-Scale Recommendation System Context You are designing enhancements for a high-t...
Differentiate virtual and pure virtual functions
In C++, what is the difference between a virtual function and a pure virtual function? Provide syntax examples, describe dynamic dispatch via the vtab...
Find second-minimal word segmentation count
Given a string s and a dictionary D of non-empty words, define a 'segmentation' as splitting s into a sequence of words from D whose concatenation equ...
Find and count target-sum subarrays
Given an integer array nums and an integer target, implement: ( 1) a function that returns true if any non-empty contiguous subarray sums to target; (...
Design query generation to maximize CTR
System Design: End-to-End Query Generation to Maximize CTR Context You are designing the query-generation layer for a consumer search/recommendation p...
Compute city skyline silhouette
Compute the outer silhouette of a 2D skyline. You are given n axis-aligned rectangular buildings; each building i is (Li, Ri, Hi) with 0 <= Li < Ri an...