DSA questions in Nutanix
Anonymous User
4596

Below are the few problems which was asked during DSA round in Nutanix

  1. Given a binary tree. Find the path of the node having lowest value to the node having highest value.
    If the tree has nodes with value 1,2,3,4,5,6,7, 8, 9, 10
    return the nodes in the path between 1 to 10.

  2. For any number passed, n, find the first n primes, where every element should be greater than the sum of the previous elements.
    For ex.
    if n = 1 return 2.
    if n = 2 return 2, 3
    if n = 3 return 2, 3, 7 (we are skipping 5 as this would not be greater than the previous number's sum)
    if n = 4 return 2, 3, 7, 13

Comments (7)