JUSPAY ONLINE TEST EXPERIENCE ONCAMPUS ROUND1
- Posted
- 13 Sept 2026
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.
How it went
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.
Questions asked (2)
- 01
Dynamic Tree Queries for Shortest Path
Data Structures & Algorithms · Medium
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.
- Update the weight of the edge between nodes
- 02
Minimum of Peaks in Fixed‑Size Sliding Window
Data Structures & Algorithms · Easy
Given an array
[a1, a2, ..., an]and a window sizek, 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.