Java Platform, Enterprise Edition

Java EE Journal

Subscribe to Java EE Journal: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get Java EE Journal: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


J2EE Journal Authors: Sumith Kumar Puri, Javier Paniza, Yakov Fain, Ken Fogel, Carmen Gonzalez

Related Topics: Java EE Journal, Java Developer Magazine

Blog Feed Post

Java, Soviet Union, and Job Interviews

Back in the seventies, I’d been taking entry exams to the Kiev Politechnic Institute (KPI)

Back in the seventies, I’d been taking entry exams to the Kiev Politechnic Institute (KPI).  I lived in the Ukraine, which was a part of the Soviet Union. At that time people of Jewish descent had a really hard time 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 – we had to solve problems.

Being a Jewish boy myself, I was raised knowing that getting into college would 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 the400 people who 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 be 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 the problems were easy for me. I quickly wrote the answers, than helped a girl sitting next to me (this was her fifth attempt to get admitted) and wrote all the answers for the guy in the military costume - guys who served 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 5 out of 6

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.” This meant the end of my exams.

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 the Ukraine.

What does all this have to do with Java and job interviews here in the US?  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 US 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 ways of creating a Java thread – subclass a Thread or implement Runnable. You also thought so? I know. The “new way” 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 the 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 US 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 from 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 that 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 eliminate 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.  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 piece, I realized that it didn't cover an important use case: what if the job applicant knows about this fours 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.

More Stories By Yakov Fain

Yakov Fain is a Java Champion and a co-founder of the IT consultancy Farata Systems and the product company SuranceBay. He wrote a thousand blogs (http://yakovfain.com) and several books about software development. Yakov authored and co-authored such books as "Angular 2 Development with TypeScript", "Java 24-Hour Trainer", and "Enterprise Web Development". His Twitter tag is @yfain