How to Hire Java Developers
In 2020, Java celebrated its 25th birthday with more than 12 million developers using it worldwide. There are over 38 billion active Java Virtual Machines (JVMs) and more than 21 billion cloud-connected JVMs. Some of those JVMs are supporting the infrastructure and architecture for companies like Twitter, Uber, Netflix, Spotify, CERN, Siemens, and many more.
It’s safe to say that Java has been a big player in the industry for a long time and isn’t going anywhere anytime soon. For companies that want reliability and performance, Java is definitely the language of choice and the demand for Java developers is now greater than ever. This guide will dive into the process of hiring professional Java developers with a focus on the challenges faced by both sides of the interview table. We will take a look at both the technical and non-technical skills which are required in order to build a successful team.
Table Of Contents
Non-Technical Skills to Look For in Java Developers
Before diving into all the technical stuff a Java developer needs to know, you are going to hire a new team member above all else, so the non-technical skills are just as important as the technical ones.
Big Picture Focus
Some programmers like to start coding the task at hand without understanding anything more than that. This approach can sometimes work, but it’s very dangerous in the long term because this type of code is difficult to maintain and it is usually not optimized. When the codebase grows and the fixes are “quick”, the project can soon become a behemoth and the new developers can get too afraid to touch it.
What you should look for instead are programmers that prefer to understand the project before dropping a single line of code. They should know how the task at hand fits in the bigger picture, and how it lines up with the business objectives.
Soft Skills
Ask the candidate about the latest hard feature that they had to implement, something that they struggled with, because those features are really easy to remember. You may not remember a task that you’ve implemented smoothly in a couple of hours, but you will definitely remember spending three days debugging an issue only to find out that a word was missing from a config file somewhere.
When the candidate starts describing the feature, ask questions like:
- “How did you implement it?”
- “What did you use?”
- “How does that work?”
- “How is your feature connected to other features?”
This type of questions will give insight into other important areas like communication skills, initiative and problem-solving skills. It also shows curiosity and the ability to learn and adapt.
Agile Methodologies
Ask the candidates about their working methodologies and their estimation skills. You need to find a developer that’s always looking to learn new things, but not that curious that they have written a new framework while working on a feature just because they wanted to find out if their wild idea was even possible.
To learn a bit about the ability to estimate stories, start by asking about the methodology that is used.
- “Is it agile?”
- “Are there sprints?”
- “Are there estimations?”
- ”Do you remember the estimation for this story?”
- “How long did it actually take?”
These questions will also reveal their attitude towards agile methodologies. For example, there might be a candidate who actively hates SAFe because of the long ceremonies. If your project is implemented with SAFe, you might not want a team member that hates it and rallies against it. This type of behavior will quickly change the mood in the team and the attitude in the meetings. You might find out that other team members will hate attending the meetings and become less and less involved.
Technical Skills to Look For in a Java Developer
Now that we’ve covered the non-technical part of the interview, let’s dive into the technical skills that you need to look for in a Java developer.
Java Fundamentals
It’s ironically common to find developers with impressive certifications and resumes that somehow lack knowledge of the language fundamentals. To check this, start with a rather simple question from the Java basics, such as: “What does the final keyword do?” This question works as an icebreaker for the technical assessment, but it can be a major red flag if a supposedly senior developer fails to answer.
Check our technical assessment questions below for more examples.
Understanding of Concepts
While your candidate answers the basic questions, look for their level of understanding of the concepts. If they don’t provide a long enough answer, follow up with questions like, “ok, but when would you use this?” If they answer something like “in an immutable class” or “to write a Singleton”, dig deeper, and ask the candidate to create an immutable class or a singleton, or write a dummy class and ask the candidate to “fill in the blanks” in order to achieve a certain task.
By watching the candidate write some code you’ll know if they are aware of the edge cases. Maybe even push further and set some traps, like modifying the value of a field in an immutable class by calling the getter.
Data Types and Data Structures
The next thing to pay really close attention to is their handling of data types and data structures.
Ask: “What is the latest data structure that you’ve used?” and their answer is usually “Array” or “ArrayList”.
Follow up questions: “Ok, what is an ArrayList?” “Is it indexed?”, etc.
Then generalize by asking what interface does it implement, and what are the other implementations? This leads to questions like, “what are the differences between a linked list and array list?” and “how is a HashMap implemented in Java?”
Assess Their Knowledge of the Newest Features
New Java versions arrive in two types of releases:
- Feature releases, supported by Oracle until the next release, usually 6 months
- Long term support releases, that is, more stable versions that are usually supported for at least 5 years.
Your developers should keep up to date with the new releases, but also have the insight to know when and why to upgrade to the newer versions and how to deal with the migration process.
Check their knowledge of Exceptions, Generics, Serialization, Garbage collection and Multithreading and other modern Java features. Increase the difficulty if they are able to answer, but avoid going deeper if the topic is well understood.
Tooling and Workflow
Another aspect to check is their knowledge of additional tools such as Unix, Databases, Git and CI/CD. Don’t spend a lot of time asking about these. Usually, you can find out pretty quickly if the candidate is proficient with all of the above. However, look for honesty here. If they say that they are comfortable in Git but they don’t know what a rebase does, there’s a red flag.
Frameworks
Even though frameworks are fairly easy to learn, you still want your senior developer to know about things like dependency injection, model view controllers, security, and so on.
Avoid framework-specific questions if possible and focus on the concepts instead. For instance, dependency injection can be achieved with either Spring or Weld, and the mechanism is similar. So if your candidate knows Weld, don’t assess them for Spring. Or, maybe the candidate is not a full stack developer and they did integration instead of web. For a senior developer, basic web knowledge is required at the very least.
Code Test
Last but not least, ask the candidate to write a method on a piece of paper. The method can solve a problem like finding the duplicates in an array or counting how many times a number appears in a list. Something not too difficult but not too simple either. Look for smart ways in which the candidate can solve it. Follow up with questions and if the candidate is not able to answer them, it will still provide valuable insight into their thinking process.
Technical Interview Questions for Java Developers
Question: What does the “final” keyword mean in Java and where can it be used?
Answer: Classes marked as “final” cannot be extended, methods marked as final cannot be overridden, variables marked as final cannot be reassigned. If we have a final reference variable we cannot reassign it but we can change the properties inside the object. Final fields are constants or write-once fields and any field must be initialized before the constructor is executed. Final can also be used on a method argument which cannot be changed inside a method.
Question: What is an “immutable” object in Java and how can you create an immutable class?
Answer: An object is immutable if it’s internal state remains constant after it has been entirely initialized. To create an immutable class you need to:
- Make sure the class is final so it cannot be extended.
- Make all the fields private so they cannot be accessed directly.
- Don’t provide any setter methods.
- Make all the mutable fields final so that the values cannot be reassigned.
- Initialize all the fields in the constructor by creating a deep copy of each.
- Clone the objects returned in the getter methods in order to avoid modifying the actual object reference.
Question: Would you plug in a piece of code that is executed when the JVM is shutting down?
Answer: Runtime.getRuntime().addShutdownHook(Thread)
Question: Which framework was introduced in Java 7 to help speed up parallel processing by attempting to use all the available processor cores through a divide and conquer approach?
Answer: The fork/join framework, which is managed by an implementation of the ExecutorService called ForkJoinPool.
Question: How can you write an immutable class that only holds data using the new features of Java 14?
Answer: Records are immutable data classes that require only the type and name of fields. The Java compiler generates a public constructor, private final fields and the equals, hashCode and toString methods. Example: public record Employee (String name, String address) {}
Final Thoughts
Java is still one of the most in-demand and used programming languages in modern technology, and allows developers to do almost anything required in the world of computing. The fact that it is secured, stable and dependable makes Java developers an incredibly valuable resource for building business applications.
The downside would be the fierce competition in the market. Since the pandemic has started, remote jobs have become more and more popular, which means that now, you are not only competing with the companies in your area but with all the companies that allow remote working.
In order to hire the best developers available you would need to have a couple of things that differentiate you, and you will probably hear developers complaining about the “old” technology stack. Don’t let this trick you into hiring only the developers that have worked with the latest technologies. When a developer understands the fundamentals and is able to explain complex concepts in a simple language, the interviewer might overlook that the candidate lacks experience with the latest frameworks.
Good communication and a strong desire to learn and progress can be more valuable than experience in working with the latest stack.