Back in the seventies, I was taking entry exams to the Kiev Politechnic Institute (KPI). I lived in Ukraine, which was a part of the Soviet Union. At that time people of the Jewish descent had really hard time in getting into most of the colleges and universities. Typically, there were four entry exams for the engineering majors: the verbal math, the written math, the verbal physics, and essay. There were no such things as multiple choice tests ndash; we had to solve problems.
Being a Jewish boy myself, I was raised knowing that getting into college will be extremely difficult for me, and I had to be much better prepared than regular Ukrainian and Russian kids. I was strong in math (can’t say this about the Physics though).
Anyway, during the first written test at KPI, there was a problem with the purposely wrong description. Each of the four hundred people that were taking this test had to solve it. I caught the trick in that problem, and my written math grade was 4 out of 5. Two hundred and twenty people got 2 out of 5, which meant that they wouldn’t even accepted to the second exam.
At the verbal math exam, each applicant had to randomly pick a sheet (a.k.a. ticket) with different written problems. Everybody was sitting in a large auditorium preparing their answers followed by the face-to-face conversation with a professor. He or she was reviewing your solutions and could ask additional questions.
I glanced at my sheet – all problems were easy for me. I quickly wrote the answers, then helped to a girl sitting next to me (this was her 5th attempt to get admitted) and wrote all the answers to the guy in the military costume – guys who server in the army had a preferential treatment (you may be surprised, but helping other people during the tests was considered a noble thing to do in the USSR). Each of them had a face-to-face before me and each of them got a quick 4 without any additional questions. I said to myself, that if they got 4, I could expect getting 6 out of 5.
Then was my turn. All answers for the ticket problems were correct, and then the professor started to ask me additional questions. After answering 11 (!) questions correctly, he asked me the next one from trigonometry, “What’s the difference between the graphs of functions arcsine and arccosine”. Piece of cake. I started answering “The function arcsine looks the same as arccosine, …” He didn’t let me finish or draw the graphs. “Stop. So you think that arsine and arccosine look the same? Your grade is 2 (failed). ” This meant the end of my exams. No i understand, that I should have selected each word more carefully, but getting 2 after seeing how people who know nothing are fetting 4?
I was speechless for a moment… He didn’t let me finish the sentence! I started mumbling that I was awarded a second place in the math Olympiad of the central borough of Kiev. Then I pooled out the award certificate… He just said, “Apparently your math was better back then, but now you have a serious gap in trigonometry ”
Two months later I went to Novocherkassk, Russia, which was a town 600 miles away from home, got two easy fives on both math tests, 4 on essay and 3 on physics, and got admitted to the Applied Math major.
Several years ago, I was browsing books on Amazon and found a pretty interesting one – “You Failed Your Math Test, Comrade Einstein “. The authors compiled many tough math problems that were prepared specifically for the Jewish students applying to the Soviet “ivy league ” universities. I bought this book to show my respect to the authors for their work. People who live in Ukraine now, tell me that this practice is gone, and everyone has equal opportunities on entrance exams…I wish all the best to the people of Ukraine.
So what does all this have with Java and job interviews here in the USA? These days I often interview people who apply for jobs. A face to face interview is similar to that entrance verbal exam. The only difference is that in the USA people are graded based on their skills rather than ethnicity.
But let’s imagine for a moment that you are conducting a technical interview on Java programming and need to have a special question to ensure that the person you don’t like won’t pass. I ‘m going to arm you with one.
After years of interviewing enterprise Java developers of different levels, I can attest that 90% of them don’t bother learning new features of the language and just get by using whatever they learned some time in their past. For example, nine out of ten people still believe that there are only two way of creating a Java thread ndash; subclass a Thread or implement Runnable. You also thought so? I know. The “new way rdquo; was introduced to Java only six years ago. You want to learn another way? Get my recent book “Java Programming. 24-hour Trainer. ”
Here’s the killer question that 95% of the Java programmers won’t answer correctly. “Give all examples of usage of the keyword final”.
The candidate sits quietly for 30 seconds just to show that he ‘s thinking about the best way of answering this easy question, then he writes the following on a piece of paper:
– If a method declared final, this method can’t be overridden.
static final double convertToCelsius(double far){
return ((far – 32) * 5 / 9);
}
– If a class is declared final, you can “t be subclass (extend) it
final class Tax { …};
– The value for the final variable can be assigned only once
static final int BOILING_TEMP = 212; // in Fahrenheit
Say politely, “Great, this is correct. Are these all uses of the keyword final that you can recollect? ” As I said earlier, the chances that the candidate knows the fourth use are about 5%. He goes, “Java has no any other use of the final keyword, I ‘m positive.” At this point you thank him for giving you great answers and say that an HR person will be in touch shortly. This is one of the major differences between the USA and USSR. We don’t say give the final answers while the candidate is still here. The phrase “Your answer is wrong ” or “You have a serious gap in trigonometry” could lead to unpredictable reaction of the candidate. We don’t want any conflicts. Let him leave in peace.
The mission is accomplished – he failed the job interview!
Recently released Java 7 has a new feature called final rethrow. In my opinion, it’s a pretty useless feature you can live without. Besides, it makes the code more difficult to read. Now, it’s legal to write something like this:
private void throwExceptions() throws A, B, C {
try {
throwAccordingToIndex(new Random().nextInt(2));
} catch (final Exception e){
System.out.printf( “Caught %s and rethrowing…%n “, e);
throw e;
}
}
To make things even more confusing, writing the keyword final here is not mandatory. But hey, the candidate didn’t know about this use, which means that his skills on Java are not current. And our team of sharp developers don’t need people with rusty skills. For the next several years this question will help you eliminating the candidates you don’t want to have beer with. No one will use this feature, and Java practitioners won’t have a chance to see it in anyone’s code.
Do you like my strategy? Neither do I. I’ll remember that episode with arcsine till I die, and will never apply such techniques while interviewing candidates. So why did I write this blog? To be honest with you, I don’t know. For some reason, when I learned about this feature, I couldn’t find any other use for it other than a secret weapon for the dirty interviewers.
Update. After re-reading this blog, I realized that it didn’t cover an important use case: what if the job applicant knows about this fourth use of the final? Ask what he thinks about this new feature. If he has any opinion about this feature, hire him. He follows the latest developments in the Java language and cares to form an opinion.