Add office photos
Engaged Employer

Synechron

3.6
based on 2.7k Reviews
Filter interviews by

Taxspanner Interview Questions and Answers

Updated 12 Dec 2024
Popular Designations

Q1. find sum of all odd numbers in a list using stream?

Ans.

Using Java stream, find the sum of all odd numbers in a list.

  • Use the filter() method to filter out the odd numbers from the list.

  • Use the mapToInt() method to convert the filtered numbers to integers.

  • Use the sum() method to calculate the sum of the filtered odd numbers.

View 1 answer

Q2. how to remove duplicated form from array list?

Ans.

To remove duplicates from an ArrayList of strings, use a HashSet to store unique elements.

  • Create a HashSet and add all elements from the ArrayList to it.

  • Create a new ArrayList and add all elements from the HashSet to it.

  • The new ArrayList will contain only unique elements.

View 3 more answers

Q3. how hashset and hashmap work internally?

Ans.

HashSet and HashMap are both data structures in Java that use hashing to store and retrieve elements.

  • HashSet uses HashMap internally to store its elements as keys with a dummy value.

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

  • Both HashSet and HashMap use the hashCode() method to calculate the hash value of keys.

  • HashSet uses the hash value to determine the bucket where an element should be stored.

  • HashMap uses the hash value to determine the bu...read more

View 1 answer

Q4. What is checked unchecked exceptions?

Ans.

Checked exceptions are exceptions that must be declared in a method's signature or handled using try-catch blocks.

  • Checked exceptions are checked at compile-time.

  • They are typically used for exceptional conditions that can be reasonably recovered from.

  • Examples of checked exceptions in Java include IOException, SQLException, and ClassNotFoundException.

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

Q5. How many types of lock are there in java and how to achieve multithreading.

Ans.

There are two types of locks in Java - synchronized and ReentrantLock. Multithreading can be achieved by using these locks.

  • Two types of locks in Java are synchronized and ReentrantLock

  • Synchronized keyword can be used to achieve synchronization in Java

  • ReentrantLock provides more flexibility and control over locking mechanisms

  • Example: synchronized block - synchronized(obj) { // code }

  • Example: ReentrantLock - ReentrantLock lock = new ReentrantLock(); lock.lock(); // code; lock.u...read more

Add your answer

Q6. Write code for producer , consumer in java.

Ans.

Producer-consumer problem is a classic synchronization problem in multithreading.

  • Use wait() and notify() methods for synchronization

  • Create a shared buffer to store data between producer and consumer

  • Ensure proper handling of synchronization to avoid race conditions

Add your answer

Q7. what is mean by singlton

Ans.

Singleton is a design pattern in Java where a class is restricted to have only one instance.

  • Singleton pattern ensures that a class has only one instance and provides a global point of access to it.

  • It is commonly used in scenarios where a single instance of a class is required to control actions throughout a system.

  • Example: Database connection classes, Logger classes, Configuration classes.

Add your answer

Q8. Class vs object

Ans.

A class is a blueprint or template for creating objects, while an object is an instance of a class.

  • A class defines the properties and behaviors of objects, while an object is a specific instance of a class.

  • Classes can be used to create multiple objects with similar characteristics.

  • Objects have state (attributes) and behavior (methods) defined by the class.

  • Example: Class 'Car' defines properties like 'color' and 'model', while an object 'myCar' can have specific values for the...read more

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Taxspanner

based on 5 interviews in the last 1 year
1 Interview rounds
Technical Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Java Developer Interview Questions from Similar Companies

3.7
 • 39 Interview Questions
3.0
 • 24 Interview Questions
3.8
 • 21 Interview Questions
4.4
 • 11 Interview Questions
3.3
 • 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