Smartavya Analytica
Harri Software Development and Solutions Interview Questions and Answers
Q1. What is the difference between the different versions of java (8, 11, 17). Tell about the new features you have worked on?
Java versions 8, 11, and 17 have introduced various new features and improvements.
Java 8 introduced lambda expressions, streams, and the new Date and Time API.
Java 11 introduced local-variable syntax for lambda parameters, HTTP client API, and Flight Recorder.
Java 17 introduced sealed classes, pattern matching for switch statements, and enhanced foreign function and memory API.
Q2. What is Springboot? difference between Spring and Springboot. What is difference between @Component and @ComponentScan
Springboot is a framework that simplifies the development of Java applications by providing pre-configured settings and conventions.
Springboot is built on top of the Spring framework, providing a more streamlined way to build Spring applications.
Springboot eliminates the need for XML configuration files and allows for easier setup of dependencies.
Difference between @Component and @ComponentScan: @Component is used to mark a class as a Spring component, while @ComponentScan is...read more
Q3. What is Dependency Injection? What are it's types (Constructor Based, Setter Based, Field Injection).
Dependency Injection is a design pattern where the dependencies of an object are provided externally rather than created within the object itself.
Types of Dependency Injection: Constructor Based, Setter Based, Field Injection
Constructor Based: Dependencies are provided through the constructor of the class
Setter Based: Dependencies are provided through setter methods
Field Injection: Dependencies are directly assigned to fields of the class
Q4. Garbage Collection in Java? what is the process of GC? how can we explicitly invoke Garbage Collector?
Garbage Collection in Java is the process of automatically reclaiming memory by destroying unused objects.
Garbage Collection is a process in Java where the JVM automatically reclaims memory by destroying objects that are no longer referenced.
The process of GC involves marking objects that are still in use, sweeping and deleting objects that are no longer in use, and compacting the memory to reduce fragmentation.
We can explicitly invoke Garbage Collector in Java using System.g...read more
Q5. How Constructor or Setter based injection is used in the traditional Spring framework?
Constructor or Setter based injection is used in Spring framework to inject dependencies into a bean.
Constructor injection involves passing dependencies as arguments to the constructor of a class.
Setter injection involves setting dependencies using setter methods.
Constructor injection is preferred for mandatory dependencies, while setter injection is used for optional dependencies.
Example: Constructor injection - public class MyClass { private Dependency dependency; public My...read more
Q6. What is meta space and how it is improved in Java 11?
Meta space is a memory space in Java that stores metadata about classes and methods.
Meta space replaces the permanent generation in Java 8 and earlier versions.
In Java 11, meta space is improved by introducing a new flag called 'UseContainerSupport' which allows the JVM to use container-specific memory limits.
This improvement helps in better managing memory usage in containerized environments.
Interview Process at Harri Software Development and Solutions
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month