Remove Nth Node from Linked List Remove 3rd node from below list Input Anbu -> Arul -> Arasu-> Bharath-> Catherine -> Davidson Output Anbu -> Arul -> Bharath-> Catherine -> Davidson Idea: Traverse to the Kth Position and point the reference of temp to one next to it. We need to handle one edge case […]

Reverse a Linked List Input 1 -> 2 -> 3 -> 4 -> 5 -> NULL Output 5 -> 4 -> 3 -> 2 -> 1 -> NULL Idea1: Using bruteforce copy the list in to Array and traverse the array backward and create new node Idea2: Use 3 Variables. Prev, Curr, Temp and traverse […]

Linked List is made of combination of Node The smallest unit of linked list is Node Node contains two things the content of the node And reference to next node If a linked list has only one element then it would have only one node Node.java To traverse linked list we should always start at […]

Smoke Testing vs Load Testing vs Stress Testing vs Spike Testing vs Soak Testing Smoke Testing: A preliminary test to ensure the most important functions of an application work correctly. The term originated in hardware and electronics: engineers would power on a new circuit or device, and if it literally started smoking, they knew something […]

Below Script sends GET request once. It creates a single Virtual User(VU) and sends the get request. k6 run test.js To make the same script run for a duration. In this case the number of iterations varies based on how fast the request is completed based on keeping user constant 1(VU). k6 run test.js –duration […]

Simple Shedlock Code pom.xml ShedLockConfig.java ShedlockDemoApplication.java PostFetchScheduler.java fetchPosts method is called every minute How to run the code Shedlock table should be created manually in database Start multiple instance by supplying server.port and instance name as parameter First instance would create table in DB for posts for code in repo Output FAQ Why we are […]

Why to use Liquibase? Liquibase simplifies – Database Version Control and Automation of Database Migrations pom.xml Simple Liquibase Script Example? db.changelog-master.xml 1-createtable-changeset.xml Does the whole script runs everytime in liquibase? No. liquibase does not run the whole script all the time. liquibase maintains a databasechangelog table internally. This table keeps track of the new scripts […]

Why Shedlock? Shedlock prevents concurrent execution of scheduled tasks in distributed systems. In a server where multiple instance of same JAR running, shedlock prevents simultaneous execution of task by different instance at the same time. By this shedlock prevents race conditions and prevents multiple nodes from executing the same task simultaneously, which can lead to […]

Spring Batch Architecture Simple Spring Batch Application Item Reader and Item Writer Spring Batch Reading and Writing to REST Endpoints Triggering Spring Batch Job using REST Endpoints Fault Tolerance and Error Handling Data Migration using Spring Batch