Add office photos
Paytm logo
Engaged Employer

Paytm

Verified
3.3
based on 7.5k Reviews
Video summary
Filter interviews by
Software Developer Intern
Fresher
Clear (1)

10+ Paytm Software Developer Intern Interview Questions and Answers

Updated 5 Feb 2024

Q1. Parth's OCD Challenge

Parth, a budding programmer, has received an array 'ARR' of 'N' positive integers. His OCD is triggered whenever an odd number appears at an even index or an even number at an odd index in...read more

Ans.

Reorder array to avoid odd numbers at even indices and even numbers at odd indices.

  • Swap odd numbers at even indices with the nearest odd number at an odd index.

  • Swap even numbers at odd indices with the nearest even number at an even index.

  • Maintain counts of odd and even numbers to ensure equal distribution.

View 1 answer
right arrow

Q2. Find All Occurrences in Matrix

You are provided with a matrix of characters, CHARACTER_MATRIX of size M x N, and a string WORD. Your goal is to locate and display all occurrences of the string within the matrix...read more

Ans.

Find all occurrences of a given string in a matrix in all eight possible directions.

  • Iterate through each cell in the matrix and check for the starting character of the word.

  • For each starting character found, check in all eight directions for the complete word.

  • Keep track of the coordinates of each character in the word for each occurrence.

  • Print the coordinates of each character for all occurrences found.

  • If no occurrences are found, output 'No match found'.

Add your answer
right arrow
Paytm Software Developer Intern Interview Questions and Answers for Freshers
illustration image

Q3. Diagonal Traversal of a Binary Tree

Given a binary tree of integers, find its diagonal traversal. Refer to the example for clarification on diagonal traversal.

Example:

Explanation:
Consider lines at an angle o...read more
Ans.

Find the diagonal traversal of a binary tree of integers.

  • Traverse the binary tree diagonally using a queue and a map to store nodes at each diagonal level.

  • Use a depth-first search approach to traverse the tree and populate the map with nodes at each diagonal level.

  • Iterate through the map to get the diagonal traversal of the binary tree.

Add your answer
right arrow

Q4. Buy and Sell Stock Problem Statement

Imagine you are Harshad Mehta's friend, and you have been given the stock prices of a particular company for the next 'N' days. You can perform up to two buy-and-sell transa...read more

Ans.

Given stock prices for 'N' days, find maximum profit with up to two buy-and-sell transactions.

  • Iterate through the array of stock prices to find the maximum profit with two transactions

  • Keep track of the maximum profit by considering all possible buy and sell combinations

  • Ensure to sell the stock before buying again to maximize profit

Add your answer
right arrow
Discover Paytm interview dos and don'ts from real experiences

Q5. Rahul And Minimum Subarray Challenge

Rahul is learning about arrays and lists. His teacher gave him a task to find the length of the smallest subarray in a given array 'ARR' of size 'N' with its sum greater tha...read more

Ans.

Find the length of the smallest subarray in a given array with sum greater than a given value.

  • Iterate through the array while keeping track of the current subarray sum.

  • Use two pointers technique to find the smallest subarray with sum greater than X.

  • Update the minimum subarray length as you iterate through the array.

  • Return the length of the smallest subarray found.

  • Example: For ARR = [1, 2, 21, 7, 6, 12] and X = 23, the output is 2.

Add your answer
right arrow

Q6. Next Greater Element Problem Statement

Given a list of integers of size N, your task is to determine the Next Greater Element (NGE) for every element. The Next Greater Element for an element X is the first elem...read more

Ans.

Find the Next Greater Element for each element in a list of integers.

  • Iterate through the list of integers from right to left.

  • Use a stack to keep track of elements for which the Next Greater Element is not yet found.

  • Pop elements from the stack until a greater element is found or the stack is empty.

  • Assign the Next Greater Element as the top element of the stack or -1 if the stack is empty.

Add your answer
right arrow
Are these interview questions helpful?

Q7. Print Nodes at Distance K from a Given Node

Given an arbitrary binary tree, a node of the tree, and an integer 'K', find all nodes that are at a distance K from the specified node, and return a list of these no...read more

Ans.

Given a binary tree, a target node, and an integer K, find all nodes at distance K from the target node.

  • Traverse the binary tree to find the target node.

  • From the target node, perform a depth-first search to find nodes at distance K.

  • Use a recursive function to keep track of the distance from the target node.

  • Return the values of nodes found at distance K in any order.

Add your answer
right arrow

Q8. Binary Tree Diameter Problem Statement

You are given a Binary Tree, and you need to determine the length of the diameter of the tree.

The diameter of a binary tree is the length of the longest path between any ...read more

Ans.

The task is to find the diameter of a binary tree, which is the longest path between any two nodes in the tree.

  • Traverse the tree to find the longest path between any two nodes.

  • Keep track of the maximum diameter found during traversal.

  • The diameter may not necessarily pass through the root node.

  • Consider both left and right subtrees while calculating the diameter.

  • Example: For input '1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1', the diameter is 6.

Add your answer
right arrow
Share interview questions and help millions of jobseekers 🌟
man with laptop

Q9. Find All Pairs Adding Up to Target

Given an array of integers ARR of length N and an integer Target, your task is to return all pairs of elements such that they add up to the Target.

Input:

The first line conta...read more
Ans.

Given an array of integers and a target, find all pairs of elements that add up to the target.

  • Iterate through the array and for each element, check if the target minus the element exists in a hash set.

  • If it does, add the pair to the result. If not, add the element to the hash set.

  • Handle cases where the same element is used twice in a pair.

  • Return (-1, -1) if no pair is found.

Add your answer
right arrow

Q10. Encrypt The Digits Problem Statement

Given a numeric string STR consisting of characters from ‘0’ to ‘9’, encrypt the string by replacing each numeric character according to the mapping:
‘0’ -> ‘9’, ‘1’ -> ‘8’, ...read more

Ans.

Encrypt each digit in a numeric string by replacing it with its encrypted equivalent.

  • Iterate through each character in the string and replace it with its encrypted equivalent

  • Use a mapping to determine the encrypted equivalent of each digit

  • Return the encrypted string for each test case

Add your answer
right arrow

Q11. Subset Sum Equal To K Problem Statement

Given an array/list of positive integers and an integer K, determine if there exists a subset whose sum equals K.

Provide true if such a subset exists, otherwise return f...read more

Ans.

Given an array of positive integers and an integer K, determine if there exists a subset whose sum equals K.

  • Use dynamic programming to solve this problem efficiently

  • Create a 2D array to store if a subset sum is possible for each element and sum

  • Iterate through the array and update the 2D array accordingly

  • Check if the subset sum for K is possible using the 2D array

Add your answer
right arrow
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Intern Interview Questions from Similar Companies

View all
Recently Viewed
INTERVIEWS
Flipkart
10 top interview questions
INTERVIEWS
Zepto
10 top interview questions
INTERVIEWS
Oracle
No Interviews
INTERVIEWS
StreamSets
No Interviews
SALARIES
Swan Defence and Heavy Industries
SALARIES
Godrej & Boyce Manufacturing
INTERVIEWS
StreamSets
No Interviews
INTERVIEWS
Snowflake
No Interviews
SALARIES
Swan Defence and Heavy Industries
INTERVIEWS
Snowflake
No Interviews
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter