Limited Time Offer:Up to 20% off Hello Interview Premium
Up to 20% off Hello Interview Premium 🎉
Hello Interview
Your Dashboard
System Design
Code
Low Level Design
Behavioral
AI Coding
New
ML System Design
Salary Negotiation
Interview Guides
Blog
System Design
Low Level Design
AI Coding
Behavioral
New
Interview Questions
Success Stories
System Design
Low-Level Design
New
Ask The Community
Discord
Mock Interviews
1:1 Mentorship
Refer a Friend
Pricing
Sign in / Sign up
Search
⌘K
Pricing

Tutor

Multi-Source BFS with Obstacles and Variable Weights

Given a grid with trucks, obstacles, and boundary dispatch points, find the minimum time to dispatch all trucks using BFS propagation. Follow-up involves weighted propagation where each cell has different dispatch delays, requiring shortest-path algorithms instead of uniform BFS.

Asked at:

Amazon

Amazon


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Company
​
Level
All Regions
Region

Mid February, 2026

Amazon

Amazon

Mid-level

Problem (Warehouse Dispatch Readiness) You are given an m x n grid representing a warehouse yard. Each cell can contain 0 (no truck present), 1 (a truck that is ready to be dispatched), or -1 (an obstacle that blocks movement). Dispatch operations start simultaneously from all boundary cells that contain trucks (1), since those trucks can directly exit the warehouse and initiate dispatch for others. Every minute, a dispatched truck enables its adjacent trucks (up, down, left, right only) to dispatch as well, provided there is no obstacle in between. The task is to compute the minimum time required to dispatch all trucks in the grid. If some trucks can never be reached because they are blocked by obstacles, return -1. Follow-up (Variable Dispatch Time) Now assume each truck takes a different amount of time to prepare for dispatch. Instead of every propagation taking 1 minute, each cell has an associated dispatch delay, and the time to dispatch spreads based on that delay. The goal becomes finding the minimum total time required for all trucks to be dispatched considering these non-uniform times, which changes the problem from a level-by-level spread to a shortest-time propagation problem (multi-source weighted traversal).

Your account is free and you can post anonymously if you choose.

Hello Interview Premium

Recent interview questions
System Design Guided Practice
Exclusive content
Learn More
Questions
Meta SWE Interview QuestionsAmazon SWE Interview QuestionsGoogle SWE Interview QuestionsOpenAI SWE Interview QuestionsEngineering Manager (EM) Interview Questions
Learn
Learn System DesignLearn DSALearn BehavioralLearn ML System DesignLearn Low Level DesignGuided Practice
Links
FAQPricingGift PremiumHello Interview Premium
Legal
Terms and ConditionsPrivacy PolicySecurity
Contact
About UsProduct Support

7511 Greenwood Ave North Unit #4238 Seattle WA 98103


© 2026 Optick Labs Inc. All rights reserved.