InterviewLegend

Dynamic Programming

Alex Chen24 min readUpdated 208 real interview reports

A myth follows this loop around: TikTok barely touches dynamic programming. Worth clearing up before anything else, because it is wrong. TikTok is a product org inside ByteDance, and its coding rounds are built to hire engineers who move fast across a lot of problems. Dynamic programming is one of the families those rounds reach for. Two Premium questions, and house robber all recur in the live rounds. A Premium question minimization shows up too. And the timed assessment out front carries a harder tail: a real subsequence problem that has stumped strong candidates.

So treat this family as fair game, not a slice you can skip. By weight it is only about one coding problem in eight. But the ones you meet expect the same finish as everything else on this loop. Name a state you can say plainly. Derive the recurrence from it. Write code that passes the corner cases, then read the complexity off that recurrence. This lesson works the two shapes that cover most of what shows up, then three problems drawn straight from the recurring set.

The TikTok angle
The no-DP myth costs candidates the assessment, because that is exactly where the hard dynamic programming hides. The two coding gates at TikTok have opposite difficulty profiles. Live rounds stay around medium and lean on the well-known recurrences, so a clean a Premium question or a Premium question is the modal DP you will code with an interviewer watching. The proctored online assessment on CodeSignal is the harder half: point-weighted problems on a tight timer, hidden cases scored for partial credit, and a tail that reaches past the usual medium tier. A longest-concave-subsequence problem reported from that assessment is the kind of DP that a quadratic first idea only partly passes. Prepare the assessment tail as if it decides the loop, because it quietly ends many before a human sees you.
What's inside
  • 3 problems, worked step by step
  • about 24 min

Premium lessonTikTok interview guide

These took digging.

What candidates walked out with, from 20,000+ reports, forum threads behind logins and write-ups in Chinese. Then solved step by step.

100 companies. Checked every month.

Unlock all 100 companies

$49 a year · less than $1 a week · Cancel anytime

Had your TikTok interview?Tell us what they asked. Reviewed before it goes in, never with your name.
TikTok interview guide

Know what TikTok asks before you walk in.

20 coding · 5 system design · 18 behavioral questions

Get Premium$49 a year · Cancel anytime
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.