InterviewLegend

Dynamic Programming

Alex Chen35 min readUpdated 74 real interview reports

Most OpenAI coding rounds are builds, but some candidates also get a live algorithm round, and dynamic programming comes up there. In one detailed account, a single grid problem was asked three ways in one session. The interviewer asked for the best score first, then for a path that earns it, then for the number of paths that tie. The build rounds add follow-ups the same way. The design you pick for the first ask decides whether the next two are small additions or a rewrite, so before you write the loop, say in one sentence what the state is. In the grid, it's the best score landing on a cell after u jumps. If the state is missing a dimension, you'll often notice while you're saying it.

The question about runs that avoid a Premium question comes from the HackerRank online assessment instead, where nobody is there to clarify the wording. Its prompt calls the runs "sub-sequences", but the sample shows it means consecutive integers, so check the samples before you trust the prompt.

OpenAIPremium lesson · Coding round

The 3 OpenAI problems are below.

  1. A Premium questionCoding · Medium
  2. A Premium questionCoding · Hard
  3. A Premium questionCoding · Medium

Each with hints, the follow-up and a tested solution.

Get the OpenAI questions

$49 a year · all 100 companies · cancel anytime

From 20,000+ candidate reports, forum threads behind logins and write-ups in Chinese.

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

Know what OpenAI asks before you walk in.

31 coding · 6 system design · 19 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.