Snowflake Interview Question

It was a graph question with medium difficulty.