Samsung Electronics interview question

data structure