call(back)

TikTok

ByteDance's process on TikTok's teams: a CodeSignal assessment for interns and new graduates, rounds scheduled one at a time, oral fundamentals for infra and SRE roles, and a hiring manager who asks about pace.

Typical loop

  1. 1CodeSignal assessment for interns and new graduates
  2. 2Phone screen: resume deep dive, then coding with your own test cases
  3. 3Second technical round: coding or system design
  4. 4USDS and infra loops add a Linux and networking round
  5. 5Hiring-manager round, then team match

Questions

Callback's practice questions and the LeetCode questions TikTok has been asking, filtered together.

Practice questions

Course Schedule

Algorithms & Data Structures · Cycle detection dressed up as a scheduling question.

mediumSign in to star problems

Number of Islands

Algorithms & Data Structures · Flood fill from every unvisited land cell — and know when DFS, BFS or union-find fits.

mediumSign in to star problems

Median of a Stream I

Algorithms & Data Structures · Two heaps — a max-heap for the lower half, a min-heap for the upper — rebalanced on every add.

hardSign in to star problems

Basic Calculator II

Algorithms & Data Structures · One pass with a stack of signed terms; the trap is integer division truncating toward zero.

mediumSign in to star problems

Word Search on a Letter Grid

Algorithms & Data Structures · Build the trie first and say why: it prunes the DFS the moment a prefix does not exist.

hardSign in to star problems

Merge Overlapping Intervals

Algorithms & Data Structures · Sort, then sweep — the pattern behind a dozen calendar problems.

mediumSign in to star problems

LRU Cache

Algorithms & Data Structures · Hash map plus doubly linked list, all operations O(1).

mediumSign in to star problems

Min Stack

Algorithms & Data Structures · A second stack holds the minimum at each depth, so getMin is just its top.

easySign in to star problems

Square Root Without Math.sqrt

Algorithms & Data Structures · Binary-search the root in [0, max(1, x)] for a fixed number of rounds — an epsilon loop never ends for large x.

easySign in to star problems

Topological Sort

Algorithms & Data Structures · Kahn's algorithm with a min-heap in place of the queue: in-degrees, a frontier of ready nodes, and an empty result when a node never becomes ready.

mediumSign in to star problems

Seller Task Scheduler

Algorithms & Data Structures · Per-seller priority with FIFO ties, sellers taking turns in activation order, and VIP sellers taking up to two tasks per turn; the turn state has to survive between calls.

mediumSign in to star problems

Task Scheduler With Removal

Algorithms & Data Structures · addTask, removeTask and a destructive popTask(num) in timestamp order: a heap with lazy deletion, and a version per task so stale heap entries are recognised.

mediumSign in to star problems

LRU Cache With Expiry

Algorithms & Data Structures · The LRU follow-up: every entry carries a time-to-live, an expired entry is a miss, and expired entries must not take up capacity when something has to be evicted.

mediumSign in to star problems

Subarray With the Largest Min Plus Max

Algorithms & Data Structures · It looks like a sliding-window problem and is not one: the best subarray of length two or more is always an adjacent pair.

easySign in to star problems

More Than a Third in a Sorted Array

Algorithms & Data Structures · In a sorted array a value that fills more than a third must cover the index at n/3 or at 2n/3, so two probes and four binary searches replace the scan.

mediumSign in to star problems

Docstring Naming Conversion

Algorithms & Data Structures · Inside backticks, snake_case identifiers become camelCase and UPPER_CASE constants stay; everything else, including every space, is copied through.

easySign in to star problems

Cyclic Number Pairs

Algorithms & Data Structures · Count pairs of numbers that are digit rotations of each other: give every number a canonical rotation and count equal keys instead of comparing pairs.

mediumSign in to star problems

Count Alternating-Parity Subarrays

Algorithms & Data Structures · Count the subarrays in which neighbours always differ in parity: the number ending at each index is the length of the current alternating streak.

easySign in to star problems

Aligned Memory Allocator

Algorithms & Data Structures · Simulate alloc and erase over a bit array where blocks must start on an 8-cell boundary; the care is in ids, bounds and erasing something twice.

mediumSign in to star problems

Reverse Words, Keeping the Spacing

Algorithms & Data Structures · Reverse the order of the words while every run of spaces stays exactly where it was, including leading and trailing runs.

easySign in to star problems

All Valid Expansions of Wildcard Parentheses

Algorithms & Data Structures · The follow-up to the wildcard validity check: enumerate every distinct balanced string the stars can produce, pruning on the running balance.

mediumSign in to star problems

Is the Tic-Tac-Toe Game Over?

Algorithms & Data Structures · Given an n by n board, decide whether a player has completed a row, column or diagonal, or the board is full; then make it constant time per move.

easySign in to star problems

Longest Zigzag Path in a Grid

Algorithms & Data Structures · A path whose value comparisons strictly alternate up and down. Unlike the longest increasing path, it can turn back on itself, so it needs backtracking with a visited set rather than memoisation.

mediumSign in to star problems

Cheapest Grid Path With a Fuel Tank

Algorithms & Data Structures · Each cell has an entry cost, each step burns a unit of fuel, and marked cells refill the tank: Dijkstra over (row, column, fuel left), then the follow-up for a very large tank.

hardSign in to star problems

Count Path Sums in an N-ary Tree

Algorithms & Data Structures · Count downward paths that add up to a target when a node can have any number of children: a prefix-sum counter that is scoped to the current root-to-node path.

mediumSign in to star problems

Binary Tree Maximum Path Sum, With the Path

Algorithms & Data Structures · The maximum path sum is the warm-up; the follow-up wants the nodes on the path, which means recording which arm each node extends and stitching two arms together at the best bend.

hardSign in to star problems

Count Islands on a Torus

Algorithms & Data Structures · Number of Islands where the top edge touches the bottom and the left edge touches the right: wrap the neighbour arithmetic, then discuss union-find and cell flips.

mediumSign in to star problems

Reverse the Order of K-Groups

Algorithms & Data Structures · Not the usual reversal inside each group: the groups of k nodes change places while each keeps its internal order, done by prepending each group to the result.

mediumSign in to star problems

Asked on LeetCode

362 questions · all time