Valeo interview question

mostly on c++ coding and mathematical logics