Snowflake Hiring off campus | Find Building Where Alice and Bob Can Meet | OA 2024

Question · Posted Jun 2026

Problem Statement You are given a 0-indexed array heights of positive integers, where heights[i] represents the height of the ith building. If a person is in building i, they can move to any other building j if and only if i < j and heights[i] < heights[j]. You are also given another array queries where queries[i] = [ai, bi]. On the ith query, Alice is in building ai while Bob is in building bi. Return an array ans where ans[i] ...

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

Log in Create a free account