Booking.com SDE Interview Question 2023 September | Advanced Shortest Path Algorithms | Off-campus

Question · Posted Jun 2026

Question 1: The City With Smallest Number of Neighbors at a Threshold Distance Problem Statement There are n cities numbered from 0 to n-1. Given the array edges where edges[i] = [from_i, to_i, weight_i] represents a bidirectional and weighted edge between cities from_i and to_i, and given the integer distanceThreshold. Return the city with the smallest number of cities that are reachable through some path and whose absolute distance is at most distanceThreshold. If there are multiple such cities, return ...

The full answer & interview discussion are available to premium members.

Log in Create a free account