YourAlly

OpenAI Staff coding interview questions

These are the 6 coding questions YourAlly has tagged for OpenAI at Staff. On the YourAlly ladder this is Staff (E6), the same level as Google L6, Meta E6 and Amazon L7.

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 interviewers also expect clean code quickly and edge cases you raise before they do.

Practice a mock OpenAI Staff coding loopPractice OpenAI coding questions

Binary Tree Maximum Path SumFree to read

A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear in the sequence at most once. The path does not need to pass through the root. Return the maximum path sum of any non-empty path.

Example 1: Input: root = [1,2,3] Output: 6 Explanation: The path 2 -> 1 -> 3 has sum 6.

Example 2: Input: root = [-10,9,20,null,null,15,7] Output: 42 Explanation: The path 15 -> 20 -> 7 has sum 42.

Constraints: 1 <= number of nodes <= 200000 -1000 <= Node.val <= 1000

5 more coding questions

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

Sign up free to practice all 6

Related pages

More OpenAI Staff rounds

OpenAI coding at other levels

Other companies at this level

Company guide

OpenAI interview guide in Academy