honeytrap.devexercisesSettings

Exercises

Each one is a small Java project that already works. Restructure the single file you are allowed to edit, then submit — and a requirement you have never seen is dropped in without letting you touch your code again. Follow the principle and nothing you wrote needs to change.

Every exercise, with whether you have solved it, how hard it is and which family it belongs to.
Status#TitleDifficultyFamilyHidden
Not started1Open/ClosedAdd a shape without editing the thing that measures shapes.EasySOLID1 hidden requirement
Not started2Single ResponsibilityOne class, two jobs, and two people who will want to change it.EasySOLID2 hidden requirements
Not started3Liskov SubstitutionA caller that assumed too much, and the subtype that found out.MediumSOLID1 hidden requirement
Not started4Interface SegregationIt only prints. So why does it insist on a fax machine?MediumSOLID1 hidden requirement
Not started5Dependency InversionThe report picks its own database, so nobody else can.MediumSOLID1 hidden requirement
Not started6Factory MethodThe dialog knows what to do with a button. It should not know which one.EasyCreational1 hidden requirement
Not started7Abstract FactoryA dark button beside a light checkbox. Nobody chose that; it just happened.HardCreational1 hidden requirement
Not started8BuilderThe same order, written twice: once for the customer, once for the kitchen.MediumCreational1 hidden requirement
Not started9PrototypeA copy that was right on the day it was written.MediumCreational1 hidden requirement
Not started10AdapterThere is a converter right there. The panel went round it.EasyStructural1 hidden requirement
Not started11BridgeTwo shapes, one renderer. Add a third of either and see what happens.HardStructural2 hidden requirements
Not started12CompositeIt handles a folder in a folder. Nobody asked what happens at three.MediumStructural1 hidden requirement
Not started13DecoratorOne flag per channel. Now stack two of them.MediumStructural1 hidden requirement
Not started14FacadeThere is a front door. Everyone climbs in through the window.EasyStructural1 hidden requirement
Not started15FlyweightFour thousand letters. Sixteen of them are different.HardStructural1 hidden requirement
Not started16ProxyThe report is lazy. The dashboard woke it up anyway.MediumStructural1 hidden requirement
Not started17Chain of ResponsibilityTwo checks, hard-coded in the order somebody happened to write them.MediumBehavioural1 hidden requirement
Not started18CommandUndo works. Press it twice.MediumBehavioural1 hidden requirement
Not started19IteratorCounting to the size and indexing in. Fine, until there is no index.MediumBehavioural1 hidden requirement
Not started20MediatorTwo people in a room, wired to each other by hand. Now let a third in.MediumBehavioural1 hidden requirement
Not started21ObserverA field for the logger, a field for the alarm. Room for exactly two opinions.EasyBehavioural1 hidden requirement
Not started22StateDraft, review, published. Squeeze one in the middle.MediumBehavioural1 hidden requirement
Not started23StrategyIt was given the calculation. It does the arithmetic itself anyway.EasyBehavioural1 hidden requirement
Not started24Template MethodRead, transform, write. The order is the same every time; the steps are not.EasyBehavioural1 hidden requirement
Not started25VisitorOne walker per operation, and each one knows every node type.HardBehavioural1 hidden requirement
Read onlyThree patterns cannot be graded by dropping a requirement on them, and each of these says why. Nothing to write — the code is here to read and run.
Nothing to solve26SingletonIt works. That is the problem with it.ReadCreational—
Nothing to solve27MementoUndo, without the thing that stores it ever seeing what it stores.ReadBehavioural—
Nothing to solve28InterpreterOne class per rule, and a tree that is its own evaluator.ReadBehavioural—