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.


autocorrect java

Autocorrect with trie and edit distance in Java

Google provides a powerful autocorrect for validating the keywords we type into the input text box. It checks against a ...
Read More
web scraping feature

Java web scraping setup – Jsoup and selenium

Web scraping is a great way to retrieve data and save the information. with a simple Java web scraping setup, ...
Read More
trending topics past hours

Find trending topics in stream – code

This post is about how to find trending topics that were talked about most in twitter or facebook in past ...
Read More
delete files older than n days

Clean directories using recursion – code

Delete files older than n days and remove the empty directories after the files are deleted. This can be done ...
Read More
sort squares

Sort squares of a sorted array in one pass

To sort squares of a sorted array, you don't want to use any sorting algorithms such as bubble sort. Because ...
Read More
find random not in array

Find random number not in array – code

Find random number not in array is a tricky question. It is pretty straight forward to find a random element ...
Read More
Find x not in array

Find possible number not in array sum to target

In array, there are frequently asked questions "Two sum", "three sum", "find subarray with given sum". Here is a target ...
Read More
possible expressions

Possible ways to add operators and parentheses

Given a set of numbers, there are many possible ways to add operators and parentheses to form an valid expression ...
Read More
generate valid parentheses

Number of valid parentheses – code

Parentheses show up in pairs in an expression. To find number of possible combinations of valid parentheses, we have to ...
Read More

Permutation of multiple arrays and iterator – code

Permutation of multiple arrays and iterator has two tasks. First is the permutation of multiple arrays and output as an ...
Read More


Comments are closed