Java Interview Questions Sample..
Java Interview Questions Sample..
String:
1. What are different ways to create String Object? He can create objects with diff ways and ask for the
object counts ?
2. Write a method to check if input String is Palindrome? Focus on complexity in your program?
3. How to compare two Strings in java program ?
4. Difference between String, StringBuffer and StringBuilder?
5. Why String is immutable or final in Java?
6. Why Char array is preferred over String for storing password?
7. What is String Pool?
8. What does String intern() method do?
9. Does String is thread-safe in Java?
10. Why String is popular HashMap key in Java?
11. Can you create your own immutable class?
12.
Collection: java.utill.*;
Multithreading:
1. Consumer producer problem or odd even number print by multiple thread ,practically to
understand the concept of wait and notify and notifyAll?
2. Lifecycle of Thread?
3. How many ways to create a Thread and Which one is better to create Thread ?
4. Difference between Runnable and Callable interface?
5. What is Future Object?
6. What is Executor Framework ?what is the need of Executor Framework?
7. What is Cycli Barrier, CountdownLatch, BlockingQueue, PriorityBlockingQueue ?
8. What is volatile keyword? Difference between static and volatile?
9. What is synchronization? Which one is better synchronization block or method?
10. What is Batch processing?
11. What is callable?
12. Difference between callable and runnable?
13. Return type of callable and runnable?
14. Feature object is Asynchronous or Synchronous?
Serialization :
Garbage collection:
1. What is Garbage collection, How its work internally?
2. How G1 Works?
Spring :
Rest Services:
NoSQL(Couchbase):
1. What is NoSQL
2. NoSQL vs SQL
3. What is N1QL
4. How are data stored in couchbase
5. What are the data formats accepted by couchbase
6. How to search data in couchbase
7. How to configure indexes
8. What are views
9. Is couchbase java SDK async or synchronous, explain
10. What is sub doc API
11. What type of locking is used in couchbase
12. How to avoid locking while doing concurrent updates on same document
RxJava:
Vert.x Programming:
Reactive Programming:
Multi Threading:
Java 8:
1. New features introduced in Java 8.
2. Why default method introduced in interfaces?
React:
1. What is React?
2. What are the features of React?
3. What is JSX? Why browsers can’t read JSX?
4. Diff between virtual dom and real dom?
5. Name Lifecycle methods and their purpose.
6. What do you understand from “In react everything is a component”?
7. Explain the purpose of render function?
8. Why do we use arrow function in react?
9. How to prevent components from re-rendering?
10. Differentiate between state and props?
11. Differentiate between stateful and stateless components.
12. What is difference between ES5 and ES6 standard?
13. What is an event in React?
14. What are synthetic events in React?
15. What do you understand by refs in React?
16. List some of the cases where you should use refs?
17. How forms are created in React?
18. What do you know about controlled and uncontrolled components?
19. What are higher order components?
20. What are pure components?
21. What is Redux?
22. What are the 3 principles that Redux follows?
23. What do you understand by single source of truth?
24. List down the components of Redux
25. Explain how the data flow through Redux?
26. How are actions defined in Redux?
27. Explain the role of reducers
28. What is the significance of store in Redux?
Microservices:
DB questions:
Scenario Based question: You have an Array of Integers; it could be of any size/length? You need write
an algorithm to find out the largest number possible from the numbers in array.
Ex : Let say, array has 0,1,2,3,4,5,6,7,8,9 as number. Now the algorithm which you are writing should
have 9876543210 as an output. But number in array will vary as per input.
Spring Boot
3. Does Spring Boot require an external server? if no then why? How to add server?
Spring Microservices
1. Is there any other way to expose an application as microservice other than making it as a REST
service?