**PayU** is a Netherlands-based payment service provider to online merchants.^{}^{} The company was founded in 2002^{} and is headquartered in Hoofddorp. It allows online businesses to accept and process payments through payment methods that can be integrated with web and mobile applications.^{}^{} As of 2018, the service is available in 17 countries.^{} The firm is owned by the Naspers Group, which also owns a stake in one of its sister companies, Tencent .

It has got a 4.1* rating on Glassdoor and is considered one of the best product-based companies. It is highly regarded for its work-life balance.

They provide good training as well which will be beneficial in future too. You can practice the below questions collected from **PayU** Interview Experience for the interview. We have collected past frequently asked questions from **PayU** Interview Experience for your reference.

Categories of Questions

## PayU Array Questions

**Question 1. Next Permutation Leetcode Solution** Problem Statement The Next Permutation LeetCode Solution – “Next Permutation” states that given an array of integers which is a permutation of first n natural numbers. We need to find the next lexicographically smallest permutation of the given array. The replacement must be in-place and use only constant extra space. ...

**Question 2. Maximum subsequence sum such that no three are consecutive** The problem “Maximum subsequence sum such that no three are consecutive ” states that you are given an array of integers. Now you need to find a subsequence that has the maximum sum given that you cannot consider three consecutive elements. To recall, a subsequence is nothing but an array ...

**Question 3. Maximum possible difference of two subsets of an array** Suppose, we have an integer array. The problem statement “Maximum possible difference of two subsets of an array” asks to find out the maximum possible difference between the two subsets of an array. Conditions to be followed: An array can contain repeating elements, but the highest frequency of an element ...

**Question 4. Length of the largest subarray with contiguous elements** The problem “Length of the largest subarray with contiguous elements” states that you are given an integer array. The problem statement asks to find out the length of the longest contiguous sub-array of which elements can be arranged in a sequence (continuous, either ascending or descending). The numbers in the ...

**Question 5. First element occurring k times in an array** We have given a number ‘k’ and an integer array. The problem “First element occurring k times in an array” says to find out the first element in the array which occurs exactly k times in an array. If there is no element in the array which occurs k times ...

**Question 6. Check in binary array the number represented by a subarray is odd or even** The problem “Check in binary array the number represented by a subarray is odd or even” states that you are given a binary array and a range. The array consists of the number in the form of 0s and 1s. The problem statement asks to find out the number represented ...

**Question 7. Queries for counts of array elements with values in given range** Problem Statement The problem “Queries for counts of array elements with values in given range” states that you have an integer array and two number x and y. The problem statement asks to find out the count of numbers present in array that lies between the given x and y. ...

**Question 8. Subset with sum divisible by m** Problem Statement The problem “Subset with sum divisible by m” states that you are given an array of non-negative integers and an integer m. Now you need to find if there is a subset having sum divisible by m. That is the sum of the subset should give 0 as ...

**Question 9. Gold Mine Problem** Problem Statement The “Gold Mine problem” states that you are given a 2D grid having some non-negative coins placed in each cell of the given grid. Initially, the miner is standing at the first column but there is no restriction on the row. He can start in any row. The ...

**Question 10. Shuffle 2n integers as a1-b1-a2-b2-a3-b3-..bn without using extra space** Problem Statement You are given an array of integers. The problem “Shuffle 2n integers as a1-b1-a2-b2-a3-b3-..bn without using extra space” asks to shuffle all the numbers in the array such that the numbers which are like (x0, x1, x2, x3, y0, y1, y2, y3) will be shuffled like x0, y0, ...

**Question 11. Maximum Product Subarray** Problem Statement The problem “Maximum Product Subarray” states that you are given an array of integer containing both positive and negative numbers. The problem statement asks to find out the maximum product of the sub-array. Example arr[] = { 2, -2, 3, 5} 15 Explanation The elements in the sub-array ...

**Question 12. Minimum number of distinct elements after removing m items** Problem Statement The problem “Minimum number of distinct elements after removing m items” states that you have an array and an integer m. Each element of the array indicates an item id’s. The problem statement asks to remove m elements in such a way that there should be a minimum ...

**Question 13. Count subarrays having total distinct elements same as original array** Problem Statement “Count subarrays having total distinct elements same as original array” states that you are given an integer array. The problem statement asks to find out the total number of sub-arrays that contain all distinct elements as present in an original array. Example arr[] = {2, 1, 3, 2, ...

**Question 14. Count pairs from two sorted arrays whose sum is equal to a given value x** Problem Statement “Count pairs from two sorted arrays whose sum is equal to a given value x” problem states that you are given two sorted arrays of integers and an integer value called sum. The problem statement asks to find out the total number of pair which sums up to ...

**Question 15. Maximum sum bitonic subarray** Problem Statement An array having n integers is given to us. We need to find the maximum sum bitonic subarray. A bitonic subarray is nothing but just a subarray where the elements are arranged in a specific order. Such that the first elements are in increasing order and then in ...

**Question 16. Largest Sum Contiguous Subarray** Problem Statement You are given an array of integers. The problem statement asks to find out the largest sum contiguous subarray. This means nothing but to find a subarray (continuous elements) which has the largest sum among all other subarrays in the given array. Example arr[] = {1, -3, 4, ...

**Question 17. Next Greater Element in an Array** Problem Statement Given an array, we will find the next greater element of each element in the array. If there is no next greater element for that element then we will print -1, else we will print that element. Note: Next greater element is the element that is greater and ...

**Question 18. Find Leaders in an Array** Problem Statement Given an array containing N elements. Find the leaders in an array. Leaders are the element that have no element larger than themselves on the right of them in the array. Example Input 7 1 95 4 46 8 12 21 Output 95 46 21 Explanation Here no ...

## PayU String Questions

**Question 19. Queue based approach for first non-repeating character in a stream** Problem Statement The problem “Queue based approach for first non-repeating character in a stream” states that you are given a stream containing lower case characters, find the first non-repeating character whenever a new character is added to the stream, and if there is no non-repeating character return -1. Examples aabcddbe ...

**Question 20. Reverse words in a string** Problem Statement “Reverse words in a string” states that you are given a string s of size n. Print the string in reverse order such that the last word becomes the first, second last becomes the second, and so on. Hereby string we refer to a sentence containing words instead ...

**Question 21. Maximum occurring character in a string** Given a string of size n containing lower case letters. We need to find the maximum occurring character in a string. If there is more than one character with a maximum occurrence then print any of them. Example Input: String s=”test” Output: Maximum occurring character is ‘t’. Approach 1: Using ...

**Question 22. KMP Algorithm** KMP(Knuth-Morris-Pratt) algorithm is used for pattern searching in a given string. We are given a string S and a pattern p, our goal is to determine whether or not the given pattern is present in the string. Example Input: S = “aaaab” p = “aab” Output: true Naive Approach The ...

**Question 23. Rabin Karp Algorithm** Rabin Karp Algorithm used to find the pattern string in the given text string. There are so many types of algorithms or methods used to find the pattern string. In this algorithm, we use Hashing for finding the pattern matching. If we got the same hash code for the substring ...

## PayU Tree Questions

**Question 24. Given a binary tree, how do you remove all the half nodes?** The problem “Given a binary tree, how do you remove all the half nodes?” states that you are given a binary tree. Now you need to remove the half nodes. A half node is defined as a node in the tree that has only a single child. Either it is ...

**Question 25. Boundary Traversal of binary tree** Problem Statement The problem “Boundary Traversal of binary tree” states that you are given a binary tree. Now you need to print the boundary view of a binary tree. Here boundary traversal means that all the nodes are shown as the boundary of the tree. The nodes are seen from ...

**Question 26. Diagonal Traversal of Binary Tree** Problem Statement The problem “Diagonal Traversal of Binary Tree” states that you are given a binary tree and now you need to find the diagonal view for the given tree. When we see a tree from the top-right direction. The nodes which are visible to us is the diagonal view ...

**Question 27. Minimum number of distinct elements after removing m items** Problem Statement The problem “Minimum number of distinct elements after removing m items” states that you have an array and an integer m. Each element of the array indicates an item id’s. The problem statement asks to remove m elements in such a way that there should be a minimum ...

**Question 28. Merge two BSTs with limited extra space** Problem Statement The problem “Merge two BSTs with limited extra space” states that you are given two binary search tree(BST) and you need to print the elements from both the trees in sorted order. That is in such an order that it seems that elements are from a single BST. ...

**Question 29. Height of a generic tree from parent array** Problem Statement “Height of a generic tree from parent array” problem states that you are given a tree with n vertices as an array par[0…n-1]. Here every index i in par[] represents a node and the value at i represents the immediate parent of that node. For the root node ...

## PayU Graph Questions

**Question 30. Height of a generic tree from parent array** Problem Statement “Height of a generic tree from parent array” problem states that you are given a tree with n vertices as an array par[0…n-1]. Here every index i in par[] represents a node and the value at i represents the immediate parent of that node. For the root node ...

## PayU Stack Questions

**Question 31. Next Greater Element in an Array** Problem Statement Given an array, we will find the next greater element of each element in the array. If there is no next greater element for that element then we will print -1, else we will print that element. Note: Next greater element is the element that is greater and ...

## PayU Queue Questions

**Question 32. Queue based approach for first non-repeating character in a stream** Problem Statement The problem “Queue based approach for first non-repeating character in a stream” states that you are given a stream containing lower case characters, find the first non-repeating character whenever a new character is added to the stream, and if there is no non-repeating character return -1. Examples aabcddbe ...

**Question 33. Height of a generic tree from parent array** Problem Statement “Height of a generic tree from parent array” problem states that you are given a tree with n vertices as an array par[0…n-1]. Here every index i in par[] represents a node and the value at i represents the immediate parent of that node. For the root node ...

## PayU Matrix Questions

**Question 34. Gold Mine Problem** Problem Statement The “Gold Mine problem” states that you are given a 2D grid having some non-negative coins placed in each cell of the given grid. Initially, the miner is standing at the first column but there is no restriction on the row. He can start in any row. The ...

## PayU Other Questions

**Question 35. Next Permutation LeetCode Solution** Problem Statement Next Permutation LeetCode Solution – A permutation of an array of integers is an arrangement of its members into a sequence or linear order. For example, for arr = [1,2,3], the following are considered permutations of arr: [1,2,3], [1,3,2], [3,1,2], [2,3,1]. The next permutation of an array of integers is the next lexicographically greater permutation of ...

**Question 36. Find postorder traversal of BST from preorder traversal** Problem Statement The problem “Find postorder traversal of BST from preorder traversal” states that you are given preorder traversal of a binary search tree. Then using the given input find the postorder traversal. Example preorder traversal sequence: 5 2 1 3 4 7 6 8 9 1 4 3 2 ...

**Question 37. Maximum path sum in a triangle** Problem Statement The problem “Maximum path sum in a triangle” states that you are given some integers. These integers are arranged in the form of a triangle. You are starting from the top of the triangle and need to reach the bottom row. For doing this, you move to the ...

**Question 38. Print Fibonacci sequence using 2 variables** Problem Statement The problem “Print Fibonacci sequence using 2 variables” states that you need to print the Fibonacci sequence but there is a limitation of using only 2 variables. Example n = 5 0 1 1 2 3 5 Explanation The output sequence has the first five elements of the ...

**Question 39. Word Wrap Problem** Problem Statement The word wrap problem states that given a sequence of words as input, we need to find the number of words that can be fitted in a single line at a time. So, for doing this we put breaks in the given sequence such that the printed document ...