There are a total of 3 parts for this challenge. Your score will be a combined score of all 3 parts, with all parts having equal score weightage.
Given a set of node relationships, find the least amount of nodes to send a message to so that the message will be received by all nodes in the network.
You are to expose a POST method with endpoint /broadcaster/message-broadcast.
All requests and responses should come with a body of Content-Type: application/json.
The evaluation for this part will timeout if no result is returned after 1 minute.
In the below sample data array, there are a total of 4 node relationships, i.e. A is sending to B and C, B is sending to D, and E is sending to F.
{
"data" : [ "A->B" , "A->C" , "B->D" , "E->F" ]
}
The expected output is a list of nodes to send to.
{
"result" : [ "A" , "E" ]
}
Given a set of node relationships, find the most connected node in the entire network. The most connected node is one that is able to reach out to the most amount of nodes in the network when a message is sent out via that node. If the result contains more than one node, you are to return only the first node sorted by alphabetical order.
You are to expose a POST method with endpoint /broadcaster/most-connected-node.
All requests and responses should come with a body of Content-Type: application/json.
The evaluation for this part will timeout if no result is returned after 3 minutes.
In the below sample data array, there are a total of 4 node relationships, i.e. A is sending to B and C, B is sending to D, and E is sending to F.
{
"data" : [ "A->B" , "A->C" , "B->D" , "E->F" ]
}
The expected output is the most connected node.
{
"result" : "A"
}
In the below sample data array, there are a total of 4 node relationships, i.e. A is sending to B, B is sending to C and D, and E is sending to F.
{
"data" : [ "A->B" , "B->C" , "B->D" , "E->F" ]
}
{
"result" : "A"
}
Given a set of node relationships with time taken to send the message through, find the shortest path to send the message from point A to point B. You may assume that there is a path between given point A and B.
You are to expose a POST method with endpoint /broadcaster/fastest-path.
All requests and responses should come with a body of Content-Type: application/json.
The evaluation for this part will timeout if no result is returned after 1 minute.
In the below sample data array, there are a total of 5 node relationships with time taken to send the message through, i.e. A is sending to B in 1000ms and C in 4500ms, B is sending to C in 1000ms and D in 2000ms, and E is sending to F in 4000ms. The starting sender is A and the designated recipient to receive the message is C.
{
"data" : [ "A->B,1000" , "A->C,4500" , "B->D,2000" , "B->C,1000", "E->F,4000" ],
"sender" : "A",
"recipient" : "C"
}
The expected output is a list that contains the shortest path.
{
"result" : [ "A" , "B" , "C" ]
}