Two classic warm-up problems: reverse a string in place with two pointers, and test a palindrome while ignoring case and punctuation.
Count how often each character appears with Map of Character to Integer and merge, then print the most frequent first.
A short program that shows which strings share the pooled object, which are new objects, and what intern() does.
What really takes part in polymorphism: instance methods do, while static methods, fields and private methods are decided by the variable's type.
An immutable class with a correct equals and hashCode pair, used as a HashMap key, so a lookup with a different but equal object finds the entry.
Two AutoCloseable resources declared in a try header are closed automatically, last opened first, and the code after the block still runs.
Collectors.groupingBy with a downstream collector: names per department, average salary, the top earner of each department, and a partition into two groups.
Distinct, sort descending, skip one: the stream answer to a favourite interview question, generalised to the Nth highest and safe for short lists.
What happens when two list elements produce the same map key, and three ways to handle it: keep the first, combine the values, or group them into lists.
Four threads increment three kinds of counters 50,000 times each, and every one of them ends at exactly 200,000.
Find the two indexes whose values add up to a target in one pass, with the brute-force version for comparison.
A least-recently-used cache in a dozen lines: a LinkedHashMap in access order that removes its eldest entry when it grows past the capacity.