Main purpose is to see how you approach the questions instinctively, the tendency of your thinking, how you deal with an unexpected situation, etc. All in all, is to try to see what you are as a person, whether or not you are able to fit in this position or the company culture.
Sometimes interviewer will mark 1, 2or 3, to determine the fitness, probably might affect the pay or offer as well.