DEV Community

Feng Zhang
Feng Zhang

Posted on • Originally published at prachub.com

Top 20 TikTok Coding Interview Questions (2026)

TikTok coding interviews usually mix classic algorithm work with implementation tasks that feel close to production code. Across technical screens, onsite rounds, and take-home projects, you should expect arrays, graphs, trees, dynamic programming, and a fair amount of "build this utility" style work, especially for JavaScript-heavy roles.

Below are 20 of the most discussed TikTok coding questions reported by candidates, pulled from a larger set of TikTok coding interview questions. I grouped them by pattern because that is often the best way to study.

Array and prefix-sum questions

  1. Count subarrays summing to target (Medium), Technical Screen

    This is a standard prefix sum plus hashmap problem, and interviewers ask it because it shows whether you can move past the brute-force O(n^2) scan. Be ready to explain why storing prior prefix sums lets you count matches in one pass.

  2. Find and count target-sum subarrays (Medium), Technical Screen

    This is close to the previous problem, which tells you something about TikTok's process. Repeated patterns matter. If you understand the prefix-sum invariant well, this one becomes a clean exercise in frequency tracking and edge-case handling.

  3. Find k-th largest element in array (Medium), Technical Screen

    This question checks whether you know the tradeoffs between sorting, heaps, and quickselect. A strong answer is not just code, it is a short comparison of expected time, worst-case time, and why you picked one approach.

  4. Find first and last index of target (easy), Technical Screen

    TikTok still asks easy-level binary search questions because many candidates get boundary logic wrong under pressure. Practice writing two biased binary searches, one for the left boundary and one for the right.

  5. Maximize watched duration under consecutive-sum limit (easy), Technical Screen

    This looks like a product-flavored constraint problem, but it is usually a sliding window question. Interviewers want to see whether you can spot when a window can expand and shrink in linear time instead of trying every subarray.

Strings and sliding-window patterns

  1. Find longest substring without repeating characters (medium), Onsite

    This is a common sliding-window question, but onsite interviewers often push on details like how you update the left pointer after a repeat. Use it to show that you can reason about state changes cleanly, not just recite a memorized answer.

  2. Solve message splitting and board crushing (Medium), Technical Screen

    This type of paired problem is less about one exact trick and more about adaptability. Message splitting often tests careful indexing and constraints, while board-crushing style tasks test simulation, repeated passes, and clean state updates.

  3. Solve string grouping and tree right-view problems (medium), Take-home Project

    The string grouping half usually checks hashmap design and normalization logic. In take-home settings, interviewers also care about code structure, naming, and whether your solution is easy to read a day later.

Trees and graph traversal

  1. Count islands using BFS without modifying grid (hard), HR Screen

    The interesting part here is "without modifying grid," which forces you to use visited tracking instead of mutating input. That small constraint is a good reminder to read the prompt closely, because TikTok interviewers often add limits that rule out the default shortcut.

  2. Compute pipeline order from dependencies (Medium), Technical Screen

    This is topological sorting in a more practical wrapper. Expect follow-ups on cycle detection, invalid input, and whether your method is based on indegrees plus queue or DFS postorder.

  3. Compute maximum path sum in a binary tree (hard), Technical Screen

    This is a recursion-heavy tree DP question that shows whether you can separate "best path through this node" from "best branch returned upward." Many candidates mix those two values, so define them out loud before you code.

  4. Implement stack variants and path-sum check (medium), Technical Screen

    The path-sum portion usually tests tree traversal with a running total, while the stack portion tests basic data structure design. In mixed rounds like this, the company is checking how quickly you can reset and switch patterns.

  5. Implement stacks, streaming median, and upward path sum (easy), Onsite

    This kind of onsite bundle is about breadth. Streaming median checks heap design. Upward path sum checks tree reasoning. The stack question checks whether you write basic code fast without mistakes.

Linked lists, caches, and data structure design

  1. Implement an LRU cache (easy), Technical Screen

    LRU cache is a favorite because it tests whether you know how hashmaps and doubly linked lists work together for O(1) operations. Interviewers care a lot about edge cases here, especially updates to existing keys and eviction order.

  2. Reverse nodes in even-length linked-list groups (medium), Technical Screen

    This question is a pointer-management test more than anything else. Before coding, map out the group boundaries and reconnect steps, because most bugs come from losing track of the node before or after the reversed segment.

  3. Flatten object & Promise.all (Medium), Technical Screen

    This pair is common for frontend or full-stack candidates. Flattening an object checks recursion and path construction, while implementing Promise.all checks async control flow, ordering, error propagation, and whether you understand the contract of a built-in API.

Dynamic programming and optimization

  1. Compute longest increasing subsequence (Medium), Onsite

    LIS is a classic because it gives interviewers two paths to discuss, the straightforward O(n^2) DP and the faster O(n log n) method. A solid interview answer starts with the simpler idea, then upgrades if time allows.

  2. Compute length of longest increasing subsequence (medium), Technical Screen

    This variant focuses only on the length, which often makes the binary-search approach easier to present. Make sure you can explain what the tails array means, because coding it without the intuition tends to fall apart in follow-up questions.

  3. Maximize sum with no adjacent elements (medium), Onsite

    This is basic dynamic programming, but it is a good test of whether you can define a state clearly. Interviewers often want the space-optimized version too, so practice reducing the DP table to a couple of variables.

Multi-problem take-home sets

  1. Solve four algorithm design tasks (Medium), Take-home Project Take-home sets measure more than raw problem-solving speed. TikTok often uses them to see whether you can produce organized, tested code across several small tasks without falling apart on the later questions.

A clear pattern shows up across these 20 questions. TikTok likes standard interview topics, but it often packages them in mixed rounds or product-flavored prompts that reward calm reading and quick pattern recognition. If your interview is coming up, spend extra time on prefix sums, sliding windows, tree recursion, heaps, linked list pointer work, and core design questions like LRU and Promise.all.

For broader practice, PracHub has 95+ TikTok coding questions, including these high-engagement ones and many more reported by candidates.

Top comments (0)