Add office photos
Engaged Employer

Larsen & Toubro Limited

4.0
based on 17.7k Reviews
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by

TechSpectra Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. OOPS Concepts of java and how we have implemented in the respective projects?

Ans.

OOPS concepts are fundamental to Java programming. They are used in various projects to achieve code reusability and maintainability.

  • Encapsulation: Used to hide implementation details and protect data integrity.

  • Inheritance: Used to create a new class from an existing class, inheriting its properties and methods.

  • Polymorphism: Used to perform a single action in different ways, such as method overloading and overriding.

  • Abstraction: Used to provide a simplified view of complex sy...read more

Add your answer

Q2. What are sql joins and what are different kinds of joins?

Ans.

SQL joins are used to combine data from two or more tables based on a related column.

  • Inner join returns only the matching rows from both tables

  • Left join returns all rows from the left table and matching rows from the right table

  • Right join returns all rows from the right table and matching rows from the left table

  • Full outer join returns all rows from both tables

  • Cross join returns the Cartesian product of both tables

Add your answer

Q3. How spring framework has been implemented in your project ?

Ans.

Spring framework was used extensively in the project for dependency injection and MVC architecture.

  • Used Spring Boot for easy setup and configuration

  • Implemented Spring Security for authentication and authorization

  • Utilized Spring Data JPA for database operations

  • Used Spring MVC for handling HTTP requests and responses

  • Implemented Spring AOP for logging and exception handling

Add your answer

Q4. How map tables in the database with using hibernate orm?

Ans.

Hibernate ORM maps tables in database using annotations or XML files.

  • Use @Entity annotation to map a class to a table

  • Use @Table annotation to specify the table name

  • Use @Column annotation to map a field to a column

  • Use @Id annotation to specify the primary key

  • Use @GeneratedValue annotation to specify the generation strategy for primary key

  • Use XML files for mapping if annotations are not preferred

Add your answer
Discover TechSpectra interview dos and don'ts from real experiences

Q5. What is difference between error and exception?

Ans.

Errors are unrecoverable, while exceptions can be handled.

  • Errors are caused by the environment or JVM, while exceptions are caused by the application code.

  • Errors cannot be handled, while exceptions can be caught and handled using try-catch blocks.

  • Examples of errors include OutOfMemoryError and StackOverflowError, while examples of exceptions include NullPointerException and ArrayIndexOutOfBoundsException.

Add your answer

Q6. How to create connection pool using?

Ans.

Connection pool can be created using libraries like Apache DBCP or HikariCP.

  • Choose a connection pool library based on your requirements.

  • Configure the pool size, maximum connections, and other settings.

  • Create a data source object and set the connection pool properties.

  • Use the data source object to get connections from the pool.

  • Close the connections after use to return them to the pool.

Add your answer

Q7. Explain Spring boot flow

Ans.

Spring Boot is a framework that simplifies the development of Java applications by providing pre-configured templates and dependencies.

  • Spring Boot uses an embedded server to run the application

  • It provides auto-configuration of dependencies

  • It uses annotations to configure the application

  • It supports various data sources and web frameworks

  • It simplifies the deployment process

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Java Developer Interview Questions from Similar Companies

3.7
 • 165 Interview Questions
3.8
 • 32 Interview Questions
3.5
 • 16 Interview Questions
3.5
 • 13 Interview Questions
3.9
 • 13 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter