Pinterest·Machine Learning Engineer·Technical Phone Screen
May 2026
Pinterest ML engineer interview, technical phone screen that was basically a pure DSA session. Two parts to one problem, both on trees and linked lists. Nothing ML-specific came up at all, which surprised me.
- Given a binary search tree, convert it in-place to a sorted circular doubly linked list where the left pointer acts as predecessor and the right pointer as successor. The smallest element's predecessor should wrap around to the largest. Solve in O(n) time with O(h) extra space.
- Follow-up: given the sorted circular doubly linked list from the previous problem, write a function to insert a new value while keeping the list sorted. Your solution must correctly handle an empty list, inserting before the smallest element, inserting after the largest element, and duplicate values.
“The in-place constraint is where it gets annoying.” The rest of the author's notes on Machine Learning Engineer interview at Pinterest, Technical Phone Screen round, covers how they worked through the question, what the panel pushed back on, and what they would do differently.
View Post