OpenAI Machine Learning Engineer Interview Experience — ML Coding with Math Reasoning and a Rectangle Grid Undo Problem

OpenAI·Machine Learning Engineer·Oct 2026
Technical Screenhard

Research role. I literally just finished the second round, the ML coding + general coding one.

The ML question was about a point light source shooting at a plane (one-dimensional). It should be an old question.

Strangely, the recruiter told me it was ML coding, but the interviewer told me it was ML coding with math reasoning 😂, which confused me a bit. Overall, though, you don't need much math/physics background.

Part 1: write a random sampling function. Given the position of the light source, the output is the coordinates of a number of points that land on the plane.

Part 2: they gave the theoretical PDF formula, and I had to check whether the curve from my sampling function was close to this theoretical PDF.

Parts 3 and 4: given the sampled coordinates where the light particles land on the plane, work backwards to find the position of the light source (px, py).

The last part was the hard one. You need to think of maximizing the log-likelihood to do the optimization (I got there with a hint from the interviewer 🙏). Overall this was a pretty fun problem!

The general coding round was the rectangle problem, which I think is also a high-frequency one.

You maintain a 2D grid and can add rectangles to it, and each rectangle has its own ID. There are five parts, with requirements added step by step:

  1. Implement adding a rectangle, and querying how many rectangles cover a given cell.
  2. Support replace and delete. Adding a rectangle with an existing ID replaces the old one, and you can also delete by ID.
  3. Optimize the complexity: queries must be O(1), and add/delete time should be proportional to the rectangle's area.
  4. Implement undo, which reverts the most recent successful modification. A replace also has to be restorable.
  5. Given a coordinate, delete all rectangles that cover that point, and a single undo has to restore that whole batch.

I stumbled a little along the way, but with the interviewer's hints I finished everything. The coding volume of this one is not small, but as long as you have a clear idea of how to implement undo, it goes pretty smoothly.

Btw, the first round was two weeks ago. It was a poker game + noisy annotations (but not the common one with multiple annotators and majority voting that people post about here; what it actually tested was more like a data selection problem).

Published

Curated and edited by PracHub

Practice the questions from this interview

Discussion

Sign in to join the discussion. The author is notified of every comment.

Loading comments…

Interview at a glance

Company
OpenAI
Role
Machine Learning Engineer
Rounds
Technical Screen
Difficulty
hard
Interview date
Oct 2026
Questions from this interview
2 questions

Related interview experiences

Explore more interview rounds, questions, and outcomes.

Browse interview experiences