TikTok Machine Learning Engineer Coding & Algorithms Interview Questions

Practice 16 real Coding & Algorithms interview questions for Machine Learning Engineer roles at TikTok.

16 Questions 1 Company02.12.2026
Showing 16 results
Role
TikTok logo
TikTok
Hard
Machine Learning Engineer Locked

Implement local maxima, bagging, and k-means

This question evaluates skills in algorithm implementation and machine learning fundamentals—specifically streaming local maxima detection, bootstrap ...

Coding & Algorithms
6
0
81 people solved
Jan 22, 2026
TikTok logo
TikTok
Medium
Machine Learning Engineer

Differentiate virtual and pure virtual functions

Differentiate virtual and pure virtual functions In C++, what is the difference between a virtual function and a pure virtual function? Provide syntax...

Coding & Algorithms
5
0
42 people solved
Aug 8, 2025
TikTok logo
TikTok
Medium
Machine Learning Engineer

Maximize sum with no adjacent elements

Given an array of non-negative integers nums, choose a subset of elements such that no two chosen elements are adjacent in the original array. Return ...

Coding & Algorithms
8
0
79 people solved
Feb 12, 2026
TikTok logo
TikTok
Medium
Machine Learning Engineer

Find and count target-sum subarrays

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 c...

Coding & Algorithms
6
0
53 people solved
Jul 31, 2025
TikTok logo
TikTok
Hard
Machine Learning Engineer

Generate all safe queen placements on board

You are given an integer n representing the size of a chessboard (n × n). You need to place n queens on the board so that no two queens attack each ot...

Coding & Algorithms
4
0
42 people solved
Dec 8, 2025
TikTok logo
TikTok
Medium
Machine Learning Engineer Locked

Compute minimum path sum in a triangle

This question evaluates proficiency in dynamic programming and algorithmic problem-solving within the Coding & Algorithms domain, focusing on handling...

Coding & Algorithms
4
0
45 people solved
Jan 22, 2026
TikTok logo
TikTok
Medium
Machine Learning Engineer

Compute longest increasing subsequence

Longest Increasing Subsequence: length, reconstruction, and counting Given an integer array nums, do all of the following: 1. Length. Compute the leng...

Coding & Algorithms
3
0
41 people solved
Sep 6, 2025
TikTok logo
TikTok
Medium
Machine Learning Engineer

Determine if a string can be segmented

Given a string s and a list of strings wordDict, determine whether s can be segmented into a sequence of one or more dictionary words. - You may reuse...

Coding & Algorithms
4
0
51 people solved
Dec 15, 2025
TikTok logo
TikTok
Medium
Machine Learning Engineer

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...

Coding & Algorithms
3
0
28 people solved
Sep 6, 2025
TikTok logo
TikTok
Medium
Machine Learning Engineer

Fix a BST with two misplaced keys

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 t...

Coding & Algorithms
3
0
26 people solved
Aug 8, 2025
TikTok logo
TikTok
Medium
Machine Learning Engineer

Find second-minimal word segmentation count

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 sequ...

Coding & Algorithms
4
0
33 people solved
Aug 7, 2025
TikTok logo
TikTok
Medium
Machine Learning Engineer

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...

Coding & Algorithms
10
0
10 people solved
Aug 4, 2025
TikTok logo
TikTok
Medium
Machine Learning Engineer

Compute city skyline silhouette

Compute city skyline silhouette Compute the outer silhouette of a 2D skyline. You are given n axis-aligned rectangular buildings; each building i is (...

Coding & Algorithms
4
0
30 people solved
Jul 27, 2025
TikTok logo
TikTok
Medium
Machine Learning EngineerNew Grad

Implement stack variants and path-sum check

Coding tasks Solve the following algorithmic problems. 1) MinStack Design a stack supporting: - push(x), pop(), top() - getMin() returning the minimum...

Coding & Algorithms
11
0
78 people solved
Feb 12, 2026
TikTok logo
TikTok
Medium
Machine Learning Engineer Locked

Find length of longest common subsequence

This question evaluates understanding of dynamic programming, string algorithms, and algorithmic problem-solving skills related to sequence comparison...

Coding & Algorithms
5
0
45 people solved
Jan 22, 2026
TikTok logo
TikTok
Medium
Machine Learning Engineer

Find longest substring without repeating characters

Problem Given a string s, find the length of the longest contiguous substring that contains no repeated characters. Input - A string s (may contain le...

Coding & Algorithms
2
0
38 people solved
Sep 29, 2025

Explore more TikTok Machine Learning Engineer interview questions

Real questions from candidate reports, grouped by topic.

Browse all