Quick Overview

Traverse a directed graph of boards in deterministic breadth-first order and collect each reachable pin only on its first appearance. Handle cycles and shared children with separate visited-board and emitted-pin sets after validating every record and reference.

Collect Pins from Reachable Boards

Company: Pinterest

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Online Assessment

Overview: Traverse a directed graph of boards in deterministic breadth-first order and collect each reachable pin only on its first appearance. Handle cycles and shared children with separate visited-board and emitted-pin sets after validating every record and reference.

Loading…