Challenge: Mediator Pattern
Explore the Mediator design pattern by creating HR, Manager, and Worker classes to manage salary raise communications. Learn to coordinate interactions that demonstrate effective behavioral design in JavaScript coding interviews.
We'll cover the following...
We'll cover the following...
Problem statement
In this challenge, you need to use the mediator pattern to implement the HR of an office that mediates between the employees (workers and managers) of a company.
You have been given the dummy code for the HR class. You need to define its constructor and the functions:
-
registerEmployee(employee): Registers an employee -
scheduleRaise(raise, worker, manager): Conveys ...