BMW Group interview question

Code a search algorithm