PayU Interview Questions 2026
21 real interview questions asked at PayU. Covers DSA / Arrays, DSA / Hashmaps, JavaScript / Fundamentals, React / Concepts, React / Coding, JavaScript / Promises, React / Architecture, Frontend / Hierarchical Navigation, Frontend / Best Practices, Product Engineering, Java / Exceptions. Reported by engineers who went through the PayU process.
DSA / Arrays (3)
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.
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³)?
DSA / Hashmaps (3)
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.
Implement a function that detects duplicate transaction IDs within a 5-minute time window. Given an array of {id, timestamp} objects, return all IDs that appear more than once within any 5-minute rolling window. What data structure would you use and why?
Design an in-memory rate limiter that allows at most N requests per user per minute. Given a stream of {userId, timestamp} requests, return true if the request should be allowed or false if it should be throttled. Implement using JavaScript.
JavaScript / Fundamentals (3)
What will the following code output and why? const obj = { x: 10 }; const fn = () => console.log(this.x); obj.fn = fn; obj.fn(); Now rewrite fn as a regular function. How does the output change and what is the reason?
Predict the output of this code: console.log(1); setTimeout(() => console.log(2), 0); Promise.resolve().then(() => console.log(3)); console.log(4); Explain the event loop mechanism that determines this order.
Implement a debounce function from scratch in JavaScript. Then explain where you would use debounce vs throttle in a payment checkout flow — for example on a search input, a "Pay Now" button, and a scroll event handler.
React / Concepts (1)
Explain the reconciliation algorithm in React. How does React decide which DOM nodes to update when state changes? What is the role of the key prop and what happens when you use an array index as a key versus a stable unique ID?
React / Coding (3)
Build a custom useFetch hook in React that accepts a URL, returns { data, loading, error }, handles component unmount (cleanup), and prevents state updates on an unmounted component. Show the complete implementation.
Implement a reusable PaymentForm component in React with fields for card number, expiry, and CVV. Add real-time validation using controlled components: card number must be 16 digits, expiry must be a future month, CVV 3–4 digits. No external libraries.
You need to implement optimistic UI for a "Add to Cart" button in a React e-commerce app. When the user clicks, the UI should update immediately, but revert if the API call fails. How would you implement this pattern without any state management library?
JavaScript / Promises (2)
Implement Promise.allSettled from scratch without using the native method. Then explain the difference between Promise.all, Promise.allSettled, Promise.any, and Promise.race — give a concrete payment flow example for when you would use each.
A payment API call must retry up to 3 times on network failure, with exponential backoff (1s, 2s, 4s delays) between attempts. Implement a retryWithBackoff(fn, maxRetries) utility using Promises. Handle the case where all retries fail.
React / Architecture (2)
Design the frontend architecture for a PayU checkout SDK that can be embedded in any merchant website as a script tag. It must render a payment form in an iframe, handle cross-origin communication, support multiple payment methods (card, UPI, netbanking), and work across React, Vue, and plain HTML merchant sites.
You are building a multi-step payment flow: Cart → Address → Payment Method → OTP → Confirmation. Each step has its own data, validation, and API calls. How would you architect state management for this flow in React without Redux? Discuss trade-offs.
Frontend / Hierarchical Navigation (1)
Design and implement a recursive category tree component in React for a merchant product catalogue. The tree can be N levels deep, each node can be expanded/collapsed independently, and the selected path must be highlighted. Clicking a leaf node should emit the full path (e.g. "Electronics > Phones > Android"). Optimise to avoid re-rendering siblings when one node is toggled.
Frontend / Best Practices (1)
A merchant reports that their checkout page built with your SDK scores 38 on Google Lighthouse. Walk through your systematic debugging process: which Core Web Vitals are likely failing, what tools you would use, and give five concrete optimisations specific to a payment checkout flow.
Product Engineering (1)
PayU wants to run A/B tests on the checkout button colour and payment method ordering to improve conversion rates. As the frontend engineer, how would you design the experimentation infrastructure: flag evaluation, consistent user bucketing, avoiding layout shift between variants, and measuring the right success metrics?
Java / Exceptions (1)
What is the difference between a checked and an unchecked exception in Java? Why do many teams avoid checked exceptions for business logic errors?
Practice these questions with AI feedback
Get instant grading on your answers, identify your weak areas, and generate a personalised 14-day study plan — all free.
Build my study plan →