← Quiz: Design Patterns: all 10 questions
Quiz: Design Patterns · Question 7 of 10
A food app should sort restaurants by distance, rating or delivery time, chosen by the user at run time. Which pattern…
A food app should sort restaurants by distance, rating or delivery time, chosen by the user at run time. Which pattern fits best?
- A.Singleton
- B.Adapter
- C.Builder
- D.Strategy
Answer & explanation
Correct answer: Strategy
Each sorting rule is a strategy with the same interface; the user's choice picks one.
Can you get the rest right without peeking?
Take the timed Quiz: Design Patterns quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →