Engrain by ByteRush

MC.11.02 Mid-level

Behavioural patterns

Comes up in: Low-level design, Coding

This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.

What it covers

  • observer/pub-sub
  • strategy
  • command (undo/redo)
  • state machine (XState idea)
  • mediator
  • iterator
  • middleware/chain of responsibility

Words you will know

observerstrategycommandstate machinemiddleware

What you will practise

  • undo/redo with command pattern
  • form flow as a state machine

Interview questions this answers

  • Implement undo/redo using the command pattern.
  • Where do you see the observer pattern in frontend code?
  • When would you model UI with a state machine?