We.Vision interview question

I was asked to write a code to solve a data structure problem