Genesys interview question

data structures, time complexity