17 Nov 2020 - MadJFish/Interview-Questions GitHub Wiki

Core

  1. Could you run the java program without main method?

Multi-threading

  1. What are the state of threads?
  2. What is executorService?

Java Collections

  1. What is the structure of HashMap?

Coding

  1. Given a number, we can only add 2 or minus 2 for each step, get the number of steps to change the number to the closest perfect square.

Java 8

  1. What are the differences between Predicate and Function?
  2. Why stream is considered as lazy initialization?

Spring

  1. Class A and Class B are implementing interface C, we want to use class A in India and use class B in Singapore, how should we configure it?
  2. How to do configuration between different servers in Spring?
  3. What are the differences between JpaRepository and CrudRepository?