Deutsche Telekom Digital Labs
10+ Amines & Plasticizers Interview Questions and Answers
Q1. Multithreading- Write program to print even and odd numbers from 1 to 20 using 2 threads. 1 thread will responsible for printing even and another for Odd. And print in such a manner it should be alternate. (can...
read moreProgram to print even and odd numbers from 1 to 20 using 2 threads alternately.
Create two threads, one for printing even numbers and one for printing odd numbers.
Use wait(), notify(), and notifyAll() to ensure alternate printing.
Ensure synchronization between the two threads to avoid race conditions.
Example: Thread 1 prints even numbers (2, 4, 6, ...) and Thread 2 prints odd numbers (1, 3, 5, ...).
Q2. What is the purpose of using default methods in java8?
Default methods in Java 8 allow interfaces to have method implementations, enabling backward compatibility and reducing code duplication.
Default methods were introduced in Java 8 to provide a way to add new methods to interfaces without breaking existing implementations.
They allow interfaces to have method implementations, which was not possible before Java 8.
Default methods can be overridden in implementing classes to provide specific implementations.
They help in reducing co...read more
Q3. How microservices communicate with each other
Microservices communicate with each other through APIs, messaging queues, or service meshes.
APIs: Microservices can communicate with each other by exposing APIs that allow them to send and receive data.
Messaging queues: Microservices can use messaging queues like RabbitMQ or Kafka to send messages to each other asynchronously.
Service meshes: Microservices can communicate through a service mesh like Istio, which handles communication, security, and monitoring between services.
Q4. Gave one scenario to solve using streams in java8
Using streams in Java 8 to filter and map a list of numbers
Create a list of numbers
Use stream to filter out even numbers
Use map to square each number
Collect the results into a new list
Q5. Complete flow and business use case of the project
The project involves creating a web-based platform for online shopping with features like user registration, product browsing, shopping cart, and payment processing.
User registers on the platform with personal information
User browses products by category or search
User adds products to the shopping cart
User proceeds to checkout and makes payment
Order is confirmed and user receives a confirmation email
Q6. Purpose of @SpringBootApplication annotation?
Annotation used to mark a class as a Spring Boot application
Combines @Configuration, @EnableAutoConfiguration, and @ComponentScan annotations
Used to bootstrap and launch a Spring application
Automatically scans for Spring components in the package and sub-packages
Q7. what are microservices?
Microservices are a software development technique where an application is composed of small, independent services that communicate with each other.
Microservices are designed to be small, focused on specific tasks, and independently deployable.
Each microservice typically runs its own process and communicates with other services through APIs.
Microservices allow for easier scalability, flexibility, and maintenance compared to monolithic architectures.
Examples of companies using...read more
Q8. Design a custom recyclerview with appropriate data structures
Custom recyclerview with appropriate data structures
Create a custom adapter extending RecyclerView.Adapter
Implement onCreateViewHolder() and onBindViewHolder() methods
Use appropriate data structures like ArrayList or HashMap for efficient data handling
Implement onClickListener for item clicks
Use ViewHolder pattern for efficient view recycling
Q9. Why strings immutable
Strings are immutable to ensure data integrity and security.
Immutable strings prevent accidental changes to data
Immutable strings allow for safe sharing of data between different parts of a program
Immutable strings help prevent security vulnerabilities like SQL injection attacks
Q10. what are checked exceptions
Checked exceptions are exceptions that must be either caught or declared in the method signature.
Checked exceptions are subclasses of Exception (excluding RuntimeException and its subclasses)
Checked exceptions must be either caught using try-catch block or declared in the method signature using 'throws' keyword
Examples of checked exceptions in Java include IOException, SQLException, and ClassNotFoundException
Q11. Difference between static and final
Static is used to define class-level variables and methods, while final is used to define constants that cannot be changed.
Static variables belong to the class itself, while final variables are constants that cannot be modified.
Static methods can be called without creating an instance of the class, while final methods cannot be overridden.
Static variables are shared among all instances of a class, while final variables have the same value for all instances.
Example: 'static in...read more
Q12. Describe Java8 Features
Java8 introduced several new features including lambda expressions, functional interfaces, streams, and default methods.
Lambda expressions allow you to write code in a more concise and readable way.
Functional interfaces are interfaces with a single abstract method, which can be implemented using lambda expressions.
Streams provide a way to work with collections of objects in a functional style.
Default methods allow interfaces to have methods with implementations.
Other features...read more
Q13. ArraysList vs LinkedList
ArrayList is better for random access, LinkedList is better for frequent insertions/deletions.
ArrayList uses dynamic array to store elements, LinkedList uses doubly linked list.
ArrayList provides fast random access to elements using index, LinkedList provides fast insertion/deletion at any position.
Example: ArrayList is suitable for scenarios where random access is required like searching, LinkedList is suitable for scenarios where frequent insertions/deletions are needed lik...read more
Q14. 1 Java8 streams problem
Using Java8 streams to solve a problem
Use stream() method to convert a collection into a stream
Use filter() method to filter elements based on a condition
Use map() method to transform elements
Use collect() method to collect the elements into a new collection
Q15. Design a hashmap, and optimise it
Design and optimize a hashmap
Choose a good hash function to minimize collisions
Implement dynamic resizing to handle increasing load factor
Consider using open addressing or separate chaining for collision resolution
Use an efficient data structure for storing key-value pairs, such as an array or linked list
Q16. Use of @Qualifier
Annotation used in Spring to specify which bean to autowire
Used to disambiguate when multiple beans of the same type are present
Can be used with @Autowired to specify which bean to inject
Helps in resolving dependencies when multiple beans of the same type are available
Q17. Reverse a linked list
Reverse a linked list by changing the next pointers of each node
Iterate through the linked list and change the next pointers to reverse the list
Use three pointers - prev, current, and next to keep track of nodes
Example: 1 -> 2 -> 3 -> 4 -> null, after reversing: 4 -> 3 -> 2 -> 1 -> null
Q18. Minimum element in an array
Find the minimum element in an array of strings
Iterate through the array and compare each element to find the minimum
Use built-in functions like Math.min() or sort() to find the minimum
Handle edge cases like empty array or array with only one element
Interview Process at Amines & Plasticizers
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month