TikTok Coding & Algorithms Interview Questions

Preparing for TikTok Coding & Algorithms interview questions means expecting a fast-paced, implementation-heavy process that blends timed online assessments and live pair-programming. What’s distinctive is the combination of algorithmic depth and production-minded expectations: interviewers look for correct and efficient algorithms, clean and idiomatic code, clear complexity analysis, robust handling of edge cases and tests, and the ability to explain tradeoffs concisely. For front-end or platform-adjacent roles you may also face language- or framework-specific problems (for example JavaScript/React), while senior roles commonly add system-design flavor to the evaluation. In practice you should expect an initial online assessment (multiple problems on a coding platform) followed by 45–60 minute technical screens that mix 1–2 LeetCode-style problems with resume questions. Good interview preparation focuses on timed problem practice (arrays, strings, trees, graphs, dynamic programming, hashing, two-pointers), writing and running code in a shared editor, narrating your thought process, and practicing clean test cases. Do mock interviews, review core library functions in your primary language, and rehearse concise explanations of complexity and tradeoffs—these habits improve speed, correctness, and the communication TikTok typically evaluates.

92 Questions 1 Company03.01.2026
Showing 20 results
Role
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
Data Scientist

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

Coding & Algorithms
28
0
53 people solved
Jul 12, 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
Software Engineer

Delete nodes in linked list and binary tree

You are asked to solve two short coding tasks. You may assume standard node definitions: - Singly linked list node: val, next - Binary tree node: val,...

Coding & Algorithms
3
0
69 people solved
Feb 11, 2026
TikTok logo
TikTok
Medium
Software Engineer

Solve string grouping and tree right-view problems

Problem 1: Group words that are anagrams You are given an array of strings words. Two strings are anagrams if they contain the same characters with th...

Coding & Algorithms
8
0
89 people solved
Feb 11, 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
Hard
Software EngineerIntern Locked

Solve grid shortest-path and tree DP

This question pair evaluates proficiency in fundamental algorithmic techniques: finding shortest paths in a grid via breadth-first search and applying...

Coding & Algorithms
3
0
34 people solved
Jan 6, 2026
TikTok logo
TikTok
Easy
Software Engineer Locked

Solve three classic coding problems

These tasks evaluate algorithmic problem-solving, data structure mastery, and implementation skills within the Coding & Algorithms domain, touching on...

Coding & Algorithms
4
0
37 people solved
Dec 24, 2025
TikTok logo
TikTok
Easy
Software Engineer

Implement an LRU cache

Problem: LRU Cache Design and implement a data structure that supports an LRU (Least Recently Used) cache with a fixed capacity. Requirements Implemen...

Coding & Algorithms
5
0
74 people solved
Dec 15, 2025
TikTok logo
TikTok
Medium
Software Engineer

Find kth smallest in sorted 2D matrix

You are given an n x m matrix of integers where each row and each column is sorted in non-decreasing order. You are also given an integer k such that ...

Coding & Algorithms
3
0
52 people solved
Dec 8, 2025
TikTok logo
TikTok
Hard
Data Engineer

Count islands using BFS without modifying grid

You are given an m x n binary grid grid where: - 1 represents land - 0 represents water - Islands are groups of horizontally or vertically adjacent la...

Coding & Algorithms
6
0
74 people solved
Oct 19, 2025
TikTok logo
TikTok
Medium
Software Engineer

Maximize min+max of contiguous subarray

You are given an array of n positive integers nums. Find a contiguous subarray that contains at least two elements and maximizes the value: > (minimum...

Coding & Algorithms
6
0
51 people solved
Oct 11, 2025
TikTok logo
TikTok
Hard
Software Engineer

Compute maximum path sum in a binary tree

Question You are given the root of a binary tree where each node contains an integer value (which may be positive, zero, or negative). Return the maxi...

Coding & Algorithms
5
0
59 people solved
Oct 3, 2025
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
TikTok logo
TikTok
Medium
Software Engineer

Compute waits and find distance-k node pairs

Part 1 — Array next-higher wait: Given an integer array A where A[i] is the measurement for day i (0-indexed), return an array W of the same length su...

Coding & Algorithms
3
0
34 people solved
Sep 6, 2025
TikTok logo
TikTok
Medium
Software Engineer

Design LRU cache with O(1) operations

Design and implement an in-memory cache that evicts the least recently used entry when capacity is reached. Support get(key) and put(key, value) in O(...

Coding & Algorithms
2
0
27 people solved
Sep 6, 2025
TikTok logo
TikTok
Medium
Software Engineer

Solve grid min path and sqrt by binary search

1) Given an m x n matrix of non-negative integers, find a path from the top-left to the bottom-right that minimizes the sum of cell values. You may on...

Coding & Algorithms
4
0
49 people solved
Sep 6, 2025
TikTok logo
TikTok
Medium
Software Engineer

Segment a message with width-constrained suffixes

Given a message string s and an integer width W, split s into consecutive segments and append a suffix "i/n" to each segment indicating its 1-indexed ...

Coding & Algorithms
5
0
42 people solved
Sep 6, 2025
TikTok logo
TikTok
Medium
Software Engineer

Count islands on a torus grid

You are given an m x n binary grid representing water ( 0) and land ( 1) laid out on a torus: the top edge is adjacent to the bottom edge and the left...

Coding & Algorithms
3
0
22 people solved
Sep 6, 2025
TikTok logo
TikTok
Medium
Software Engineer

Solve array and tree algorithm challenges

Solve the following three algorithmic tasks: 1) Unique triplet sum: Given an integer array nums and an integer target (default 0), return all unique t...

Coding & Algorithms
4
0
38 people solved
Aug 13, 2025

Frequently Asked Questions

How difficult are TikTok Coding & Algorithms interview questions?
TikTok Coding & Algorithms interviews are typically in the medium-to-hard range, with variation by team and seniority. Many candidates report a majority of medium problems and a significant portion of hard problems for senior roles; entry-level roles skew easier but still require solid algorithmic fluency. Interviewers evaluate correctness, complexity reasoning, and the ability to iterate toward an optimized solution under time pressure. Expect to explain tradeoffs, defend complexity claims, and handle edge cases. Difficulty also depends on role focus: platform or recommendation teams often ask graph and large-data problems, while product-facing teams emphasize strings, arrays, and implementation details.
What is the typical interview process at TikTok and where do Coding & Algorithms questions appear?
The TikTok interview flow commonly starts with a recruiter screen and proceeds through one or two technical coding interviews, followed by system design and behavioral rounds for mid-to-senior roles. Coding & Algorithms questions appear early and often: they are central to phone screens and the technical onsite segments where live coding is used to assess problem decomposition, correctness, and optimization. For data- or ML-focused roles, algorithmic problems may be tailored to large-scale data processing and graph algorithms. Some teams use online assessments or take-home tasks before scheduling live interviews.
How should I schedule my preparation timeline for TikTok Coding & Algorithms interviews?
A practical preparation timeline is structured and incremental: spend the first two to three weeks reinforcing fundamentals—arrays, strings, linked lists, trees, hashing—and complexity analysis. The next three to four weeks focus on pattern-based practice: sliding window, two pointers, BFS/DFS, heaps, binary search, union-find, and dynamic programming, solving medium-to-hard problems under timed conditions. In the final one to two weeks, emphasize mock interviews, end-to-end solutions with clear communication, and targeted weak-point remediation. Include periodic system-design review if interviewing for senior roles and practice explaining tradeoffs concisely.
Which key subtopics should I study for TikTok Coding & Algorithms interviews?
Prioritize core data structures and algorithmic patterns that commonly surface in social-platform interviews: graph algorithms (BFS/DFS, shortest paths, union-find), trees, heaps, and hash-based techniques. Master arrays and strings, two-pointer and sliding-window strategies, binary search, sorting, and priority-queue use cases. Dynamic programming and recursion deserve focused practice for medium-to-hard problems. Also build intuition for time and space complexity, edge-case handling (NULLs, empty inputs, off-by-one), and practical performance considerations like in-place operations and amortized analysis. For roles tied to recommendations, practice large-data aggregation and streaming-style logic.
What standout tips and common pitfalls should I keep in mind for TikTok Coding & Algorithms interviews?
Standout tips include clarifying requirements up front, stating assumptions, and outlining a high-level approach before coding. Communicate complexity tradeoffs as you refine the solution and run through representative test cases aloud. Use iterative improvement: present a correct brute force, then optimize. Common pitfalls are diving into code without confirming constraints, ignoring edge cases, failing to test, and not communicating when stuck. Avoid premature optimization and overengineering; interviewers value clear reasoning, clean code, and the ability to adapt to hints or changing constraints. End by summarizing correctness and complexity.

Explore more TikTok Coding & Algorithms interview questions

Real questions from candidate reports, grouped by role, topic and company.

By role
Other categories at TikTok
Coding & Algorithms questions at other companies
Browse all