TikTok Machine Learning Engineer interview questions

31 Machine Learning Engineers have shared notes from their TikTok interviews, with the questions they were asked in each round. That is 11% of the 279 TikTok interview notes on Screna AI.

31 Machine Learning Engineer interview notes

TikTok·Machine Learning Engineer·Technical Phone Screen

Jul 2026
TikTok ML Engineer interview that leaned harder into algorithms than I expected. The whole session basically lived inside one problem but they kept pulling threads on it until I was pretty much out of answers.
  • Given an integer array, find the length of the longest strictly increasing subsequence and output one valid subsequence. They wanted an O(n log n) solution using binary search, and asked you to walk through the patience sorting idea and explain how reconstruction works.
  • How would you adapt the solution to handle non-decreasing subsequences instead of strictly increasing ones, and what changes are needed when duplicates are present?
  • How would you count the total number of distinct longest increasing subsequences in the array?
  • Walk through the time and space complexity of your O(n log n) LIS approach.

“I knew LIS and had done the O(n^2) version before, but the O(n log n) path with patience sorting was something I'd only half-remembered.”

View Post

TikTok·Machine Learning Engineer·Onsite - Coding / Algorithms

Jul 2026
TikTok ML engineer coding round, four algorithmic problems back to back. The problems ranged from classic stack design to a tree path question that had a subtle twist I didn't fully appreciate until after.
  • Design a MinStack that supports push, pop, top, and getMin, where all operations must run in O(1) time.
  • Design a MaxStack that supports push, pop, top, peekMax, and popMax. For popMax, if there are multiple maximum elements, remove the one closest to the top. Discuss time complexity tradeoffs.
  • Given a continuous stream of integers, design a data structure that supports inserting numbers and querying the current median at any point.
  • Given a binary tree with positive integer node values and a target integer, determine whether there is a path starting at any node and moving only upward toward the root where the node values sum to the target. Return true or false.

“Pretty standard warmup.”

View Post

TikTok·Machine Learning Engineer·Technical Phone Screen

Jul 2026
TikTok ML engineer interview that went pretty deep into algorithmic problem-solving. The whole session was basically one big subarray sum problem broken into escalating parts, and they wanted proofs, edge case analysis, and trade-off discussion on top of working code.
  • Given an integer array and a target value, write a function that returns true if any non-empty contiguous subarray sums to the target. Aim for O(n) time.
  • Extend the previous solution to count how many contiguous subarrays sum to the target, still in O(n) time.
  • Assuming all numbers in the array are non-negative, design an O(n) time, O(1) space method to find one contiguous subarray that sums to the target. Return the start and end indices. Then explain how you'd adapt it to count all such subarrays.
  • Walk through the edge cases across all three parts: arrays with zeros, negative numbers, and very large inputs. How do the different approaches handle them?

“Prefix sums with a hash set, pretty standard.”

View Post

TikTok·Machine Learning Engineer·Technical Phone Screen

Jun 2026
TikTok ML engineer round that was basically a deep-dive into one hard geometry/algorithm problem. They wanted a full working solution plus complexity analysis and edge case handling, not just a sketch. Felt more like a systems-adjacent coding round than a pure ML interview.
  • Given n axis-aligned rectangular buildings each described by a left x-coordinate, right x-coordinate, and height, compute the outer silhouette (skyline) of all buildings combined. Return the list of critical points where the height changes, sorted by x, with no two consecutive points at the same height, and the last point dropping to zero. Aim for O(n log n) time. Implement an efficient approach such as a sweep line with a max-heap or divide-and-conquer, and explain your design. Also specify how you handle ties when multiple building edges share the same x-coordinate: entering edges before leaving, among entering edges process taller buildings first, among leaving edges process shorter buildings first. Discuss correctness, complexity, and edge cases including identical buildings, fully nested intervals, buildings that share a border, and very large coordinate values.

“This is the classic skyline problem but they pushed way further than I expected.”

View Post

TikTok·Machine Learning Engineer·Onsite - System Design / Architecture

Jun 2026
ML engineer interview at TikTok with a product design question focused on the recommendation system behind the For You page. Pretty open-ended, which I wasn't fully prepared for coming from a more traditional ML background.
  • How would you design the 'For You' recommendation feed on TikTok?

“I went straight to the ML pipeline: candidate generation, ranking, re-ranking for diversity.”

View Post

TikTok·Machine Learning Engineer·Technical Phone Screen

Jun 2026
Conceptual ML round at TikTok for an MLE role. Three questions, all theory-heavy, no coding. Felt more like a grad school oral exam than a typical tech screen.
  • Walk me through the main components of a Transformer block and explain what each one does.
  • What are the key architectural and pretraining differences between GPT and BERT, and when would you choose one over the other?
  • Define precision and recall, then explain how adjusting a classification threshold shifts the tradeoff between them. Give examples of when you'd prioritize each.

“Knew this one cold.”

View Post

TikTok·Machine Learning Engineer·Technical Phone Screen

Jun 2026
TikTok ML engineer interview that went pretty deep on Transformer internals. They wanted pseudocode, not just hand-waving, which I wasn't fully prepared for. The concept questions at the end felt almost like a relief after writing out attention by hand.
  • Write pseudocode for scaled dot-product self-attention for a single head, including tensor shapes, Q/K/V projections, scaling, softmax, and optionally an attention mask.
  • Write pseudocode for multi-class cross-entropy loss over a batch, handling both class index labels and one-hot labels, returning a scalar mean loss.
  • What does the position-wise feed-forward network in a Transformer block actually do, and why is it necessary given that attention already exists?
  • Why do we divide attention scores by the square root of the head dimension before applying softmax?

“This is where I spent most of my mental energy.”

View Post

TikTok·Machine Learning Engineer·Technical Phone Screen

Jun 2026
TikTok ML engineer round with a dynamic programming twist I didn't fully see coming. The problem looked like a standard word break at first glance but the second-smallest cost angle made it genuinely harder.
  • Given a string and a dictionary of words, a valid segmentation splits the string into dictionary words whose concatenation equals the original. The cost is the number of words used. Return the second-smallest cost across all valid segmentations, or -1 if fewer than two valid segmentations exist. Also explain your algorithm's time and space complexity and how you'd handle large inputs.

“My first instinct was to track just the minimum cost per index, which is basically the standard word break DP.”

View Post

TikTok·Machine Learning Engineer·Onsite - Multi Round

Jun 2026
TikTok ML Engineer onsite, deep resume drill on a VLM project. The whole session was basically one long question where they just kept pulling on threads until something frayed.
  • Walk me through the VLM project on your resume. What problem were you solving and how did you define success?
  • Describe the architecture: vision encoder, language model, and how you fused the two modalities.
  • What was frozen versus trainable during your training runs, and why did you make those choices?
  • Tell me about your training data: sources, label types, known biases, and how you handled train/val/test splits.
  • Walk through your full training recipe: objectives, stages, key hyperparameters, and how you evaluated progress.
  • Was the model trained end-to-end or modular? What were the practical trade-offs of that choice?
  • Where does inference time actually go in your system, and what optimizations did you try?
  • What are the known failure modes of your model, and what concrete steps would you take to address them?

“I started with the task framing and metrics, which felt natural, but I stumbled when they asked how offline metrics mapped to actual product impact.”

View Post

TikTok·Machine Learning Engineer·Technical Phone Screen

Jun 2026
TikTok ML engineer interview with a coding question on matrix traversal. Nothing too surprising but the spiral order detail trips people up if you're not careful about boundary conditions.
  • Given an m x n matrix, return all elements in clockwise spiral order.

“I've seen this before so I wasn't panicking, but I still fumbled the boundary shrinking logic midway through.”

View Post