HCLTech
VTS Group Interview Questions and Answers
Q1. What are the features of Java 17, specifically related to sealed classes, including their syntax and necessity, along with the potential errors encountered when invoking a sealed class?
Java 17 introduces sealed classes to restrict inheritance and improve code maintainability.
Sealed classes are declared using the 'sealed' keyword followed by the permitted subclasses.
Subclasses of a sealed class must be either final or sealed themselves.
Errors may occur when trying to extend a sealed class with a non-permitted subclass.
Q2. Draw low level design of implementation of notify me if item is back in stock in a ecommerce application
Implementation of 'notify me if item is back in stock' feature in an ecommerce application
Create a database table to store user notifications for out-of-stock items
Implement a service to check item availability and send notifications to subscribed users
Provide a user interface for users to subscribe to notifications for specific items
Q3. What are solid principles
SOLID principles are a set of five design principles to make software more maintainable, scalable, and flexible.
S - Single Responsibility Principle: A class should have only one reason to change.
O - Open-Closed Principle: Software entities should be open for extension but closed for modification.
L - Liskov Substitution Principle: Subtypes must be substitutable for their base types.
I - Interface Segregation Principle: A client should not be forced to implement interfaces they ...read more
Q4. Tell about Java 8 features
Java 8 introduced several new features including lambda expressions, streams, and default methods.
Lambda expressions allow for functional programming and simplify code.
Streams provide a way to process collections of data in a functional way.
Default methods allow for adding new methods to interfaces without breaking existing implementations.
Other features include the Date and Time API, Nashorn JavaScript engine, and improved security.
Java 8 also introduced the concept of Optio...read more
Q5. Spring vs spring boot framework
Spring is a framework that provides comprehensive infrastructure support, while Spring Boot is a tool that simplifies Spring application development.
Spring is a comprehensive framework that provides various modules for different functionalities like Spring MVC, Spring Security, Spring Data, etc.
Spring Boot is a tool that simplifies the setup and configuration of Spring applications by providing defaults and auto-configuration.
Spring Boot reduces the need for manual configurat...read more
Q6. Abstract class vs interface
Abstract class is a class that can have abstract methods and concrete methods, while interface is a contract that defines methods that a class must implement.
Abstract class can have constructors, member variables, and non-abstract methods.
Interface can only have abstract methods and constants.
A class can implement multiple interfaces but can only extend one abstract class.
Example: Abstract class - Animal with abstract method 'eat' and concrete method 'sleep'. Interface - Flya...read more
Interview Process at VTS Group
Top Senior Java Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month