Java Whiteboard Coding Strategy (use of Generics)

#1

When I am coding in my comfort zone using my favorite IDE, I prefer writing generic Java code. Arguably, this makes coding a little more cumbersome. For instance, instead of using relational operators directly, one must use them via the compareTo method. This perhaps takes more time to actually code a solution and may confuse us while doing the whiteboard session. Practice may help, but still, it appears that leaving generics alone when the solution does not warrant their use is a better strategy (than to use them). But in a competitive environment, some interviewers may hold the non-generic implementation against a candidate (e.g. they may think that “the candidate does not appear to have strong Java coding skills”).

Do the authors of EPI have any advice about how to handle this so as to minimize its impact on one’s overall assessment?

Thanks!

0 Likes

#2

Hey @Curious.George,

Thanks for this great question, and I think it is very worthy to discuss that.

In my opinion, competitive environment and practice are definitely different. To address this, following are some my tips for this situation:

  • Practice white board coding to improve your writing and speed. Moreover, @adnanaziz have an idea to bring your own markers, which is pretty cool since you get used to those markers very well.
  • Write variables names in a shorter form and explain that verbally to explicitly notify interviewer the meaning of this variable.
  • Discuss with interviewers about your preference on this. Since interviewers are the ultimate judges here, it would be good to discuss with them which side they prefer. Also, discussing with them about this would show you “have strong Java coding skills”.

Let us know if you have any other questions.

0 Likes