Tavant Interview Question

Hive query