samedi 4 novembre 2017

object orient Design : a call center with three levels of hierarchy , to handle the call in an optimized way

**A call center consists of below members

• X Junior executives at level 1 who attends the call first.

• Y Senior executives at level 2 who attends calls escalated from Level 1

• 1 Manager who attends the calls escalated from Level 2

• X > Y always

• Call center receives Z calls a day strong text

Calls should be assigned to the executives in such a way that the total time taken to finish ALL the calls is optimized.**

System Rules
•   Any calls which stays more than 7 minutes with a JE will be escalated to SE
•   Any calls which stays more than 10 minutes with a SE will be escalated to next level (Manager)
•   Any calls which stays more than 15 minutes with Manager will be treated as unresolved
•   Any executive cannot not handle more than Z/X+Y calls. Once the limit is reached, he/she should not receive any further calls.

Sample Request Json :
{
  "number_of_calls": "20",
  "je": [
    { " 9,12,15,13,6,3,3,3"},
    {" 10,9,11,1,4,1,1,4"},
    { " 1,4,12,8,4,5,9,2 "},
    {" 9,6,6,3,1,12,15,15 "},
    {" 6,14,6,13,3,14,13,2 "}
],
  "se": [
    { " 6,5,4,8,10,9,2,10 "},
    { " 2,13,2,8,6,15,10,14 "},
    {" 11,14,2,13,13,15,4,13"}
],
  "mgr": "9,12,20,13,20,3,3,3,9,2,7,1,7,11,10,5,4,14,14,12"
}



Where: 
The number of elements in the je and se list denotes the X and Y respectively.

First element in the list above (je, se) , denotes the time taken by first executive, the second element denotes the time taken by second executive and so on.. 
For example,  " 9,12,15,13,6,3,3,3 is a mock of the time taken by the first Junior Executive (e.g. he would have taken 9 mins on first call, 12 mins for second etc.) …. Example shows 20 values against manager, mocking the worst case where all calls come to manager. In real life, these values would be the exact times taken by executives but this mock data is provided to simulate executive’s behavior in the program. 

Expectations: - 
1) Implement as a Micro service using TDD approach, covering all the edge cases scenarios
2) Using a suitable design pattern is highly recommended. Also, design should be efficient to handle modifications on the go, ex: increasing/decreasing number of executives, etc..
3) Exception handling
4) The system should be capable of finding the optimized way to handle the calls with available resources whose details are provided in the request.
5) Response should look like:

Sample Response JSON :
{
  "number_of_calls": "30",
  "resolved": "28",
  "unresolved": "2",
  "totalTimeTakenInMinutes": "240",
  "performance": [
    {
      "manager": {
        "id": "mgr",
        "timeTakenInMinutes": "40",
        "callsAttended": "5",
        "resolved": "3",
        "unresolved": "2"
      },
      "junior-executives": [
        {
          "id": "je1",
          "timeTakenInMinutes": "60",
          "callsAttended": "23",
          "resolved": "20",
          "escalated": "0"
        },
        {
          "id": "je2",
          "timeTakenInMinutes": "70",
          "callsAttended": "25",
          "resolved": "18",
          "escalated": "3"
        }
      ]
    },
    {
      "senior-executives": [
        {
          "id": "se1",
          "timeTakenInMinutes": "35",
          "callsAttended": "4",
          "resolved": "3",
          "escalated": "0"
        },
        {
          "id": "se2",
          "timeTakenInMinutes": "40",
          "callsAttended": "4",
          "resolved": "2",
          "escalated": "1"
        }
      ]
    }
  ]
}

Aucun commentaire:

Enregistrer un commentaire