YourAlly

OpenAI Senior coding interview questions

These are the 7 coding questions YourAlly has tagged for OpenAI at Senior. On the YourAlly ladder this is Senior, the same level as Google L5, Meta E5 and Amazon L6.

A coding round at a large tech company usually runs 45 to 60 minutes with one or two problems. You write code that runs, test it on your own examples and state its time and space cost. At this level the bar is a correct, tested solution you reach mostly on your own, with the trade-offs said out loud.

Practice a mock OpenAI Senior coding loopPractice OpenAI coding questions

Stitch Overlapping Context ChunksFree to read

A retrieval pipeline splits documents into chunks that overlap their neighbours. Rebuild the text: start with the first chunk, and for each next chunk append only the part after the longest suffix of the text so far that equals a prefix of that chunk. Return the stitched string.

Input: chunks = ["the quick brown","brown fox jumps","jumps over"] Output: "the quick brown fox jumps over"

What a strong answer covers

  • Bounds the overlap by the next chunk's length
  • KMP prefix function on chunk + separator + tail
  • Separator character to stop overruns
  • Linear total time
  • Handles empty and identical chunks

6 more coding questions

  1. Binary Tree Maximum Path Sum Locked
  2. Group Anagrams Locked
  3. Merge k Sorted Lists Locked
  4. Product of Array Except Self Locked
  5. Two Sum Locked
  6. Word Ladder Locked

Sign up free to practice all 7

Related pages

More OpenAI Senior rounds

OpenAI coding at other levels

Other companies at this level

Company guide

OpenAI interview guide in Academy