JUSPAY ONLINE TEST EXPERIENCE ONCAMPUS ROUND1
Summary
I took the Juspay online test which consisted of three coding questions to be solved in one hour. I was unable to finish the test due to time constraints.
Full Experience
In total there were three coding questions and I had one hour.
1. Medium question: there was a tree given with weighted edges. There are Q queries of two types: (a) update the edge between x1 and x2, (b) find the shortest distance between two nodes x1 and x2. I had to return the sum of all the shortest distances for the queries of the second type.
2. Easier question: given an array [a1, a2, ..., an] and a window size k, return the minimum of all the peaks of the fixed‑size k windows. A peak is defined as the highest value in the window.
3. I did not even read the third question because I ran out of time.
Interview Questions (2)
Dynamic Tree Queries for Shortest Path
A tree with weighted edges is provided. You must handle Q queries of two types:
- Update the weight of the edge between nodes
x1andx2. - Given two nodes
x1andx2, compute the shortest distance between them.
For each query of the second type, return the sum of all shortest distances.
Minimum of Peaks in Fixed‑Size Sliding Window
Given an array [a1, a2, ..., an] and a window size k, compute the minimum value among all peaks of each window. A peak is defined as the highest value within a window.
Return this minimum value.