Add office photos
Engaged Employer

Synechron

3.6
based on 2.7k Reviews
Filter interviews by

Trooman Technologies Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. How do you convert list to arraylist? And vice versa

Ans.

To convert list to arraylist, use ArrayList constructor. To convert arraylist to list, use List constructor.

  • To convert list to arraylist, use ArrayList constructor and pass the list as parameter.

  • To convert arraylist to list, use List constructor and pass the arraylist as parameter.

  • Example: List list = Arrays.asList("one", "two", "three");

  • ArrayList arrayList = new ArrayList<>(list);

  • Example: ArrayList arrayList = new ArrayList<>(Arrays.asList("one", "two", "three"));

  • List list =...read more

Add your answer

Q2. What are functional interfaces? What is the need to have functional interfaces?

Ans.

Functional interfaces are interfaces with only one abstract method. They are used for lambda expressions and method references.

  • Functional interfaces are used for functional programming in Java.

  • They are used for lambda expressions and method references.

  • They have only one abstract method.

  • Examples of functional interfaces are Runnable, Callable, and Comparator.

  • Functional interfaces can be annotated with @FunctionalInterface to ensure they have only one abstract method.

Add your answer

Q3. How do you handle exceptions in Rest APIs

Ans.

Exceptions in Rest APIs are handled using try-catch blocks and appropriate error responses.

  • Use try-catch blocks to catch exceptions that may occur during API execution.

  • Handle different types of exceptions separately to provide specific error responses.

  • Return appropriate HTTP status codes and error messages in the response.

  • Log the exception details for debugging purposes.

  • Consider using a global exception handler to centralize exception handling logic.

View 1 answer

Q4. What is the highest limit of Hashmap?

Ans.

The highest limit of HashMap is Integer.MAX_VALUE, which is 2^31 - 1.

  • The highest limit is determined by the maximum capacity of an array in Java, which is Integer.MAX_VALUE.

  • The default initial capacity of a HashMap is 16, and it automatically increases its capacity as needed.

  • If the number of elements exceeds the maximum capacity, an OutOfMemoryError will be thrown.

View 1 answer
Discover Trooman Technologies interview dos and don'ts from real experiences

Q5. What are streams in Java and why are they used?

Ans.

Streams in Java are a sequence of elements that can be processed in parallel or sequentially.

  • Streams are used to perform operations on collections of data in a concise and functional way.

  • They can be used to filter, map, reduce, and sort data.

  • Streams can be processed in parallel to improve performance.

  • Examples of stream methods include filter(), map(), reduce(), and sorted().

Add your answer

Q6. Run time polymorphism vs compile time polymorphism

Ans.

Run time polymorphism is method overriding while compile time polymorphism is method overloading.

  • Compile time polymorphism is resolved at compile time while run time polymorphism is resolved at runtime.

  • Method overloading is an example of compile time polymorphism while method overriding is an example of run time polymorphism.

  • Compile time polymorphism is faster than run time polymorphism as it is resolved at compile time.

  • Run time polymorphism is achieved through inheritance an...read more

Add your answer

Q7. Internal working of HashMap

Ans.

HashMap is a data structure that stores key-value pairs and provides constant time complexity for basic operations.

  • HashMap uses hashing to store and retrieve elements

  • It allows null values and only one null key

  • Collisions are resolved using separate chaining or open addressing

  • The initial capacity and load factor can be specified during initialization

  • The size of the HashMap is dynamically increased as elements are added

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 Software Developer Interview Questions from Similar Companies

3.5
 • 12 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