HashedIn by Deloitte Interview Question

Algorithm sql database tree