5 real Java interview questions asked at PayU. Upvoted by engineers who cleared the loop. Covers Technical rounds.
PayU
Medium
Technical round
2–5 YearsInterview ExperienceJavaScriptJavaPython
Given an array of transaction amounts, find all pairs whose sum equals a given target. Return the count of unique pairs. For example: [100, 200, 300, 400], target = 500 → pairs: (100,400), (200,300) → count: 2. What is the time and space complexity of your approach?
↑ 61 upvotes · 42 engineers asked this · Full Stack Developer
PayU
Medium
Technical round
2–5 YearsInterview ExperienceJavaScriptJava
You have an array of daily payment failure counts for the past 30 days. Find the longest contiguous subarray where failures stayed below a given threshold k. Explain your sliding window approach and walk through the algorithm step by step.
↑ 48 upvotes · 33 engineers asked this · Full Stack Developer
PayU
Medium
Technical round
2–5 YearsInterview ExperienceJavaScriptJava
Given a list of payment events, each with a merchant ID and an amount, use a HashMap to return the top 3 merchants by total transaction volume. How would you handle ties? Write the complete solution.
↑ 57 upvotes · 39 engineers asked this · Full Stack Developer
PayU
Medium
Technical round
2–5 YearsInterview ExperienceJavaScriptJavaPython
Given a 2D matrix representing a payment heatmap (rows = hours, columns = days), find the submatrix with the maximum sum. The submatrix represents the peak payment activity window. Describe your approach — can you do better than O(n³)?
↑ 44 upvotes · 29 engineers asked this · Full Stack Developer
PayU
Medium
Technical round
1-4 yearsJava
What is the difference between a checked and an unchecked exception in Java? Why do many teams avoid checked exceptions for business logic errors?
↑ 17 upvotes · 8 engineers asked this · SDE2
Given an array of transaction amounts, find all pairs whose sum equals a given target. Return the count of unique pairs. For example: [100, 200, 300, 400], target = 500 → pairs: (100,400), (200,300) → count: 2. What is the time and space complexity of your approach?
Given an array of transaction amounts, find all pairs whose sum equals a given target. Return the count of unique pairs. For example: [100, 200, 300, 400], target = 500 → pairs: (100,400), (200,300) → count: 2. What is the time and space complexity of your approach?
You have an array of daily payment failure counts for the past 30 days. Find the longest contiguous subarray where failures stayed below a given threshold k. Explain your sliding window approach and walk through the algorithm step by step.
You have an array of daily payment failure counts for the past 30 days. Find the longest contiguous subarray where failures stayed below a given threshold k. Explain your sliding window approach and walk through the algorithm step by step.
Given a list of payment events, each with a merchant ID and an amount, use a HashMap to return the top 3 merchants by total transaction volume. How would you handle ties? Write the complete solution.
Given a list of payment events, each with a merchant ID and an amount, use a HashMap to return the top 3 merchants by total transaction volume. How would you handle ties? Write the complete solution.
Given a 2D matrix representing a payment heatmap (rows = hours, columns = days), find the submatrix with the maximum sum. The submatrix represents the peak payment activity window. Describe your approach — can you do better than O(n³)?
Given a 2D matrix representing a payment heatmap (rows = hours, columns = days), find the submatrix with the maximum sum. The submatrix represents the peak payment activity window. Describe your approach — can you do better than O(n³)?
What is the difference between a checked and an unchecked exception in Java? Why do many teams avoid checked exceptions for business logic errors?
What is the difference between a checked and an unchecked exception in Java? Why do many teams avoid checked exceptions for business logic errors?