In college I asked this all the time, specially when there were a small set of choices. I read the book Computer Systems: A Programmer’s Perspective and it explains with examples what compiler does when facing either a switch or if-else statement.