STMicroelectronics interview question

Why function switch runs fast then if then?