Java Interview Questions Flashcards

1
Q

What is Java?

A

Let us Java Page 3

https://aws.amazon.com/what-is/java/#:~:text=Java%20is%20a%20widely%2Dused,as%20a%20platform%20in%20itself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why is Java a popular choice among modern-day software developers?

A

https://aws.amazon.com/what-is/java/#:~:text=Java%20is%20a%20widely%2Dused,as%20a%20platform%20in%20itself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why is Java Platform Independent?

A

Let us Java Page 4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between compiler and interpreter?

A

https://www.simplilearn.com/difference-between-compiler-and-interpreter-article#:~:text=A%20compiler%20translates%20the%20entire,potentially%20slowing%20down%20the%20program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why is Java not a pure object-oriented programming language?

A

https://medium.com/codex/why-is-java-not-a-pure-object-oriented-programming-language-b5ef9b2b291c#:~:text=well%2Ddefined%20interfaces.-,Java%20is%20not%20considered%20a%20pure%20object%2Doriented%20programming%20language,pure%20object%2Doriented%20programming%20language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the features of Java?

A

https://www.javatpoint.com/features-of-java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Hat do you get in Java Download file?

A

https://www.quora.com/What-do-you-get-in-the-Java-download-file#:~:text=It%20includes%20the%20Java%20Virtual,debugger%2C%20and%20other%20development%20utilities.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is classLoader?

A

https://www.geeksforgeeks.org/classloader-in-java/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the memory allocations available in Java?

A

https://www.educba.com/types-of-memory-in-java/#:~:text=The%20Java%20virtual%20machine%20memory,area%20and%20Native%20method%20area

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the default value stored in local variables?

A

https://www.tutorialspoint.com/what-is-the-default-value-of-a-local-variable-in-java#:~:text=The%20local%20variables%20do%20not,the%20compiler%20throws%20an%20error.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is association in Java?

A

https://medium.com/edureka/association-in-java-3d0facf63d56#:~:text=What%20is%20the%20Association%3F,and%20many%2Dto%2Dmany.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Copy Constructor in Java?

A

https://www.javatpoint.com/java-copy-constructor-example

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are Marker Interfaces? Can we create own marker interfaces?

A

https://www.baeldung.com/java-marker-interfaces#:~:text=A%20marker%20interface%20is%20an,also%20called%20a%20tagging%20interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Object Cloning?

A

https://www.javatpoint.com/object-cloning

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are wrapper classes in Java?

A

https://www.javatpoint.com/wrapper-class-in-java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is singleton class in Java and how to implement it?

A

https://www.geeksforgeeks.org/singleton-class-java/

https://www.javatpoint.com/singleton-design-pattern-in-java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is Package in Java?

A

https://www.javatpoint.com/package

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Can we implement pointers in Java?

A

https://stackoverflow.com/questions/1750106/how-can-i-use-pointers-in-java

https://www.simplilearn.com/tutorials/java-tutorial/java-interview-questions#GoTop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Difference between instance and local variable

A

https://pediaa.com/what-is-the-difference-between-instance-variable-and-local-variable/#:~:text=An%20instance%20variable%20is%20a%20variable%20that%20is%20bound%20to,instance%20variable%20and%20local%20variable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

String pool in Java

A

https://www.linkedin.com/pulse/java-strings-string-pool-muhammad-noman?utm_source=share&utm_medium=member_ios&utm_campaign=share_via

https://www.digitalocean.com/community/tutorials/what-is-java-string-pool

https://www.simplilearn.com/tutorials/java-tutorial/java-interview-questions#GoTop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is an Exception?

A

https://docs.oracle.com/javase/tutorial/essential/exceptions/definition.html#:~:text=Definition%3A%20An%20exception%20is%20an,off%20to%20the%20runtime%20system.

Page 453 in Let us Java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Final keyword in Java

A

https://www.javatpoint.com/final-keyword

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Can we declare main[] as Non-static in Java?

A

https://www.tutorialspoint.com/can-we-declare-main-method-as-non-static-in-java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Why is main method static in Java?

A

https://www.javatpoint.com/why-main-method-is-always-static-in-java

https://www.scaler.com/topics/why-main-method-is-static-in-java/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Garbage collection process

A

https://www.geeksforgeeks.org/garbage-collection-java/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Difference between process and program

A

https://www.almabetter.com/bytes/articles/difference-between-process-and-program#:~:text=A%20program%20is%20a%20set%20of%20instructions%20written%20in%20a,%2C%20data%2C%20and%20system%20resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Difference between constructor and method of a class

A

https://www.geeksforgeeks.org/difference-between-the-constructors-and-methods/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Difference between String, StringBuffer and StringBuilder

A

https://www.digitalocean.com/community/tutorials/string-vs-stringbuffer-vs-stringbuilder#:~:text=String%20is%20immutable%20whereas%20StringBuffer,uses%20StringBuffer%20or%20StringBuilder%20class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Daemon thread in Java?

A

https://www.geeksforgeeks.org/daemon-thread-java/#:~:text=By%20default%2C%20the%20main%20thread,is%20also%20a%20non%2Ddaemon.

https://www.scaler.com/topics/daemon-thread-in-java/#:~:text=What%20is%20Daemon%20Thread%20in,that%20helps%20the%20user%20thread.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What happens if there are multiple main() methods in a class

A

https://stackoverflow.com/questions/13399836/can-there-exist-two-main-methods-in-a-java-program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

How does exception propagate in code in Java?

A

https://www.javatpoint.com/exception-propagation#:~:text=An%20exception%20is%20first%20thrown,bottom%20of%20the%20call%20stack.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

How do exceptions affect the program if it doesn’t handle them?

A

If you don’t deal with an exception once it occurs, the programme will end abruptly and the code after the line where the exception occurred won’t run.

Exceptions are runtime errors. Suppose we are making an android application with java. And it all works fine but there is an exceptional case when the application tries to get the file from storage and the file doesn’t exist (This is the case of exception in java). And if this case is not handled properly then the application will crash. This will be a bad experience for users. This is the type of error that cannot be controlled by the programmer. But programmers can take some steps to avoid this so that the application won’t crash. The proper action can be taken at this step.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

Is it mandatory for a catch block to be followed after a try block?

A

https://stackoverflow.com/questions/6703085/is-it-necessary-to-put-catch-statements-after-a-try-block

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

Can you call a constructor of a class inside another constructor?

A

https://www.javatpoint.com/what-is-constructor-chaining-in-java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

Contiguous memory locations are usually used for storing actual values in an array but not in ArrayList. Explain.

A

Primitive data types like int, float, and others are typically present in an array. In such circumstances, the array immediately saves these elements at contiguous memory regions. While an ArrayList does not contain primitive data types. Instead of the actual object, an ArrayList includes the references to the objects’ many locations in memory. The objects are not kept in consecutive memory regions because of this.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

Why does the java array index start with 0?

A

https://stackoverflow.com/questions/24841172/why-does-array-indexing-in-java-start-with-0#:~:text=The%20index%20in%20an%20array,Therefore%20the%20offset%20is%200.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

Why is the remove method faster in the linked list than in an array?

A

https://www.baeldung.com/java-arraylist-vs-linkedlist-vs-hashmap#:~:text=The%20insertion%2C%20addition%2C%20and%20removal,surrounding%20elements%20need%20to%20change.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

Difference between LinkedList, ArrayList and HashMap

A

https://www.baeldung.com/java-arraylist-vs-linkedlist-vs-hashmap#:~:text=The%20insertion%2C%20addition%2C%20and%20removal,surrounding%20elements%20need%20to%20change.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

How many overloaded add() and addAll() methods are available in the List interface?

A

https://www.digitalocean.com/community/tutorials/java-list-add-addall-methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

How does the size of ArrayList grow dynamically?

A

https://www.javaguides.net/2018/08/how-size-of-arraylist-increases-dynamically.html#google_vignette

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

Although inheritance is a popular OOPs concept, it is less advantageous than composition. Explain.

A

https://www.thoughtworks.com/insights/blog/composition-vs-inheritance-how-choose

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

What are Composition and Aggregation? State the difference.

A

https://www.geeksforgeeks.org/difference-between-aggregation-and-composition-in-java/#:~:text=Aggregation%20can%20be%20described%20as,is%20contained%20in%20another%20object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

How is string literal different from string object

A

https://www.geeksforgeeks.org/string-initialization-java-string-literal-vs-string-object/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

new Operator vs newInstance() Method in Java

A

https://www.geeksforgeeks.org/new-operator-vs-newinstance-method-java/#:~:text=In%20Java%2C%20new%20is%20an,newInstance()%20method%20is%20used.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

Is exceeding the memory limit possible in a program despite having a garbage collector?

A

Yes, even with a garbage collector in place, the programme could still run out of memory. Garbage collection aids in identifying and removing programme objects that are no longer needed in order to release the resources they use. When an object in a programme cannot be reached, trash collection is executed with respect to that object. If there is not enough memory available to create new objects, a garbage collector is used to free up memory for things that have been removed from the scope. When the amount of memory released is insufficient for the creation of new objects, the program’s memory limit is exceeded.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

What is Multithreading in Java

A

https://www.scaler.com/topics/multithreading-in-java/

https://www.digitalocean.com/community/tutorials/multithreading-in-java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

Why is synchronization necessary?

A

https://www.javatpoint.com/synchronization-in-java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

Define System.out.println().

A

https://www.tutorialspoint.com/system-out-println-in-java#:~:text=Introduction,the%20execution%20of%20a%20program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

Life cycle of a Thread (Thread States)

A

https://www.javatpoint.com/life-cycle-of-a-thread

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

What could be the tradeoff between the usage of an unordered array versus the usage of an ordered array?

A

https://stackoverflow.com/questions/54027951/difference-between-sorted-and-unsorted-array-time-complexity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

Is it possible to import the same class or package twice in Java and what happens to it during runtime?

A

The same package or class may be imported more than once. Neither the JVM nor the compiler raise an objection. Even if you import the same class several times, the JVM will only internally load it once.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q

In case a package has sub packages, will it suffice to import only the main package? e.g. Does importing of com.myMainPackage.* also import com.myMainPackage.mySubPackage.*?

A

Sub-packages won’t be imported when a package is imported. When you import a package, all of its classes and interfaces—with the exception of those from its sub-packages—are imported.

This is a big NO. We need to understand that the importing of the sub-packages of a package needs to be done explicitly. Importing the parent package only results in the import of the classes within it and not the contents of its child/sub-packages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q

Will the final block be executed if the code System.exit(0) is written at the end of the try block?

A

The system is established as the last line to be run, after which nothing will happen, therefore both the catch and finally blocks are essentially ignored.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q

Explain the term “Double Brace Initialisation” in Java?

A

https://www.javatpoint.com/double-brace-initialization-in-java#:~:text=Double%20brace%20initialization%20is%20a,within%20the%20instantiation%20code%20block.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
55
Q

Why is it said that the length() method of String class doesn’t return accurate results?

A

https://arc.dev/developer-blog/java-interview-questions/#:~:text=length()%20accurate%3F,of%20U%2B10000%20or%20greater.

Experienced Question 18

https://www.interviewbit.com/java-interview-questions/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
56
Q

How to make object eligible for garbage collection in Java?

A

https://www.geeksforgeeks.org/how-to-make-object-eligible-for-garbage-collection/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
57
Q

What is the best way to inject dependency? Also, state the reason.

A

https://www.geeksforgeeks.org/what-is-the-best-way-to-inject-dependency-in-java/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
58
Q

Bean scopes in JSF

A

https://stackoverflow.com/questions/7031885/how-to-choose-the-right-bean-scope

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
59
Q

Bean scopes in Spring

A

https://www.digitalocean.com/community/tutorials/spring-bean-scopes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
60
Q

Design patterns in Java

A

https://www.geeksforgeeks.org/java-design-patterns/

Experienced Question 24

https://www.interviewbit.com/java-interview-questions/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
61
Q

What is a Memory Leak? Discuss some common causes of it

A

https://www.baeldung.com/java-memory-leaks#:~:text=A%20Memory%20Leak%20is%20a,degrades%20system%20performance%20over%20time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
62
Q

Assume a thread has a lock on it, calling the sleep() method on that thread will release the lock?

A

No, the thread might release the locks using notify, notifyAll(), and wait() methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
63
Q

Java Programming simple

A

Refer 65 to 74 from

https://www.simplilearn.com/tutorials/java-tutorial/java-interview-questions#GoTop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
64
Q

What is the difference between JDK, JRE, and JVM?

A

JVM has a Just in Time (JIT) compiler tool that converts all the Java source code into the low-level compatible machine language. Therefore, it runs faster than the regular application.

JRE has class libraries and other JVM supporting files. But it doesn’t have any tool for java development such as compiler or debugger.

JDK has tools that are required to write Java Programs and uses JRE to execute them. It has a compiler, Java application launcher, and an applet viewer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
65
Q

What is a JIT compiler?

A

https://www.javatpoint.com/jit-in-java

Question No 10 from

https://www.interviewbit.com/java-interview-questions/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
66
Q

What are Brief Access Specifiers and Types of Access Specifiers?

A

Access Specifiers are predefined keywords used to help JVM understand the scope of a variable, method, and class. We have four access specifiers.

Public Access Specifier
Private Access Specifier
Protected Access Specifier
Default Access Specifier

https://www.javatpoint.com/access-modifiers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
67
Q

Types of Constructors in Java

A

https://www.digitalocean.com/community/tutorials/constructor-in-java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
68
Q

Can a constructor return a value?

A

Yes, A constructor can return a value. It replaces the class’s current instance implicitly; you cannot make a constructor return a value explicitly.

https://www.javatpoint.com/java-constructor-returns-a-value-but-what

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
69
Q

Explain ‘this’ keyword in Java.

A

https://www.javatpoint.com/this-keyword

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
70
Q

OOPs principles

A

https://www.linkedin.com/pulse/7-oops-principles-every-programmer-should-know-harsh-sakhiya?utm_source=share&utm_medium=member_ios&utm_campaign=share_via

And

Let us Java page 250

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
71
Q

Super Keyword in Java

A

https://www.geeksforgeeks.org/super-keyword/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
72
Q

Explain Method Overloading in Java.

A

The process of creating multiple method signatures using one method name is called Method Overloading in Java. Two ways to achieve method overloading are:

Varying the number of arguments
Changing the return type of the Method

https://www.javatpoint.com/method-overloading-in-java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
73
Q

Can we overload a static method?

A

No, Java does not support the Overloading of a static method. The process would throw an error reading “static method cannot be referenced.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
74
Q

Late binding in Java

A

https://www.linkedin.com/pulse/early-late-binding-java-pramod-yadav?utm_source=share&utm_medium=member_ios&utm_campaign=share_via

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
75
Q

Overriding in Java

A

https://www.geeksforgeeks.org/overriding-in-java/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
76
Q

Polymorphism in Java

A

https://www.geeksforgeeks.org/polymorphism-in-java/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
77
Q

Define Dynamic Method Dispatch.

A

The Dynamic method dispatch is a process where the method call is executed during the runtime. A reference variable is used to call the super-class. This process is also known as Run-Time Polymorphism.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
78
Q

Why is the delete function faster in the linked list than an array?

A

https://www.quora.com/Computer-Programming-Why-is-the-delete-function-faster-in-the-linked-list-than-an-array

https://www.baeldung.com/java-arraylist-vs-linkedlist-vs-hashmap#:~:text=The%20insertion%2C%20addition%2C%20and%20removal,surrounding%20elements%20need%20to%20change.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
79
Q

Difference between Array and Arraylists

A

https://www.javatpoint.com/difference-between-array-and-arraylist

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
80
Q

Lifecycle and States of a Thread in Java

A

https://www.geeksforgeeks.org/lifecycle-and-states-of-a-thread-in-java/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
81
Q

difference between&raquo_space; and&raquo_space;> operators

A

https://www.geeksforgeeks.org/what-is-javascript-operator-and-how-to-use-it/#:~:text=Difference%20between%20%3E%3E%3E%20and%20%3E,the%20integer%20value%20when%20shifted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
82
Q

Applets and their lifecycle

A

https://www.geeksforgeeks.org/java-applet-basics/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
83
Q

Why are generics used in Java Programming?

A

Compile-time type safety is provided by using generics. Compile-time type safety allows users to catch unnecessary invalid types at compile time. Generic methods and classes help programmers specify a single method declaration, a set of related methods, or related types with an available class declaration.

https://www.oracle.com/technical-resources/articles/java/juneau-generics.html

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
84
Q

Serializable and Externalizable interfaces in Java

A

https://www.geeksforgeeks.org/externalizable-interface-java/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
85
Q

Enum in Java

A

https://www.freecodecamp.org/news/java-enum-enumeration-in-java-example/#:~:text=An%20enumeration%20(enum%20for%20short,%2C%20colors%2C%20and%20so%20on.

https://www.geeksforgeeks.org/enum-in-java/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
86
Q

Why is Java Dynamic

A

https://www.cesarsotovalero.net/blog/the-dynamic-features-of-java.html

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
87
Q

Can you run a code before executing the main method?

A

Yes, we can execute any code, even before the main method. We will be using a static block of code when creating the objects at the class’s load time. Any statements within this static block of code will get executed at once while loading the class, even before creating objects in the main method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
88
Q

How many times is the finalize method called?

A

https://www.tutorialspoint.com/how-many-times-finalize-method-will-be-invoked-who-invokes-finalize-method-in-java#:~:text=It%20is%20invoked%20only%20once,override%20it%20from%20any%20class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
89
Q

Can “this” and “super” keywords be used together?

A

https://stackoverflow.com/questions/10381244/why-cant-this-and-super-both-be-used-together-in-a-constructor

https://www.quora.com/Can-you-use-this-and-super-both-in-a-constructor#:~:text=NO.,()%20but%20not%20the%20both.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
90
Q

Why does this() and super() have to be the first statement in a constructor?

A

https://www.quora.com/Why-does-this-and-super-have-to-be-the-first-statement-in-a-constructor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
91
Q

What is a JSP page?

A

https://www.geeksforgeeks.org/introduction-to-jsp/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
92
Q

What is JDBC?

A

https://www.javatpoint.com/java-jdbc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
93
Q

Explain the various directives in JSP

A

https://www.geeksforgeeks.org/introduction-to-jsp/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
94
Q

What are the observer and observable classes?

A

https://stackoverflow.com/questions/13744450/when-should-we-use-observer-and-observable

https://stackoverflow.com/questions/70949886/observer-and-observable-got-deprecated-and-the-reason-stated-is-they-convey-som

https://www.oreilly.com/library/view/learning-java-4th/9781449372477/ch11s08.html

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
95
Q

What is Session Management in Java?

A

https://www.educba.com/servlet-session-management/#:~:text=Servlet%20Session%20Management%20is%20a,Cookies%2C%20URL%20rewriting%2C%20etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
96
Q

Briefly explain the term Spring Framework.

A

https://docs.spring.io/spring-framework/docs/3.2.x/spring-framework-reference/html/overview.html#:~:text=Spring%20Framework%20is%20a%20Java,can%20focus%20on%20your%20application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
97
Q

How to handle exceptions in Spring MVC Framework?

A

https://medium.com/@AlexanderObregon/the-art-of-handling-exceptions-with-exceptionhandler-in-spring-mvc-dfb956d84aef#:~:text=Instead%20of%20defining%20the%20same,ControllerAdvice%20to%20handle%20exceptions%20globally.&text=With%20%40ControllerAdvice%20%2C%20any%20exception%20thrown,will%20be%20caught%20and%20handled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
98
Q

What is JCA in Java?

A

https://www.educative.io/answers/what-is-java-cryptography-architecture-jca

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
99
Q

Explain JPA in Java.

A

https://www.javatpoint.com/jpa-introduction

https://www.ibm.com/docs/en/was-liberty/nd?topic=liberty-java-persistence-api-jpa

The Java Persistence API enables us to create the persistence layer for desktop and web applications. Java Persistence deals in the following:

Java Persistence API
Query Language
Java Persistence Criteria API
Object Mapping Metadata

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
100
Q

Explain the different authentications in Java Servlets.

A

https://www.careerride.com/j18.aspx

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
101
Q

Explain FailFast iterator and FailSafe iterator along with examples for each.

A

https://anmolsehgal.medium.com/fail-fast-and-fail-safe-iterations-in-java-collections-11ce8ca4180e#:~:text=Fail%2Dsafe%20iterators%20means%20they,modified%20while%20iterating%20over%20it.&text=As%20arrayLists%20are%20fail%2Dfast%20above%20code%20will%20throw%20an%20exception.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
102
Q

Programming questions 111 to 118 from the link below

A

https://www.simplilearn.com/tutorials/java-tutorial/java-interview-questions#GoTop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
103
Q

What do you understand by an instance variable and a local variable?

A

https://www.geeksforgeeks.org/difference-between-instance-variable-and-local-variable/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
104
Q

Can the main method be overloaded?

A

https://www.geeksforgeeks.org/how-to-overload-and-override-main-method-in-java/#:~:text=Yes%2C%20We%20can%20overload%20the,call%20our%20overloaded%20main%20method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
105
Q

Difference Between Method Overloading and Method Overriding in Java

A

https://www.geeksforgeeks.org/difference-between-method-overloading-and-method-overriding-in-java/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
106
Q

Is it possible to have multiple try blocks with only one catch block in java?

A

https://www.tutorialspoint.com/is-it-possible-to-have-multiple-try-blocks-with-only-one-catch-block-in-java#:~:text=You%20cannot%20have%20multiple%20try,compile%20time%20error%20is%20generated.

107
Q

Java - Multi catch block with Examples

A

https://www.tutorialspoint.com/java/java_multi_catch_block.htm

108
Q

Do final, finally and finalize keywords have the same function?

A

https://www.javatpoint.com/difference-between-final-finally-and-finalize

109
Q

When can you use the “super” keyword?

A

Basically, the super keyword is used to refer to the parent class. When there are the same fields in both parent and child classes, then one can use a super keyword to access data members of the parent class.

110
Q

What are shallow copy and deep copy in Java?

A

In the case of a shallow copy, primitive data types are copied, whereas in the case of a deep copy along with primitive data types the object references are also copied.

https://www.javatpoint.com/shallow-copy-vs-deep-copy-in-java

111
Q

differences between interfaces and abstract classes.

A

https://www.geeksforgeeks.org/difference-between-abstract-class-and-interface-in-java/

112
Q

What are the different ways of thread usage?

A

There are two ways to define and implement a thread in Java. They are by implementing the runnable interface and extending the thread class.

https://www.simplilearn.com/tutorials/java-tutorial/java-interview-questions#GoTop

113
Q

What is the difference between the ‘throw’ and ‘throws’ keyword in Java?

A

https://www.geeksforgeeks.org/difference-between-throw-and-throws-in-java/#:~:text=The%20throw%20keyword%20is%20used%20to%20throw%20an%20exception%20explicitly,ones%2C%20is%20thrown%20automatically%20then.

114
Q

Java works as a “pass by value” or “pass by reference” phenomenon?

A

https://www.javatpoint.com/java-pass-by-value#:~:text=It%20is%20really%20confusing%20and,pass%20by%20reference%20in%20Java.

115
Q

How to not allow serialization of attributes of a class in Java?

A

https://elearning.uou.ac.in/mod/forum/discuss.php?d=591&parent=1083

Question 24 Intermediate

https://www.interviewbit.com/java-interview-questions/

116
Q

What are the default values assigned to variables and instances in Java?

A

By default, for a numerical value it is 0, for the boolean value it is false and for objects it is NULL.

Question 8 from

https://www.interviewbit.com/java-interview-questions/

117
Q

What do you mean by data encapsulation?

A

http://www.cs.mun.ca/~donald/bsc/node13.html#:~:text=Data%20encapsulation%2C%20sometimes%20referred%20to,special%20functions%20commonly%20called%20methods.

118
Q

Explain inheritance

A

http://www.cs.mun.ca/~donald/bsc/node14.html#SECTION00432000000000000000

https://www.geeksforgeeks.org/inheritance-in-java/

119
Q

Can you tell the difference between equals() method and equality operator (==) in Java?

A

https://www.linkedin.com/pulse/difference-between-equals-java-babar-shahzad?utm_source=share&utm_medium=member_ios&utm_campaign=share_via

120
Q

Briefly explain the concept of constructor overloading

A

https://www.geeksforgeeks.org/constructor-overloading-java/

121
Q

Explain the use of the final keyword in variable, method and class.

A

https://www.javatpoint.com/final-keyword

122
Q

Is it possible that the ‘finally’ block will not be executed? If yes then list the case.

A

Yes, there is a possibility that the ‘finally’ block cannot get executed. Here are some of the cases where the above situation occurs.

During the time of fatal errors such as memory exhaustion, memory access error, etc.
During the time of using System.exit()

https://www.scientecheasy.com/2020/05/java-finally-block-not-executed.html/

123
Q

Difference between static methods, static variables, and static classes in Java.

A

https://stackoverflow.com/questions/52935433/what-is-difference-between-static-variable-and-static-method-and-static-class

124
Q

Apart from the security aspect, what are the reasons behind making strings immutable in Java?

A

Because of security, synchronization, concurrency, caching, and class loading, the String is immutable in Java. The reason for making string final would be to destroy its immutability and help stop others from trying to extend it. String objects are cached in the String pool, making them immutable.

https://www.upgrad.com/tutorials/software-engineering/java-tutorial/why-string-is-immutable-in-java/#:~:text=If%20the%20string%20was%20not,security%20threat%20to%20the%20application.

125
Q

How would you differentiate between a String, StringBuffer, and a StringBuilder?

A

https://www.geeksforgeeks.org/string-vs-stringbuilder-vs-stringbuffer-in-java/

126
Q

What is a Comparator in Java?

A

https://www.geeksforgeeks.org/comparator-interface-java/

127
Q

In Java, static as well as private method overriding is possible. Comment on the statement.

A

In Java, you could indeed override a private or static method. If you create a similar method in a child class with the same return type and method arguments, it will hide the super class method; this is known as method hiding. Similarly, you cannot override a private method in a subclass because it is not accessible from that.

128
Q

What makes a HashSet different from a TreeSet?

A

https://www.geeksforgeeks.org/hashset-vs-treeset-in-java/

129
Q

Why is the character array preferred over string for storing confidential information?

A

https://www.geeksforgeeks.org/use-char-array-string-storing-passwords-java/

130
Q

What are the differences between HashMap and HashTable in Java?

A

https://www.geeksforgeeks.org/differences-between-hashmap-and-hashtable-in-java/

131
Q

What is the importance of reflection in Java?

A

https://www.geeksforgeeks.org/reflection-in-java/#:~:text=Reflection%20gives%20us%20information%20about,access%20specifier%20used%20with%20them.

132
Q

What are the different types of Thread Priorities in Java? And what is the default priority of a thread assigned by JVM?

A

https://www.geeksforgeeks.org/java-thread-priority-multithreading/

133
Q

What is the ‘IS-A ‘ relationship in OOPs Java?

A

https://www.geeksforgeeks.org/what-is-is-a-relationship-in-java/

134
Q

Can static methods be overridden?

A

https://www.geeksforgeeks.org/can-we-overload-or-override-static-methods-in-java/

135
Q

What are the different ways of thread usage?

A

https://www.geeksforgeeks.org/java-program-to-create-a-thread/

136
Q

How do you achieve Object Cloning in Java?

A

https://www.geeksforgeeks.org/clone-method-in-java-2/

137
Q

What are the advantages of Packages in Java?

A

https://techvidvan.com/tutorials/packages-in-java/

138
Q

Difference between static (class) method and instance method

A

https://www.geeksforgeeks.org/static-methods-vs-instance-methods-java/

139
Q

How can constructor chaining be done using this keyword?

A

https://www.baeldung.com/java-chain-constructors#:~:text=Constructor%20chaining%20is%20the%20process,constructors%20from%20the%20parent%20class

140
Q

Which class is the superclass for all the classes?

A

https://www.tutorialspoint.com/why-object-class-is-the-super-class-for-all-classes-in-java

141
Q

Why are multiple inheritances not supported in Java?

A

https://www.digitalocean.com/community/tutorials/multiple-inheritance-in-java#:~:text=Diamond%20Problem%20in%20Java&text=This%20leads%20to%20the%20ambiguity,support%20multiple%20inheritances%20in%20classes.

142
Q

Why is method overloading not possible by changing the return type in Java?

A

https://www.quora.com/Why-is-method-overloading-not-possible-by-changing-the-return-type-in-Java#:~:text=In%20java%2C%20method%20overloading%20is,because%20there%20may%20occur%20ambiguity.

143
Q

What is method overloading with type promotion?

A

https://www.c-sharpcorner.com/UploadFile/3614a6/type-promotion-in-java/#:~:text=Type%20promotion%20is%20done%20while,one%20datatype%20to%20another%20datatype.

144
Q

Can we change the scope of the overridden method in the subclass?

A

https://stackoverflow.com/questions/9330001/change-the-access-modifier-of-an-overridden-method-in-java

https://www.krayonnz.com/user/doubts/detail/63dcc32303de5b005f49e961/can-we-change-the-scope-of-the-overridden-method-in-the-subclass#:~:text=Yes%2C%20we%20can%20change%20the,protected%2C%20public%2C%20or%20default.

145
Q

Can you have virtual functions in Java?

A

https://stackoverflow.com/questions/4547453/can-you-write-virtual-functions-methods-in-java

146
Q

What is the covariant return type?

A

https://www.geeksforgeeks.org/covariant-return-types-java/

147
Q

What is the final blank variable?

A

https://www.javatpoint.com/final-keyword#:~:text=Q)%20What%20is%20blank%20or,be%20changed%2C%20it%20is%20useful.

148
Q

Difference between the final method and the abstract method

A

https://www.geeksforgeeks.org/difference-between-final-and-abstract-in-java/

149
Q

Differences between Heap and Stack Memory in Java

A

https://www.digitalocean.com/community/tutorials/java-heap-space-vs-stack-memory#:~:text=Heap%20memory%20is%20used%20by,contains%20the%20reference%20to%20it.

150
Q

How is Java different from C++?

A

https://www.javatpoint.com/cpp-vs-java#:~:text=C%2B%2B%20is%20compiled%20and%20run,at%20runtime%20and%20produces%20output.

151
Q

Pointers are used in C/ C++. Why does Java not make use of pointers?

A

https://www.c-sharpcorner.com/interview-question/why-java-does-not-support-pointers#:~:text=A%20pointer%20is%20a%20variable,restriction%20even%20variable%20is%20private.

152
Q

Explain the use of final keyword in variable, method and class.

A

Question 18 from

https://www.interviewbit.com/java-interview-questions/

153
Q

Do final, finally and finalize keywords have the same function?

A

Question 19 from

https://www.interviewbit.com/java-interview-questions/

154
Q

Apart from the security aspect, what are the reasons behind making strings immutable in Java?

A

Intermediate question 1 from

https://www.interviewbit.com/java-interview-questions/

155
Q

What do we get in the JDK file?

A

Intermediate Question 11

https://www.interviewbit.com/java-interview-questions/

156
Q

Can we make the main() thread a daemon thread?

A

https://www.geeksforgeeks.org/daemon-thread-java/#:~:text=By%20default%2C%20the%20main%20thread,is%20also%20a%20non%2Ddaemon.

157
Q

Will the finally block get executed when the return statement is written at the end of try block and catch block as shown below?

A

finally block will be executed irrespective of the exception or not. The only case where finally block is not executed is when it encounters ‘System.exit()’ method anywhere in try/catch block.

158
Q

Contiguous memory locations are usually used for storing actual values in an array but not in ArrayList. Explain.

A

Intermediate 35

https://www.interviewbit.com/java-interview-questions/

159
Q

Why does the java array index start with 0?

A

Question 36

https://www.interviewbit.com/java-interview-questions/

160
Q

How many overloaded add() and addAll() methods are available in the List interface? Describe the need and uses.

A

Intermediate 38

https://www.interviewbit.com/java-interview-questions/

161
Q

How does the size of ArrayList grow dynamically? And also state how it is implemented internally.

A

Question 39

https://www.interviewbit.com/java-interview-questions/

162
Q

Although inheritance is a popular OOPs concept, it is less advantageous than composition. Explain.

A

https://www.digitalocean.com/community/tutorials/composition-vs-inheritance

Question 1 Experienced

https://www.interviewbit.com/java-interview-questions/

163
Q

What is the difference between ‘»’ and ‘»>’ operators in java?

A

Question 2 experienced

https://www.interviewbit.com/java-interview-questions/

164
Q

How is the ‘new’ operator different from the ‘newInstance()’ operator in java?

A

https://www.geeksforgeeks.org/new-operator-vs-newinstance-method-java/#:~:text=In%20Java%2C%20new%20is%20an,newInstance()%20method%20is%20used.

165
Q

Why is synchronization necessary? Explain with the help of a relevant example.

A

Question 7 experienced

https://www.interviewbit.com/java-interview-questions/

166
Q

Experienced Questions 8 and 9

A

https://www.interviewbit.com/java-interview-questions/

167
Q

Is it possible to import the same class or package twice in Java and what happens to it during runtime?

A

It is possible to import a class or package more than once, however, it is redundant because the JVM internally loads the package or class only once.

168
Q

Assume a thread has a lock on it, calling the sleep() method on that thread will release the lock?

A

A thread that has a lock won’t be released even after it calls sleep(). Despite the thread sleeping for a specified period of time, the lock will not be released.

169
Q

Differentiate between Volatile and Transient Variable in Java.

A

https://naveen-metta.medium.com/understanding-transient-and-volatile-variables-in-java-2af7bc534bde#:~:text=Transient%20variables%20help%20in%20excluding,caused%20by%20caching%20or%20optimization.

170
Q

Differentiate between the Vector and ArrayList collections in Java.

A

https://www.geeksforgeeks.org/vector-vs-arraylist-java/

Question 2 from

https://www.interviewbit.com/java-interview-questions-for-5-years-experience/

171
Q

How is Collection different from Collections in Java?

A

https://www.geeksforgeeks.org/collection-vs-collections-in-java-with-example/

172
Q

code for representing thread-safe singleton patterns in Java?

A

Question 5 from

https://www.interviewbit.com/java-interview-questions-for-5-years-experience/

173
Q

What is the importance of the hashCode() and equals() contract?

A

https://bulldogjob.com/readme/how-not-to-break-your-app-with-hashcode-and-equals#:~:text=hashCode()%20and%20equals()%20contract,equals()%20can%20return%20false.

Question 6

https://www.interviewbit.com/java-interview-questions-for-5-years-experience/

174
Q

How is the classpath variable different from the path variables?

A

https://www.linkedin.com/pulse/difference-between-path-classpath-shivani-verma?utm_source=share&utm_medium=member_ios&utm_campaign=share_via

175
Q

Can we use HashMap in a multi-threaded environment?

A

https://stackoverflow.com/questions/11050539/using-hashmap-in-multithreaded-environment

https://www.quora.com/What%E2%80%99s-wrong-with-using-HashMap-in-a-multithreaded-environment-when-the-get-method-goes-to-an-infinite-loop

176
Q

What will happen if you run 1.0/0.0?

A

The double class provides certain rules like Double.INFINITY, NaN, -0.0, etc which aids in arithmetic calculations. The given problem will return Double.INFINITY without throwing any Arithmetic Exception.

177
Q

Is it possible to override a method to throw RuntimeException from throwing NullPointerException in the parent class?

A

Yes, this is possible. But it is not possible if the parent class has a checked Exception. This is due to the below rule of method overriding in cases of checked exceptions:

The method that wants to override a parent class method can not throw a higher Exception than the overridden method.

This means that if the overridden method is throwing IOException, then the overriding child class method can only throw IOException or its sub-classes. This overriding method can not throw a higher Exception than the original or overridden method.

178
Q

Is there any difference in defining or creating a String by using String literal and by using the new() operator?

A

Creating string using the new operator ensures that the String is created in the heap alone and not into the string pool. Whereas, creating string using literal ensures that the string is created in the string pool. String pool exists as part of the perm area in the heap. This ensures that the multiple Strings created using literal having same values are pointed to one object and prevents duplicate objects with the same value from being created.

179
Q

Is it necessary to declare all immutable objects as final?

A

This is not necessary. The functionality of achieving immutability can also be achieved by defining the members of a class as private and not providing any setter methods to modify/update the values. Any references to the members should not be leaked and the only source of initializing the members should be by using the parameterized constructor.

We should note that the variables declared as final only takes care of not re-assigning the variable to a different value. The individual properties of an object can still be changed.

180
Q

What do you know about Factory Design Pattern in Java?

A

https://www.digitalocean.com/community/tutorials/factory-design-pattern-in-java#:~:text=The%20factory%20design%20pattern%20is,program%20to%20the%20factory%20class.

181
Q

What is a deadlock and discuss the necessary conditions for deadlock?

A

https://www.javatpoint.com/deadlock-in-java

https://www.scaler.com/topics/operating-system/deadlock-in-os/#:~:text=A%20deadlock%20in%20OS%20is,and%20wait%20and%20circular%20set.

182
Q

Differentiate between multitasking and multithreading?

A

https://www.geeksforgeeks.org/difference-between-multi-tasking-and-multi-threading/

183
Q

Differentiate between thread and process?

A

https://www.geeksforgeeks.org/difference-between-process-and-thread/

184
Q

What is an object oriented model?

A

https://www.geeksforgeeks.org/basic-object-oriented-data-model/

185
Q

You are given the head of a linked list, to determine whether the cycle is present in the linked list. Approach?

A

One common approach to detect a cycle in a linked list is the two pointer technique, often called Floyd’s Cycle Detection Algorithm. Here’s the simple explanation:

We use two pointers, one slow (moving one step at a time) and another fast (moving two steps at a time). We start at the head of the linked list and move both pointers according to their rules. If the linked list has a cycle, the fast pointer will eventually catch up to the slow pointer. If it doesn’t, the fast pointer will reach the end of the list.

186
Q

Problem statement: You are given an array nums having n integers colored red, white, or blue, sort them in place so that objects of the same color are adjacent, with the colors in the order red, white, and blue. Approaches?

A

This problem is also known as the Dutch National Flag problem. The easiest approach to solve this problem is to use a two-pass algorithm.

In the first pass, count the number of red, white, and blue elements. In the second pass, overwrite the array with the right number of red, white, and blue elements in the correct order.

Alternatively, a more efficient one-pass algorithm can be used, which involves three pointers: one for the current element, one for the end of the red elements and one for the start of the blue elements. As you iterate through the array, swap elements to move them to the right place.

187
Q

Differentiate between super key and primary key?

A

https://www.geeksforgeeks.org/difference-between-primary-key-and-super-key/#:~:text=Difference%20between%20Super%20Key%20and%20Primary%20Key%3A&text=1.-,Super%20Key%20is%20an%20attribute%20(or%20set%20of%20attributes)%20that,all%20attributes%20in%20a%20relation.

188
Q

How UNION is different from UNION ALL?

A

https://www.atlassian.com/data/sql/what-is-the-difference-between-union-and-union-all#:~:text=The%20main%20difference%20between%20UNION,keeps%20all%20records%2C%20including%20duplicates

189
Q

Define Bus Topology.

A

https://www.computerhope.com/jargon/b/bustopol.htm

190
Q

Generics in Java

A

https://www.javatpoint.com/generics-in-java

191
Q

Concurrenthashmap in Java. How is it different from Hashmap

A

https://www.geeksforgeeks.org/concurrenthashmap-in-java/

https://www.geeksforgeeks.org/difference-hashmap-concurrenthashmap/

192
Q

How to prevent Singleton Pattern from Reflection, Serialization and Cloning?

A

https://www.geeksforgeeks.org/prevent-singleton-pattern-reflection-serialization-cloning/#:~:text=Overcome%20Cloning%20issue%3A%20To%20overcome,hence%20our%20class%20remains%20singleton.

193
Q

HashMap in Java

A

https://www.geeksforgeeks.org/java-util-hashmap-in-java-with-examples/

194
Q

Disadvantage of Multithreading in Java

A

https://www.javatpoint.com/disadvantage-of-multithreading-in-java

195
Q

Concurrent Hashmap how it works? why is better than synchronised block?

A

https://stackoverflow.com/questions/12628600/java-synchronized-block-vs-concurrenthashmap-vs-collections-synchronizedmap

https://www.geeksforgeeks.org/difference-between-concurrenthashmap-and-synchronizedhashmap/

196
Q

how to achieve locking? difference between lock and shynchronised

A

https://stackoverflow.com/questions/4201713/synchronization-vs-lock

https://www.geeksforgeeks.org/lock-framework-vs-thread-synchronization-in-java/#:~:text=Lock%20framework%20works%20like%20synchronized,below%2Dmentioned%20problem%20of%20synchronization.

197
Q

Future, callable, executor service.

A

https://www.digitalocean.com/community/tutorials/java-callable-future-example

https://dzone.com/articles/basics-of-using-java-future-and-executor-service

198
Q

how to optimise a query if you find out its slow?

A

https://www.thoughtspot.com/data-trends/data-modeling/optimizing-sql-queries

199
Q

S.O.L.I.D principle with examples.

A

https://www.geeksforgeeks.org/solid-principle-in-programming-understand-with-real-life-examples/

200
Q

Streams in Java

A

https://www.geeksforgeeks.org/stream-in-java/

201
Q

can we run Class in Java 1.4 which was compiled in java 1.5

A

https://stackoverflow.com/questions/1710933/will-jre-1-4-support-classes-compiled-with-java-1-5-1-6

202
Q

How to create Immutable class in Java?

A

https://www.geeksforgeeks.org/create-immutable-class-java/

203
Q

difference between Java singleton and spring singleton?

A

https://stackoverflow.com/questions/15252284/what-is-the-difference-between-a-spring-singleton-and-a-java-singeletondesign-p

204
Q

Internal Working of HashMap in Java

A

https://www.geeksforgeeks.org/internal-working-of-hashmap-java/

205
Q

Java Singleton Design Pattern

A

https://www.geeksforgeeks.org/java-singleton-design-pattern-practices-examples/

206
Q

Describe Loose Coupling and Cohesion.

A

https://stackoverflow.com/questions/14000762/what-does-low-in-coupling-and-high-in-cohesion-mean

207
Q

Benefit of using Abstract classes and Abstract methods

A

https://medium.com/@dilip.voleti/benefit-of-using-abstract-classes-and-abstract-methods-c1d0bdc74864

208
Q

If I have a list of Strings, how will I remove the duplicates from it?

A

https://pandaquests.medium.com/removing-duplicates-from-a-list-in-java-37ccfce4de6e#:~:text=To%20remove%20duplicates%20from%20a%20list%20in%20Java%2C%20you%20can,duplicates%20will%20automatically%20be%20removed.

209
Q

What is return type of Set ?

A

https://www.geeksforgeeks.org/set-in-java/#:~:text=It%20returns%20an%20integer%20value,this%20instance%20of%20the%20Set.&text=isEmpty()-,This%20method%20is%20used%20to%20check,set%20is%20empty%20or%20not.&text=This%20method%20is%20used%20to%20return%20the%20iterator%20of%20the,returned%20in%20a%20random%20order.

210
Q

Does An abstract class required to have an abstract method inside

A

https://stackoverflow.com/questions/4811678/defining-an-abstract-class-without-any-abstract-methods

211
Q

Why not serialize abstract classes in Java

A

https://stackoverflow.com/questions/4452941/why-not-serialize-abstract-classes-in-java

212
Q

The new features in Java 21

A

https://www.infoworld.com/article/3689880/jdk-21-the-new-features-in-java-21.html

213
Q

Difference Between Streams and Collections in Java

A

https://www.geeksforgeeks.org/difference-between-streams-and-collections-in-java/

214
Q

Functional Interfaces in Java

A

https://www.geeksforgeeks.org/functional-interfaces-java/#:~:text=A%20functional%20interface%20is%20an,any%20number%20of%20default%20methods.

215
Q

Static and Default Methods in Interfaces in Java

A

https://www.baeldung.com/java-static-default-methods

216
Q

Lambda Expression in Java

A

https://www.geeksforgeeks.org/lambda-expressions-java-8/

217
Q

Method References in Java

A

https://www.baeldung.com/java-method-references#:~:text=Method%20references%20are%20a%20special,Instance%20methods%20of%20particular%20objects

218
Q

Pros and Cons of using Optional Objects in Java

A

https://www.developer.com/java/java-optional-object/#:~:text=Optional%20can%20help%20to%20prevent,or%20may%20not%20be%20present.

219
Q

How to sort a Map in Java

A

https://mkyong.com/java/how-to-sort-a-map-in-java/

220
Q

Try-with-resources Feature in Java

A

https://www.geeksforgeeks.org/try-with-resources-feature-in-java/

221
Q

How to investigate the cause of a JVM crash

A

https://stackoverflow.com/questions/8152393/how-do-i-investigate-the-cause-of-a-jvm-crash

https://www.site24x7.com/learn/troubleshoot-jvm-crashes.html

222
Q

How to find server crash reasons

A

https://aloa.co/blog/why-does-a-server-crash

223
Q

How to find max memory, free memory and total memory in Java?

A

https://www.geeksforgeeks.org/find-max-memory-free-memory-total-memory-java/

224
Q

How to find out server load and memory in Linux & Windows

A

https://customer.precisely.com/s/article/How-to-find-out-server-load-and-memory-in-Linux-Windows-360041278854?language=en_US

225
Q

What is Caching and how can you implement your Cache ?

A

https://www.geeksforgeeks.org/what-is-the-caching-mechanism/

https://www.javatpoint.com/lru-cache-implementation-in-java#:~:text=A%20class%20Cache%20is%20implemented,the%20values%20for%20both%20variables.

226
Q

Difference between UNIX and Windows Operating System

A

https://www.geeksforgeeks.org/difference-between-unix-and-windows-operating-system/

227
Q

Clone a Linked List with next and Random Pointer

A

https://www.geeksforgeeks.org/a-linked-list-with-next-and-arbit-pointer/

228
Q

When programming in Java, can you have an empty catch block?

A

While you can use an empty catch block while programming in Java, it is not advised. The problem this creates involves debugging the program if the empty catch block were to catch an exception. There will not be any information about the exception. Finding the issue with no information in the log could be very time-consuming.”

229
Q

How does an OutOfMemoryError impact a program written in Java, and how can this be corrected?

A

An OutOfMemoryError is created by the JVM when there is no memory available for it to use. This will result in a program halting. The simple way to fix this is to allocate more memory to run in the java application.”

230
Q

CountDownLatch in Java

A

https://www.geeksforgeeks.org/countdownlatch-in-java/

231
Q

Difference Between Daemon Threads and User Threads In Java

A

https://www.geeksforgeeks.org/difference-between-daemon-threads-and-user-threads-in-java/#:~:text=A%20user%20thread%20can%20keep,used%20for%20any%20critical%20task.

232
Q

Static import in Java

A

https://www.geeksforgeeks.org/static-import-java/

233
Q

volatile keyword in Java

A

https://medium.com/codex/volatile-keyword-in-java-9e8792b4e6ba#:~:text=The%20volatile%20keyword%20in%20Java,value%20for%20the%20volatile%20variable.

234
Q

Main() in Java

A

https://www.geeksforgeeks.org/java-main-method-public-static-void-main-string-args/

235
Q

Methods in object class

A

https://www.geeksforgeeks.org/object-class-in-java/

236
Q

Exception hierarchy in Inheritance

A

https://www.geeksforgeeks.org/exception-handling-with-method-overriding-in-java/

237
Q

Why is checked exception also called compile time exception. Does it occur compile time?

A

https://stackoverflow.com/questions/50549579/checked-exception-is-compile-time-or-runtime#:~:text=2%20Answers&text=Checked%20exceptions%20are%20checked%20at,containing%20method%20throws%20the%20exception.

238
Q

User-defined Custom Exception in Java

A

https://www.geeksforgeeks.org/user-defined-custom-exception-in-java/

239
Q

String Constant Pool(SCP) in Java

A

https://www.geeksforgeeks.org/string-constant-pool-in-java/

240
Q

How to use Mutable class in Java

A

https://www.javatpoint.com/mutable-class-in-java

241
Q

Difference between hashset and set

A

https://stackoverflow.com/questions/5139724/whats-the-difference-between-hashset-and-set

242
Q

Difference between List, Set and Map in Java

A

https://www.geeksforgeeks.org/difference-between-list-set-and-map-in-java/

https://stackoverflow.com/questions/4131655/what-is-the-difference-between-lists-arraylists-maps-hashmaps-collections-et#:~:text=List%20in%20Java%20provides%20ordered,key%20value%20pair%20and%20hashing.

243
Q

Different ways to create objects in Java

A

https://www.geeksforgeeks.org/different-ways-create-objects-java/

244
Q

Declaring a list field with final keyword

A

https://stackoverflow.com/questions/13079365/declaring-a-list-field-with-the-final-keyword

245
Q

Create custom arrayList without allowing duplicates

A

https://youtu.be/FFfJeb8Ec6Y?si=kOIvITPxBhQ75WRJ

246
Q

Why does set not allow duplicates?

A

https://stackoverflow.com/questions/20870879/why-set-is-not-allowed-duplicate-value-which-kind-of-mechanism-used-behind-them

247
Q

Comparable vs Comparator in Java. When to use?

A

https://www.geeksforgeeks.org/comparable-vs-comparator-in-java/

248
Q

If a key is null in the HashMap then when is that entry stored in the map?

A

https://youtu.be/FFfJeb8Ec6Y?si=kOIvITPxBhQ75WRJ

249
Q

How Java 8 Helps in Improving Performance of HashMap?

A

https://www.geeksforgeeks.org/how-java-8-helps-in-improving-performance-of-hashmap/

250
Q

Tree so in Java. Internal working of tree map

A

https://www.geeksforgeeks.org/treemap-in-java/

https://www.geeksforgeeks.org/internal-working-of-treemap-in-java/

251
Q

Java Date Time API

A

https://www.baeldung.com/java-8-date-time-intro

252
Q

Compostable Future in Java

A

https://www.geeksforgeeks.org/completablefuture-in-java/

253
Q

Functional Interfaces which were there before Java8

A

https://stevenmwesigwa.com/tutorials/functional-programming-with-streams/13/functional-interfaces-before-java-8#:~:text=There%20were%20plenty%20of%20interfaces,commonly%20used%20in%20multithreaded%20applications.

254
Q

Can we extend one functional Interface from another functional Interface?

A

https://techwithmaddy.com/java-8-functional-interfaces#:~:text=It’s%20used%20to%20ensure%20that,number%20of%20Object%20class%20methods.

255
Q

Drawbacks of using Lambda expressions and closures in Java?

A

Saved on LinkedIn

256
Q

Difference Between map() And flatMap() In Java Stream

A

https://www.geeksforgeeks.org/difference-between-map-and-flatmap-in-java-stream/

257
Q

Parallel vs Sequential Stream in Java

A

https://www.geeksforgeeks.org/parallel-vs-sequential-stream-in-java/

258
Q

Future Vs CompletableFuture

A

https://stackoverflow.com/questions/54359761/future-vs-completablefuture-for-this-use-case-completablefuture-will-make-any

259
Q

How to Determine Java Thread Pool Size

A

https://dip-mazumder.medium.com/how-to-determine-java-thread-pool-size-a-comprehensive-guide-4f73a4758273#:~:text=Determining%20the%20Number%20of%20Threads%20for%20CPU%2DBound%20Tasks%3A&text=Let’s%20say%20you%20have%208,other%20tasks%20and%20system%20processes.

260
Q

What is cyclic dependency? How to get rid of it?

A

https://stackoverflow.com/questions/3646113/circular-dependency-in-java-constructors

https://stackoverflow.com/questions/55429921/how-to-fix-cyclic-dependency-between-java-modules

https://www.geeksforgeeks.org/circular-dependencies-in-spring/

261
Q

Lazy vs eager loading

A

https://www.imperva.com/learn/performance/lazy-loading/

https://stackoverflow.com/questions/31366236/lazy-loading-vs-eager-loading

262
Q

https://javasearch.buggybread.com/InterviewQuestions/questionSearch.php?searchOption=label&keyword=Cloning

A
263
Q

What is Program Counter?

A

https://www.techtarget.com/whatis/definition/program-counter