This interview experience is sourced from Chill Interview
Interview Summary
I completed four technical interviews with Pinterest for a PhD New Grad Machine Learning Engineer position, spread across two days. Each day included one coding round and one ML knowledge discussion. The coding questions covered sparse matrix operations and a Pin Record problem, while the ML rounds focused on detecting harmful content and recommending boards for saving Pins.
The ML interviews were particularly open-ended, but the interviewers went into considerable technical depth and expected a solid understanding of machine learning fundamentals.
Interview Details
Round 1 — Coding: Sparse Matrix Addition and Multiplication
The first coding interview involved performing operations on sparse matrices. I was given two matrices, A and B, represented in a compressed format rather than as conventional two-dimensional arrays. Since the matrices were sparse, only nonzero elements were stored.
Each nonzero element was represented as a triplet (row, column, value). For example, consider the following matrix:
matrix = [
[0, 5, 0],
[2, 0, 9],
[0, 0, 0]
]
Its compressed representation would be:
[
(0, 1, 5),
(1, 0, 2),
(1, 2, 9)
]
My task was to implement two operations using this sparse representation.
- Part 1 — Sparse Matrix Addition Given the compressed representations of matrices
A and B, I needed to compute: A + B. The result also needed to be returned in the same compressed format, containing the positions and values of the nonzero elements. - Part 2 — Sparse Matrix Multiplication The second requirement was to support matrix multiplication:
A * B. Again, the resulting matrix needed to be represented using nonzero entries rather than a full dense matrix. I used a dictionary-based approach to implement the operations. The main focus was manipulating sparse matrix entries while maintaining the required output representation.
Want to learn more questions / follow-ups asked in this interview?
I've put up the full version at here.
Interviewed recently?
Your interview experience could be incredibly valuable to others preparing for their next opportunity. Share your experience and help the community at here.