Pinterest Machine Learning Engineer Interview Experience — Graph Connectivity Coding Plus Vanishing Gradient Questions

Pinterest·Machine Learning Engineer·Nov 2026
Technical Screenmedium

I'm sharing one round of my Pinterest MLE interview. It was mainly split into two parts, Coding and ML Fundamentals.

Coding — Graph Connectivity

You are given a dictionary where the key is a group ID and the value is the elements in that group. An element can appear in multiple groups.

If two elements belong to the same group, they are considered directly related. If two elements can be connected indirectly through other elements, they are also considered related.

Define the distance between two elements:

  • Distance = 1: the two elements belong to the same group.
  • Distance = 2: the two elements do not belong to the same group, but there is an intermediate element that is directly related to each of them.
  • Distance = N: it takes N steps to establish a connection.
  • Distance = 0: there is no connection between the two elements.

Part 1: Design a class that takes the group mapping as input and implements a function to determine whether two given elements are connected.

It mainly tests Graph Construction, BFS/DFS, Connected Components, and Time & Space Complexity.

ML Fundamentals

It mainly covered:

  • Time & Space Complexity
  • Vanishing Gradient: what causes it, how it affects model training, and common ways to fix it.

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
Pinterest
Role
Machine Learning Engineer
Rounds
Technical Screen
Difficulty
medium
Interview date
Nov 2026
Questions from this interview
2 questions

Related interview experiences

Explore more interview rounds, questions, and outcomes.

Browse interview experiences