- Why is the Java platform independent?
- Differences between list and set?
- How does the hash set work?
- What are the OOPS concepts?
- What are the types of polymorphism?
- What are the rules for Overloading?
- What are the rules for Overriding?
- What is serialization? Why is it needed?
- What all objects are not serializable?
- Write the code to print a list of strings that starts with A using lambda.
- We have 3 classes in hierarchical order c extends B extends A, B is serializable.
- What all objects are serializable
- Which all constructors will be called on deserialization?
- Write code to reverse a String?
- Code to create a Linked List?
- Casting in Java?
- Write code for upcasting and down casting?
- What are the operations that HashMap internally does on calling get(key)?
- What is equals and hash code?
- What happens if we override hash code to return only 1 value?
- Write code to create an immutable class?
- What are collections?
- Shown different scenarios regarding overriding and overloading, where we need to identify the working scenarios as well as error and the reason?
- How can we exclude serialization of particular fields?
- If we want to pass a Student Object into HashMap then what attribute we have to consider, write the code?
- How do you write a student array list?
- What is the difference between HashMap and tree map?
- HashMap maintain any order?
- How many years of java8 experience?
- Print 1000 student java 8 style?
- Purpose of foreach method?
- What is a bucket?
- Write your own bucket implementation?
- In respect of HashMap how bucket work?
- Do you know about LinkedList Data Structure? Write the code for link list data structure implementation?
- What is your favorite topic in java API?
- Write your own map.entry implementation in java?
- Write a program to find the second max element using a single for Loop. Don’t use built-in methods?
- HashMap internal implementation and then few questions about the node, index, same key related to internal implementation?
- How will you access the elements of HashMap?
- Oops concept. Describe each one with examples?
- When to use Interface and Abstract class?
- Difference between interface and abstract class?
- Whether abstract classes can have constructors?
- Why is the complexity of HashMap?
- Which collection would you prefer if you have a lot of insertions and deletions?
- Given a one-dimensional integer array A of size N and an integer Count all distinct pairs with difference equal to here a pair is defined as an integer pair (x, y), where x and y are both numbers in the array and their absolute difference is B?
- Explain to me about the oops concept and advantages of each?
- Explain in detail about method overloading and overriding?
- Object instantiation of an abstract class. What happens when super is called?
- Java is pass by ref/pass by value?
- What is Functional Interface?
- Remove duplicate elements from a sorted array?
- What is the time complexity of Array List and LinkedList and why explain? For both search and insert/delete?
- How would you iterate Hash set?
- Count the number of words in a given sentence from a file?
- What is Java Multithreading?
- Explain Java 8 Streams?
- Java Programs “aabbatcdefea” -> t, find the first non-repeated char using streams?
- What are the wrapper classes in java and when will you use them?
- What are the patterns in java?
- When do you use factory pattern?
- How will you make a hibernate database connection?
- Write the JPA entity class for the employee table?
- Tell the internal hibernate steps when u fetch the any entry?
- Write the full controller class for fetching employee by id?
- How will you fetch the highest salary employee from Array List?
- Write a query to fetch employee count by dept?
- How to achieve polymorphism in java?
- What is the difference between runtime and compile time polymorphism?
- How to achieve multi-inheritance in java?
- What is a functional interface and give some examples?
- What is functional programming?
- What is the difference between stream and parallel stream?
- What are the rules for using parallel stream?
- How is Set working?
- Fail Fast and Fail-Safe Iterators in Java?
- How does HashMap work internally?
- How to achieve pagination in JPA?
- How many types of mapping in hibernate?
- How to achieve bi directional mapping by many to many?
- What is an API gateway?
- How to implement JWT token and we are managing the session?
- Difference between observables and promises in Angular framework?
- Life Cycle of thread and how thread executor framework is working?
- Difference between monolithic and microservices application?
- What is a Eureka server?
- How to achieve transaction management in spring boot applications?
- What is the isolation level in transaction management?
- What is finch client and Rest template?
- What is a service registry in microservice?
- What is difference between function and bi functional interface in java 8
- What is the access modifier can be used for class and where we can access?
- How to create the object static inner class? (Write the code)
- What is the access modifier can be used for inner class? (Write the code)
- How many ways can we access static methods? (Write the code)
- Which are the classes and methods in SOP and how its working explains?
- Why did we use the static keyboard in the main method?
- How the JRE identify the main method and how its working?
- What is HashMap and why do we use it?
- How HashMap work internally? (Explain with code)
- How can we use Employee class as key in Map?
- Same object have an equal hash code?
- If hash code two objects are same then Hash code could be same?
- If we override the Hash code in class and returning always 1 for all object and the object is used as key in Map (Write the code and explain it)?
- If we override the Hash code and returning always 1 and also override the equals method and that returning always true for all object and the object is used as key in Map (Write the code and explain it)?
- If overriding Hash code and equal method, then what are the criteria required for that, if we used Class as key in HashMap?
- Internal implementation of array list?
- Internal Implementation of LinkedList?
- Explain what has been implemented?
- Time complexity of a few scenarios like if accessed one element in an array etc?
- Find output? One program is given with multiple recursions? Maybe a sorting algorithm?
- Given a number from 1 to 100? Find the missing number from this sequence?
- Difference between stack and Queue?
- Can we implement stack as Queue?
- What is an Immutable class? How to create an Immutable class? (Scenario: we have one immutable class A inside the class we defined a mutable class object B. So, will class A be fully immutable or not? If not then how to make it fully immutable?)
Class immutabl a{
Public mutableclassb Obj; } - What is Serialization? How to Serialize an object? (Scenario: we have one Serializable class A inside the class we defined a non-serializable class object B. So, will class A be fully Serializable or not? If not then who can make it fully Serializable?)
Class serializablea extends Serializable {
Public nonserializableb Obj;
} - What will be the output?
String s1 = “Test”; String s2 = new String(“Test”);
SOP(s1. equals(s2)); SOP(s1 == s2 ); - Explain the difference?
- What is Generic in java
- Difference between JVM and JRE
- Difference between JRE and JDK
- What is difference between classnotfound and classdefnotfound Exception
- Write a code to fetch Accholder details by account id (consider exception handling, numeric account number validations)
- Write a program to count spaces in string.
- How to delete duplicate records from the table
- List of employee objects and want to sort employees in a list based on salary. How you can do it.
- Why class is public and can we make it as private, if we make it as private then which error may occur?
- Explain in detail about the main method?
- Explain about System.out.println()?
- What will happen internally while compiling and running the code?
- Internal difference between compilation and running program and what will be the output of both?
- What is the HashMap and what is internal implementation?
- What is the method used on HashMap internal implementation and why?
- Is equals methods in hashmap check for all keys, if yes or no then why?
- Time complexity between Linked HashMap and HashMap?
- Define time complexity of O(n) and O (1)?
- Write custom Collection Classes?
- Flow of Exception handling?
- Diamond concept of Opps?
- Concurrency, Multithreading concept?
- Array List and LinkedList Difference?
- Why insert and delete performance is better in LinkedList than array list?
- How can we configure the hash table, so that the read operation is not locked?
- Access modifier in java?
- How can we handle duplicates in Set Interface?
- Internal architecture of HashMap?
- Inner class concept?
- How many ways do we call static inner class in java?
- Threads in Java?
- Executor framework in java?
- Generic class naming convention?
- Why is Generic used in java?
- Concurrent HashMap in detail?
- How is multithreading implemented in your project?
- Lambda functional interface implementation to get unique records for an entity member?
- What are the limitations to make String as immutable and why is it needed in Java?
- What Is bean, what is the scope of bean?
- Write the code implementation with Serialization?
- Explain the Lambda Expression with Example?
- Explain Optional Class?
- Explain the datetime Of Java 8?
- How does deadlock arise in JAVA?
- What is Immutable?
- How will you make it immutable?
- Should we always map key immutable objects or can we give mutable objects?
- What are existing Immutable Classes in Java?
- Singleton?
- Cloning of Singleton problem?
- Enum Singleton or not?
- How to overcome Cloning, Serializable, Reflection in Singleton?
- How to do lazy initialization and what happens if multiple threads try to get an instance?
- How to serialize?
- How to prevent a member variable from serialization?
- Entity has Child and Child is not serializable? How to Save Entity and its children?
- How to share variables across Threads? (Expecting the purpose of Volatile)?
- How to make “action name value” only for the current thread? (thread local)?
- What will happen if a synchronized static method is called by thread in multithreading programming?
- Finally Block- Purpose?
- String buffer/Builder and Reader What is the use case?
- Polymorphism and inheritance difference between them and implementation?
- Array List, Linked List and HashMap explanation with implementation?
- Thread its implementation?
- Method overloading and Method overriding explanation with implementation?
- Exception handling?
- What is thread safe and deadlock?
- Write code for Deadlock?
- Using recursion, write a code to get a star pattern?
*
**
***
**** - Different instances of the application will have different objects so how to maintain a count?
- Anonymous inner classes vs lambda expression (What is the use of lambda expression)?
- Different class Loaders in java?
- Access modifiers (how JVM identifies its private or public or protected)?
- Call by value or call by reference (Deep discussion over it)?
- How hash set and HashMap interrelated (Equals and hash code implementation)?
- Some output questions on call by value?
- Why in collection e.g. Set<Integer> use Integer not int as a primitive type?
- What is singleton and request scope?
- What is serialization and how to implement serialization?
- What is mutable?
- Write recursive method for n or n-1 factorial
- What is thread safe?
- How to implement a singleton design pattern?
- What is a builder pattern?
- Do you know the collection stream API and what is this?
- Print uppercase of each element from list using stream API?
- Can we use foreach twice on the same stream method?
Like:name.stream().map(name-> name.touppercase())
.foreach(name->Sysout.println(name)
.foreach(name->Sysout.println(name); ?? - What are the optional classes available?
- Define the memory area of below strings? (Deep discussion with scenarios)
String a = “abc”;
String b = new String(“abc”); - Difference between call by value and call by reference?
- Can a simple java class be a restful API? If yes then what are the rules?
- Difference between array list and hash set?
- Why do hash sets have unique elements?
- Difference between String constant pool and Heap area
- How to create an immutable class?
- Use of Functional interface?
- Access modifiers and differences?
- Anonymous inner class vs lambda which is powerful and why?
- Can we declare HashMap with key and value both as Integer?
- Can we declare HashMap with key and value both as int?
- Explain the reason in both cases either yes, or no?
- Difference between hash set and array list?
- How does the hash set achieve duplicity?
- Is HashMap fast enough or slow enough or does it just provide key value pairs because of which we are using?
- Time complexity of HashMap?
- How do we store data in HashMap? If the same key is in HashMap what will happen? If there is no HashMap collision, then what would be the complexity in that case?
- How many times can we reuse a Stream?
- What is terminal operation in Stream?
- What is the difference between primitive data type and wrapper classes? Why do we need to convert it into objects when we already have a primitive data type?
- HashMap vs concurrent HashMap?
- Synchronized collections?
- How to synchronize an array list?
- Thread Local, thread Pool?
- How will you use the thread for the different entities?
- Concurrent HashMap Internal Working? Can we use a Hash table to achieve concurrency?
- HashMap Internal Working? Where the HashMap objects are getting stored (Stack or heap)?
- Serializable? What will happen in case of Inheritance Parent class implement serializable and child class does not?
- Synchronization? Whether the synchronization will be applied to the class level?
- What is a Session? If we have 2 entities and 1 entity needs to persist and from another entity need to read the data?
- Difference between heap and stack?
- Hash set internal working?
- When to override equals and hash code?
- Collection framework?
- Choice of data structures for different scenarios?
- Array list vs LinkedList?
- Choose data structure for order management?
- How to use objects in HashMap as keys?
- Program to print count of vowels in a string?
- Program to print strings in pairs?
- Program to print HashMap?
- Working of HashMap?
- Program to print odd and even numbers using threads?
- Program to find duplicate numbers in an array efficiently?
- What is the use of wrapper objects (Integer) when we have primitives(int). Whether primitives are defined by java?
- Anonymous inner class vs lambda which is powerful and why?
- If we have a local variable in a method, can we change its value using lambda?
- Access modifiers related questions
- Reflections?
- Garbage collections related questions?
- How do we mock a private method?
- What is the difference between mutable and immutable, what is the use of an immutable class in java?
- Internal implementation of hash set and HashMap?
- What is the data structure used internally for a hash set?
- Difference between HashMap and hash table?
- Explain to me about the oops concept and advantages of each?
- Explain in detail about method overloading and overriding?
- Marker interface?
- Volatile keyword?
- Transient keyword?
- Explain Singleton?
- Write a program for doubleton?
- If we have a local variable in a method, can we change its value using lambda?
- Can private methods in Java be accessed by classes of another package? If it is possible then how?
- Can abstract classes have a constructor? If yes, can we override the abstract class constructor and how?
- Discovery service in Spring Boot?
- Difference between below two statements?
List a = new arraylist();
arraylist b = new arraylist(); - Write a program to cout the ‘abc’ from below String?
String str = “abcefgabchijabc”
—-or——
String str = “abcefgabchij”; - Check if 2 strings are in actual String rotation – program Example –
Actual string = “My Name is ABC”
Case 1: is ABC My Name = true
Case 2: Name is ABC My = true
Case 3: ABC is MY Name = false
-Thank you, happy coding !!