Intersection of two Linked Lists in Java

2 years ago Lalit Bhagtani 0
Intersection of two Linked Lists in Java :-  You have given two linked list, create a linked list containing elements that are same in both linked list excluding duplicates. i.e. create intersection of two given linked list. Order of elements in new linked list does not matter. You can see union here, Union of two Read More

How to read and write JSON in Java using org.json

2 years ago Lalit Bhagtani 1
How to read and write JSON in Java :- If you had worked on restful web services, then you would have faced a problem of reading and writing JSON in java. JSON stands for JavaScript Object Notation, it is language independent, easy to understand, lightweight data-interchange format.  Let’s see how to read and write JSON in java Read More

How to parse JSON in Java using fasterXML / jackson-databind lib

2 years ago Lalit Bhagtani 0
How to parse JSON in Java :- If you had worked on restful web services, then you would have faced a problem of parsing JSON in java. JSON stands for JavaScript Object Notation, it is language independent, easy to understand, lightweight data-interchange format. JSON is a text only format, So to use it in Java, we Read More

Union of two Linked Lists in Java

2 years ago Lalit Bhagtani 0
Union of two Linked Lists in Java :-  You have given two linked list, create a linked list containing all the elements of the given two linked list excluding duplicates. i.e. create union of two given linked list. Order of elements in new linked list does not matter. You can see intersection here, Intersection of two Read More

100 People in a Circle Puzzle (Interview Puzzle)

2 years ago Lalit Bhagtani 0
100 People in a Circle Puzzle :- There are 100 people standing in a circle. Person standing at 1st position kills next person ( i.e. the person standing at 2nd position ) and gives sword to next to next person ( i.e. the person standing at 3rd position ). Which person survives in the last Read More

Red and Blue Marbles Puzzle (Interview Puzzle)

2 years ago Lalit Bhagtani 0
Red and Blue Marbles Puzzle :- You have given 50 red marbles, 50 blue marbles and two empty jars. You have to put all the 100 marbles into the jars, such that when you randomly pick one marble from any of the jar, probability of it’s being a red color marble is maximum. How will you do Read More

Genie with C Hats Puzzle (Interview Puzzle)

2 years ago Lalit Bhagtani 0
Genie with C Hats Puzzle :- There are N number of men and one genie on a deserted island, A genie gathers all the men and put the hat on C number of men’s head, such that one man has only one hat on his head. The hat has some magical powers, hat cannot be seen by Read More

25 Horses 5 Tracks Puzzle (Interview Puzzle)

2 years ago Lalit Bhagtani 0
25 Horses 5 Tracks Puzzle :- You have given one horse race track and 25 horses. In one race, only(maximum) 5 horses can run together. What is the minimum number of races that are required to find 3 fastest horses? Now try to solve this on your own… Solution of 25 Horses 5 Tracks Puzzle Read More

Removing Timezone from XMLGregorianCalendar

2 years ago Lalit Bhagtani 0
If you had worked on a project which consume or publish web services, then you would have faced a problem with date (XMLGregorianCalendar) object, where you would like to send only date string as yyyy-MM-dd but complete yyyy-MM-dd’T’HH:mm:ss’Z’ has been sent. This date string contains date, time and timezone information, if you like to send Read More

RabbitMQ Exchange Types, Bindings and Routing Keys

2 years ago Lalit Bhagtani 0
Exchanges are message routing agents, which are defined per virtual host within the rabbitMQ system. When program/application (Known as Producer) connect to RabbitMQ server to publish a message, it first sends the message to an exchange. After receiving a message, exchange routes them to different message queues with help of header attributes, bindings, and routing keys. It should be noted that messages Read More