#interviewPreparation

Function Interface

The java.util.function.Function interface stands as one of the valuable functional interfaces (an interface that contains only one abstract method). It is a key component of the Java 8 functional programming API. It  provides a way to define and manipulate functions in Java code. Why Function Interface? You can use the function interface to create new functions or […]

Function Interface Read More »

Observer design pattern

In Java, the Observer pattern establishes a one-to-many dependency relationship among objects. As name suggest, we have 2 object: observer (there can be multiple observer) and observable. When an observable object changes its state, all registered observers are notified and updated automatically. This design promotes loose coupling, contributing to code maintainability and flexibility. Benefits The

Observer design pattern Read More »

Multithreading and Synchronization

Welcome to our comprehensive guide on Multithreading and Synchronization! In this page, we will delve into the fascinating world of concurrent programming and explore the essential concepts, techniques, and best practices for effectively managing multiple threads in your applications. Multithreading is a powerful paradigm that allows programs to execute multiple tasks concurrently, thereby utilizing the

Multithreading and Synchronization Read More »

Semaphore Class

A semaphore controls access to a shared resource through the use of a counter. What the counter is counting are permits that allow access to the shared resource. Thus, to access the resource, a thread must be granted a permit from the semaphore. Synchronized allows only one thread of execution to access the resource at the same time. Semaphore

Semaphore Class Read More »

Fork/Join Framework

Java 7 introduced the fork/join framework. It is among the simplest and most effective design techniques for obtaining good parallel performance. Fork/join algorithms are parallel versions of familiar divide−and−conquer algorithms. The fork operation starts a new parallel fork/join subtask. The join operation causes the current task not to proceed until the forked subtask has completed.

Fork/Join Framework Read More »

MultiThreading

When we create an application, we write lines of code and logic is also correct. But still we wonder that our application is not upto the mark. One important factor that plays a vital role in any application development is its Performance.However the performance of an app is not only related to the number of

MultiThreading Read More »

Microservices

41. What is the role of web and RESTful APIs in Microservices?A microservice architecture is based on a concept wherein all its services should be able to interact with each other to build a business functionality. So, to achieve this, each microservice must have an interface. This makes the web API a very important enabler

Microservices Read More »

Microservices

31. How to maintain ACID transactions in Microservices?ACID is an acronym for four primary attributes namely atomicity, consistency, isolation, and durability ensured by the database transaction manager.  In a distributed system involving multiple databases, we have two options to achieve ACID compliance:  2 Phase Commit should ideally be discouraged in microservices architecture due to its

Microservices Read More »

Microservices

21. What are the important patterns for orchestrating Microservices architecture? As we start to model more and more complex logic, we have to deal with the problem of managing business processes that stretch across the boundary of individual services. 22. What is referred to as Serverless?Serverless refers to a model where the existence of servers is

Microservices Read More »

Microservices

11. How can we test the Microservices based architecture?One should have unit and integration tests where all the functionality of a microservice can be tested. One should also have component based testing.One should have contract tests to assert that the expectations by the client is not breaking. End-to-end test for the microservices, however, should only

Microservices Read More »

Scroll to Top