PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Pinterest

Find minimum shuttle transfers

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's ability to model connectivity and minimize transfers in networked systems, testing graph-based reasoning, algorithm design, data-structure selection, and complexity analysis within the Coding & Algorithms domain.

  • Medium
  • Pinterest
  • Coding & Algorithms
  • Software Engineer

Find minimum shuttle transfers

Company: Pinterest

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

You are given a collection of shuttle loops, each represented by a list of stop IDs that the loop visits in perpetuity. You may board a shuttle at any stop it serves and remain on it until any later stop on the same loop. Transferring from one shuttle loop to another counts as boarding a new shuttle. Given a source stop s and a target stop t, determine the minimum number of shuttles you must board to travel from s to t; return -1 if it is impossible. Describe the data structures you would use, outline the algorithm step by step, and analyze time and space complexity for inputs with up to 100,000 total stops across all loops. Discuss edge cases such as s == t, isolated loops, and multiple loops sharing the same stop. Follow-ups: how would you output an actual sequence of shuttles taken; how would you handle weighted transfer penalties or restricted operating hours; how can you reduce memory and avoid building an explicit route-to-route graph when the number of loops is very large?

Quick Answer: This question evaluates a candidate's ability to model connectivity and minimize transfers in networked systems, testing graph-based reasoning, algorithm design, data-structure selection, and complexity analysis within the Coding & Algorithms domain.

Related Interview Questions

  • Hierarchical Access Control for an Advertising Platform - Pinterest (medium)
  • First Word Matching Each Prefix Query - Pinterest (medium)
  • Maximize Boxes Stored Through One Entrance - Pinterest (medium)
  • Solve Multiple Coding Interview Problems - Pinterest (medium)
  • Implement a Sparse Matrix Class - Pinterest (medium)
Pinterest logo
Pinterest
Jul 26, 2025, 12:00 AM
Software Engineer
Take-home Project
Coding & Algorithms
8
0

You are given a collection of shuttle loops, each represented by a list of stop IDs that the loop visits in perpetuity. You may board a shuttle at any stop it serves and remain on it until any later stop on the same loop. Transferring from one shuttle loop to another counts as boarding a new shuttle. Given a source stop s and a target stop t, determine the minimum number of shuttles you must board to travel from s to t; return -1 if it is impossible. Describe the data structures you would use, outline the algorithm step by step, and analyze time and space complexity for inputs with up to 100,000 total stops across all loops. Discuss edge cases such as s == t, isolated loops, and multiple loops sharing the same stop. Follow-ups: how would you output an actual sequence of shuttles taken; how would you handle weighted transfer penalties or restricted operating hours; how can you reduce memory and avoid building an explicit route-to-route graph when the number of loops is very large?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Pinterest•More Software Engineer•Pinterest Software Engineer•Pinterest Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.