DEV Community

loading...

Cracking the java interview

Sriram.Mahadevan
A full stack developer looking to learn.
・2 min read

Hey there!

I sometimes do technical interview for java. So I thought I would publish some of the questions I shoot, and the qualities I look for in an answer.

Easy interview

If my ask is to go easy on the interviewee for a not much demanding role below are the few questions I ask.

What I look for in the answer is the clarity of thought and if they really understand the topic. I also look for a good attitude and keenness for learning.

OOPS concept

  1. What is inheritance and write a sample code
  2. Why multiple inheritance is not possible in java
  3. What is polymorphism and write a sample code (both overloading & overriding)

Core java

  1. How a String is stored, immutability, intern etc
  2. Autoboxing & unboxing
  3. What is serialization

Collections

  1. Create a list with some duplicates. Then remove the duplicates
  2. In what scenarios they would use arraylist & linkedlist implementation
  3. Give a scenario to write a stream

Basic SQL

  1. I will ask them to write a basic sql query where they have to join two tables and maybe get a max value of a column

General Questions

  1. If you encounter a problem with a web application (ex system unavailable error) how do you go about debugging.
  2. Tell me anything that challenged you technically and how you overcame it

Difficult interview

If I am asked to interview for a more challenging role This is how I go about it

Here I look for is their strength in each topic and how they approach to each problem even if they don't know the exact answer.

FizzBuzz

  1. Write a program to print n number in Fibonacci series (If they implement DP , I would be really impressed)

Programming questions

  1. Write a program to print sqrt of a number without using Math package (This is a question I recently asked but I would change whenever I come across some interesting problems)

System Design questions

  1. I will give a scenario with a bottleneck and ask them to go about the solution. For eg. design a asynchronous system in java

Performance related questions

  1. How do they find place where a system is slow and how do they go about resolving it.
  2. If they have knowledge on database, I ask how they go about sql tuning or what they consider while writing a new query

Along with this I ask them some core java questions on threads, equals & hash methods overriding, springboot etc

How do you feel about these questions. Let me know some of the interesting questions you have (been) asked.

Happy Friday!

Discussion (0)