Company: Cisco_8th june_on campus

Difficulty: medium

Problem Statement

A distributed system of servers is represented as a tree with tree_nodes nodes, numbered from 1 to tree_nodes . The tree has exactly tree_nodes − 1 bidirectional edges, and moving across any single edge (between two directly connected servers) takes 1 unit of time. A process needs to: Start at the start_node server. Complete tasks at the servers listed in the array task_nodes[] of size num_tasks , visiting them in any order. End at the end_node server. Determine the minimum total time required to complete all tasks and finish at the end_node server. Note: All edges are bidirectional and the graph is guaranteed to be a tree (connected and acyclic). task_nodes[] contains distinct elements. start_node ≠ end_node , and start_node is not present in task_nodes[] . end_node may or may not itself be one of the task_nodes . A server may be passed through any number of times; tasks at a node are considered done the first time that node is reached. Example tree_nodes = 4 tree_from = [1,

More Cisco_8th june_on campus OA questionsInterview experiences