Sterlite Technologies
Sony Interview Questions and Answers
Q1. What is Singleton Design Pattern? Can we create a clone of an object from singleton class?
Singleton Design Pattern ensures only one instance of a class exists. No, we cannot create a clone of an object from singleton class.
Singleton pattern restricts the instantiation of a class to one object.
It is used when only one object is required to coordinate actions across the system.
The instance is created only when it is requested for the first time.
The constructor of the singleton class is private.
Clone method is not supported in singleton pattern.
Q2. Version of Java and Spring boot you are using in your current project?
We are using Java 11 and Spring Boot 2.4.3 in our current project.
Java 11 provides better performance and security features compared to previous versions.
Spring Boot 2.4.3 offers improved support for Kotlin and GraalVM.
We are also using Spring Data JPA for database access and Spring Security for authentication and authorization.
Q3. What is Maven ? what are different cycles in Maven
Maven is a build automation tool used primarily for Java projects. It manages dependencies and builds the project.
Maven is based on the concept of POM (Project Object Model) which describes the project dependencies, build process, and other configurations.
Maven has different cycles such as validate, compile, test, package, verify, install, and deploy.
The validate cycle checks if the project is correct and all necessary information is available.
The compile cycle compiles the s...read more
Q4. What are triggers?What are stored procedures?
Triggers are database objects that automatically execute in response to certain events. Stored procedures are precompiled SQL statements.
Triggers are used to enforce business rules or to audit changes to data.
Stored procedures are used to encapsulate frequently used SQL statements for reuse and to improve performance.
Triggers can be used to update related tables when a record is inserted, updated, or deleted.
Stored procedures can be used to perform complex data manipulations ...read more
Q5. Write a Program for reverse sort of keys in HashMap.
Program to reverse sort keys in HashMap
Create a List from the keySet() of the HashMap
Sort the List in reverse order using Collections.sort()
Iterate through the sorted List and add the keys to a new LinkedHashMap
Return the LinkedHashMap
Q6. various Springboot Annotations.
Springboot annotations are used to simplify the development process and provide additional functionality.
Annotations like @RestController and @RequestMapping are used to create RESTful web services.
@Autowired is used for dependency injection.
@Transactional is used to manage transactions.
@Component is used to mark a class as a Spring component.
@Value is used to inject values from properties files or environment variables.
@Scheduled is used to schedule tasks to run at specific ...read more
Q7. joins in SQL
Joins in SQL are used to combine data from two or more tables based on a related column.
Joins are used to retrieve data from multiple tables in a single query
Types of joins include inner join, left join, right join, and full outer join
Join conditions are specified using the ON keyword and can include multiple conditions
Aliases can be used to simplify the syntax of join queries
Top Senior Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month