JUSPAY ONLINE TEST EXPERIENCE ONCAMPUS ROUND1

juspay logo
juspay
September 13, 2026 · 2 reads

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)

1.

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 x1 and x2.
  • Given two nodes x1 and x2, compute the shortest distance between them.

For each query of the second type, return the sum of all shortest distances.

2.

Minimum of Peaks in Fixed‑Size Sliding Window

Data Structures & Algorithms·Easy

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.

📣 Found this helpful? Please share it with friends who are preparing for interviews!

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!