Pinterest Coding Interview Questions
30 Pinterest coding interview problems with full optimal solutions — 2 easy, 21 medium, 7 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Pinterest interviewer values, and a FAQ section.
Showing 7 problems of 30
- #23hardfrequently asked
23. Merge k Sorted Lists
Pinterest's feed-serving merges sorted streams from N candidate sources every request. Merge k Sorted Lists asks you to merge k sorted linked lists into one sorted list — the min-heap is the canonical answer, with divide-and-conquer as a heap-free alternative.
4 free resourcesSolve → - #124hardfrequently asked
124. Binary Tree Maximum Path Sum
Binary Tree Maximum Path Sum is Pinterest's signature tree-DP problem: find the maximum sum of any path through any nodes (path need not pass through root). The interviewer wants the classic 'return one side, consider both sides' postorder pattern.
4 free resourcesSolve → - #127hardfrequently asked
127. Word Ladder
Word Ladder is Pinterest's canonical BFS-on-implicit-graph problem: given a start word, end word, and word list, find the shortest transformation sequence changing one letter at a time. The interviewer wants the wildcard-bucket BFS optimization, not naive pairwise edge construction.
4 free resourcesSolve → - #212hardcompany favorite
212. Word Search II
Word Search II is Pinterest's canonical 'trie + grid DFS' problem and a feared L5 onsite. Given a 2D board and a list of dictionary words, return every word found by walking adjacent cells without reuse. The trick is sharing the dictionary across DFS attempts.
4 free resourcesSolve → - #295hardcompany favorite
295. Find Median from Data Stream
Pinterest's metrics infrastructure tracks rolling medians for latency and engagement signals. Find Median from Data Stream asks you to support addNum and findMedian on an online stream — the two-heap pattern is the production answer.
4 free resourcesSolve → - #297hardcompany favorite
297. Serialize and Deserialize Binary Tree
Pinterest stores trees-shaped data — board hierarchies, comment threads — in caches and databases that need a string representation. Serialize and Deserialize Binary Tree asks you to convert a tree to a string and back while preserving structure. The interviewer wants either preorder DFS or BFS with null markers.
4 free resourcesSolve → - #642hardcompany favorite
642. Design Search Autocomplete System
Pinterest's search bar autocompletes pins and boards as you type; this LeetCode design problem mirrors the production setup. Build a system that, given a stream of historical queries with hot-counts, returns the top-3 ranked completions for any prefix typed so far. Trie + heap is the canonical answer.
4 free resourcesSolve →