BMW Group interview question

regarding ad alogirthm. data structure