Backroads interview question

try to solve some case scenario