Source Code

Source code are the collections of coding interview questions and their source code. Click the title you are interested, you will find the download link of the source code. Cannot find what you want? Please check out my github and my Java coding book.


Build hierarchy tree java

Build hierarchy tree – Code

Build hierarchy tree reads employee data and build a corporation hierarchy tree from the list. HashMap plays important role to ...
Read More
web scrape

Web scrape and parsing in Java (5 Ways)

Internet is the great resource to get information, for study, business or hobby. There are many ways of information retrieval ...
Read More
suggested friends

Get suggested friends (2 solutions) – code

When you are asked to design the data structures for social network, normally the answer is graph. In the graph, ...
Read More
combinations of operators and parentheses

Combinations of adding operators and parentheses

DFS (Depth first search) with memoization has been introduced in the post of word break using memoization. It uses one ...
Read More
find least common set

Find Least common set with union find – code

When we have number of sets, and need to group them into joint and disjoint-sets, union–find is the algorithm to ...
Read More
spell autocorrector

Spell autocorrect with edit distance – Code

Google provides a powerful spell correct for validating the keywords we type into the input text box. It checks against ...
Read More
DFS and adjacent matrix

Depth first search and matrix – Code

Depth first search (DFS) is an algorithm to traverse each element in the data structure. It starts from the source ...
Read More
royal succession order

Monarchy succession order – code

Monarchy succession order is also known as The line of succession to the British throne. The succession to the British ...
Read More
detect graph cycle

Detect cycle in graph and convert graph to tree – code

A graph is a data structure that consists of a set of vertices (aka nodes) connected by edges. A graph ...
Read More
shortest path using Dijkstra java

Shortest path and 2nd shortest path using Dijkstra – code

What is Dijkstra's algorithm? Dijkstra's algorithm is an algorithm to find the shortest paths between vertices in a graph. It ...
Read More


Comments are closed