Add office photos
Employer?
Claim Account for FREE

Pinesucceed Technologies

2.9
based on 8 Reviews
Filter interviews by

Larsen & Toubro Limited Interview Questions and Answers

Updated 9 Oct 2024

Q1. Explain association, aggregation and composition.

Ans.

Association, aggregation, and composition are types of relationships between classes in object-oriented programming.

  • Association is a relationship where two classes are related in some way, but not dependent on each other. Example: a student and a teacher.

  • Aggregation is a type of association where one class contains a reference to another class, but the referenced class can exist independently. Example: a car has an engine.

  • Composition is a type of aggregation where one class c...read more

Add your answer

Q2. Find a number in a rotated sorted array

Ans.

Use binary search to find the target number in a rotated sorted array.

  • Use binary search to find the pivot point where the array is rotated.

  • Determine which half of the array the target number lies in based on the pivot point.

  • Continue binary search in the appropriate half of the array to find the target number.

Add your answer

Q3. Print the left view of tree

Ans.

Printing the left view of a tree involves printing the leftmost nodes at each level of the tree.

  • Traverse the tree using a level order traversal (BFS)

  • At each level, print the first node encountered

  • Repeat for each level until all nodes are visited

Add your answer

Q4. Diff bw put and post mapping

Ans.

PUT is used to update or replace an existing resource, while POST is used to create a new resource.

  • PUT is idempotent, meaning multiple identical requests will have the same effect as a single request.

  • POST is not idempotent, meaning multiple identical requests may have different effects.

  • PUT is typically used for updating an existing resource, like updating a user's information.

  • POST is typically used for creating a new resource, like adding a new user to a database.

Add your answer
Discover Larsen & Toubro Limited interview dos and don'ts from real experiences

Q5. Explain functional interface

Ans.

Functional interface is an interface with only one abstract method, used for lambda expressions.

  • Functional interfaces can have multiple default or static methods, but only one abstract method.

  • They are used for lambda expressions and method references in Java.

  • Examples of functional interfaces in Java include Runnable, Callable, and Comparator.

Add your answer

Q6. Internal working of hashmap

Ans.

HashMap is a data structure that stores key-value pairs and uses hashing to efficiently retrieve values.

  • HashMap internally uses an array of linked lists to store key-value pairs.

  • When a key-value pair is added, the key is hashed to determine the index in the array where it will be stored.

  • If multiple keys hash to the same index, a linked list is used to handle collisions.

  • To retrieve a value, the key is hashed again to find the index and then the linked list is traversed to find...read more

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
 • 171 Interview Questions
3.9
 • 45 Interview Questions
3.8
 • 28 Interview Questions
3.9
 • 20 Interview Questions
4.0
 • 14 Interview Questions
4.4
 • 11 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