Design Patterns

7 years ago Lalit Bhagtani 0
Design Patterns in Java :- A design patterns is a well described solution to a common software problem. It provides standard approach to solve problems which provide re-usability and maintainability to code. This makes code easy to understand and debug. Gang of Four (GOF) In 1994, four authors Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides Read More

Interview Puzzles

7 years ago Lalit Bhagtani 0
Interview Puzzles and logical questions are very important part of any selection process for a job interview. This series is written to help those guys who are preparing for the job interview. The puzzle is explained first and then the optimal solution for that puzzle is given. It is highly recommended that you try to Read More

Intersection of two Linked Lists in Java

7 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

7 years ago Lalit Bhagtani 0
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

7 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

7 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)

7 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)

7 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)

7 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)

7 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