HyperVerge interview question

I was asked about my approach towards the coding problem