HashedIn by Deloitte interview question

coding the given data structure