Amazon Interview QuestionSDE-2s
- 0of 0 votes
A planner wants to deign a city. A city having n points of interest and marked them from 0 - (n-1). Need to write two API:
public void buildRoad(int a, int b); // build road directly between a and b.
public boolean isRoadExist(int a, int b); // Check if there is any road connectivity exist between a & b (either directly or indirectly) then return TRUE else FALSE.
The solution should be in O(log n). You can first try in O(n).
Interview Type: In-Person