LLD Logo
LVL1
Strategy Pattern

Step 1 of 4 · Define the algorithm contract

1

Your task

Define the algorithm contract

Extract the one sorting operation shared by every algorithm.

Define SortStrategy as an abstraction.
Accept a collection of integers.
Return the sorted collection through the common operation.

sort_strategy.py

Your draft · saved locally

1
2
3
4
5

Structural feedback only—your code stays in this browser and is not executed.