Java Coding Interview Workbook
50 classic Java interview problems in the order that makes them stick, plus 6 bonus problems, cheat sheets and a night-before revision list. Solve first, then check the worked solutions.
What's inside
- 01How to use this book: why the order matters, and a 2-week planp. 3
- 02The workbook: all 56 problems with examples and tools, no answersp. 7
- 031. Arrays: max and min, reverse, second largest, move zeros, rotate by K, missing numberp. 14
- 042. Strings: anagrams, first non-repeating and repeating character, frequencyp. 21
- 053. ArrayList and Set: duplicates, retainAll, addAll, sortingp. 27
- 064. HashMap: word count, most frequent element, group anagramsp. 32
- 075. Comparator: sort by salary, then age, and sort a Map by valuep. 37
- 086. Stack and queue: valid parentheses, reverse a queue, binary numbersp. 44
- 097. Streams on an Employee list: filter, map, sorted, groupingBy, maxByp. 49
- 108. 18 stream puzzles: second highest salary, partitioningBy, toMap, flatMapp. 55
- 119. Bonus: Two Sum, binary search, Kadane, sliding window, merge, stockp. 68
- 12Cheat sheets: collections, HashMap, Comparator, Collectors, stream traps, Big-Op. 72
- 13Night-before revision: every problem in one linep. 76
A look inside


Who it's for
Java developers with a coding round coming up, especially if it has been a while since you last solved puzzles. The problems go from easy array loops to the stream questions asked in experienced-level interviews, and every solution is explained in plain English with clean, tested Java 17+ code. Chapters 1 to 8 are also free to read on this site as the Java Coding Interview Prep series; the PDF adds the workbook, six bonus problems, the cheat sheets and the revision list, in one file you can print or read offline.
Questions
Is it free?
Yes. Download the PDF and share it as-is, with credit.
Which Java version does the code use?
Java 17 or newer (all code was compiled and run on Java 21). Where Java 8 differs, such as stream.toList(), the older form is shown too.
How is it different from the online series?
The series has the solutions for problems 1 to 50. The PDF adds a problems-only workbook to practise from, six bonus problems, cheat sheets and a night-before revision list.