← Pinterest Interview Insights

Pinterest·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Pinterest data science interview with a system design question that leaned way more engineering than I expected for the role. The problem was interesting but felt misaligned with what a DS actually does day to day.

Questions Asked (1)

Q1

Design and implement a permission system that supports geographic path-based access control (e.g., /France/Paris). The system needs to support adding a path and checking whether a given path is authorized.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

I went straight to a hash map and the interviewer kind of waited, like they wanted something more structured.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then propose a trie-based data structure to store hierarchical paths, with each node representing a geographic segment. Implement add_path and is_authorized methods, and discuss trade-offs between time and space complexity, as well as potential extensions like caching or distributed storage.

Pro tip: Mention that paths should be normalized (e.g., lowercase, consistent delimiters) to avoid inconsistencies, and consider edge cases like trailing slashes or empty segments. Also, highlight that authorization checks can be optimized by storing permissions at nodes and propagating them.

1. Clarify Requirements

Ask about expected scale (number of paths, query frequency), whether paths are case-sensitive, and if permissions can be inherited (e.g., /France grants access to /France/Paris).

2. Choose Data Structure

Propose a trie (prefix tree) where each node represents a path segment, allowing efficient insertion and lookup. Alternatively, consider a hash set with prefix matching, but discuss trade-offs.

3. Design Operations

Define add_path to insert a path into the trie, marking nodes as authorized. Define is_authorized to traverse the trie and check if the path or any ancestor is authorized.

4. Analyze Complexity

Discuss time complexity: O(L) for both operations where L is path length, and space complexity O(N*L) for N paths. Compare with alternatives like sorted lists or databases.

5. Discuss Extensions

Mention potential improvements: caching frequent queries, handling concurrency, distributing the trie, or using a database with materialized paths.

Key Points to Mention

  • Trie data structure for hierarchical paths
  • Path normalization (case, delimiters, trailing slashes)
  • Inheritance of permissions (ancestor authorization)
  • Time and space complexity analysis
  • Trade-offs between in-memory and persistent storage
  • Scalability considerations (sharding, caching)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.