Hands-on Java problems
Practise the coding rounds you'll actually face — filter by topic.
Thread-safe Singleton
Implement a Singleton that is lazy and safe under concurrent first access.
Print odd & even with two threads
Coordinate two threads so numbers 1…N print in order: odd thread then even thread alternating.
Second highest salary (SQL)
Write a SQL query that returns the second highest distinct salary from the Employee table.
First non-repeating character
Find the first character that appears exactly once using LinkedHashMap to preserve order.
Custom InsufficientBalanceException
Model a bank withdraw that throws a checked custom exception when the balance is too low.
Group employees by department (Streams)
Use Java 8 Streams and Collectors to group a list of employees by department name.