
Choose a concept
Choose a lesson that matches a language gap, such as collections, equality, or generics. Read the worked examples before the drill.
ExampleCompare a list that stores values in order with a set used for membership. Explain which operation your algorithm needs most often.
Trace and explain
Complete a lesson drill and trace an edge case. Explain how the language’s value, reference, or type rules affect it.
ExampleCompare object references and logical equality. State why two distinct objects can represent the same value without being the same reference.
Apply it in practice
Choose Java in a supported Coding challenge and keep the supplied class and method signature. Run the visible cases.
ExampleFor Two Sum, use a map from values to indices. Verify a pair of equal values at different positions and preserve the required index order.
Check your work
You can explain a worked example and use the same rule on a new input or exercise.
Try it yourself
Trace a set-based duplicate check on [4, 1, 4]. Say which add operations change the set and whether a list would preserve all three positions.
- What to look for
- The second insertion of 4 leaves the set unchanged. A list retains both occurrences and their positions, so choose the collection according to what the problem asks you to retain.