If you see the types of questions that CS or SE graduates might encounter in interviews, you will notice that often many of them are some sort of brain teasers.
These are coming more or less in two types:
Those that require some exact answer and require a very basic skill, like understanding of probability or common sense.
and
Those that cannot really be solved exactly and their goal is to simply see how you deal with a very hard problem that you most certainly have no preconceived idea as to how it should be approached.
Let’s see some examples to make the above situations as clear as possible.
A Russian gangster kidnaps you. He puts two bullets in consecutive order in an empty six-round revolver, spins it, points it at your head and shoots. *click* You’re still alive. He then asks you, “do you want me to spin it again and fire or pull the trigger again right away?” For each option, what is the probability that you’ll be shot?