Then there are tests on logical ability and analytical thinking also.
In an interview, the questions asked may be in written format or the verbal one.
When your approach to a problem is positive then you are sure to find a way out of it. And for candidates, good communication skill is what counts. The interviewers need to know about your confidence levels while implementing solutions to the problems.
If you think that the problem is complicated and impossible to solve, then no matter how much you try, your negative attitude will not give you the desired result. So does the candidate break the problem into parts and analyze it step by step? The analytical problem solving skills are important and interviewers target the candidate with such questions which brings his analytical solving skills to the fore. After problem analysis, now comes the implementation part. Suppose a plan did not work as expected, are you the one who lets bygones be bygones?
The type of questions asked will depend on the job he is seeking.
So interviewers need to know how a candidate approaches a problem. Or do you not rest until you get to the core of the problem to see what the mistake was? But to know where the mistake has occurred and learning from it helps you move ahead.
Only if the candidate shows signs that he is approaching the problem with a positive attitude, then the interviewers get the impression that he will be able to solve the problem no matter what. So as a potential candidate it is essential that you demonstrate to the interviewers that you are not disappointed by failures and that you learn from it.
If it is for a technical job, say for the post of a software engineer then technical questions about algorithm fundamentals and math will be asked including the coding skills.
In addition to technical grilling, candidates will have to prove their behavioral ability also.