Compute effective permissions on DAG and prune tree | Snowflake Interview Question