Add office photos
Snapdeal logo
Engaged Employer

Snapdeal

Verified
3.8
based on 645 Reviews
Video summary
Filter interviews by
Software Engineer
Clear (1)

10+ Snapdeal Software Engineer Interview Questions and Answers

Updated 22 Feb 2024

Q1. Find the Next Greater Number with the Same Set of Digits

Given a string S that represents a number, determine the smallest number that is strictly greater than the original number and has the same set of digits...read more

Ans.

The task is to find the smallest number greater than the given number with the same set of digits.

  • Sort the digits of the number in descending order.

  • Find the first digit from the right that is smaller than the digit to its right.

  • Swap this digit with the smallest digit to its right that is greater than it.

  • Sort all the digits to the right of the swapped digit in ascending order to get the smallest number greater than the original number.

Add your answer
right arrow

Q2. Vertical Sum in a Binary Tree

Given a binary tree where each node has a positive integer value, compute the vertical sum of the nodes. The vertical sum is defined as the sum of all nodes aligned along the same ...read more

Ans.

Compute the vertical sum of nodes in a binary tree aligned along the same vertical line.

  • Traverse the binary tree in a level order manner to calculate the vertical sum.

  • Use a hashmap to store the vertical sum at each vertical level.

  • Recursively traverse the tree and update the vertical sum in the hashmap.

  • Output the vertical sums in the required format for each test case.

Add your answer
right arrow

Q3. Balanced Parentheses Check

Given a string STR consisting solely of the characters '{', '}', '(', ')', '[', and ']', determine whether the parentheses are balanced.

Input:

The first line contains an integer 'T' ...read more
Ans.

Implement a function to check if parentheses in a string are balanced.

  • Use a stack to keep track of opening parentheses and pop when a closing parenthesis is encountered.

  • If the stack is empty when a closing parenthesis is encountered or if there are unmatched parentheses at the end, return 'NO'.

  • Ensure that all opening parentheses have a corresponding closing parenthesis in the correct order.

  • Return 'YES' if all parentheses are balanced.

  • Example: Input: {[()]}, Output: YES

Add your answer
right arrow

Q4. Maximum Level Sum in Binary Tree Problem Statement

Given an arbitrary binary tree consisting of N nodes, where each node is associated with a certain value, your task is to find the maximum sum for any level in...read more

Ans.

Find the maximum sum for any level in a binary tree.

  • Traverse the binary tree level by level and calculate the sum for each level.

  • Keep track of the maximum sum encountered so far.

  • Return the maximum sum found.

  • Example: For the input tree, the maximum level sum is 13 (5+6+2).

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

Q5. Find Top K Frequent Numbers in a Stream

Given an integer array ARR and an integer K, your task is to find the K most frequent elements in ARR. Return the elements sorted in ascending order.

Example:

Input:
ARR ...read more
Ans.

Find the K most frequent elements in an integer array and return them sorted in ascending order.

  • Use a hashmap to store the frequency of each element in the array.

  • Use a min heap to keep track of the K most frequent elements.

  • Return the elements from the min heap in ascending order.

Add your answer
right arrow

Q6. calculate the top 10 words , which comes frequently in 1 hour time span , on facebook, (dynamically)

Ans.

Calculate top 10 frequently used words on Facebook in 1 hour dynamically.

  • Use Facebook API to fetch data

  • Implement a script to count word frequency

  • Sort the words based on frequency and return top 10

Add your answer
right arrow
Are these interview questions helpful?

Q7. Calculate the level sum of the binary tree

Ans.

Calculate the level sum of a binary tree.

  • Traverse the tree level by level using BFS

  • Add the values of nodes at each level

  • Store the level sum in an array

  • Return the array of level sums

Add your answer
right arrow

Q8. Number of rectangles/squares in chess board

Ans.

There are 204 squares and 1296 rectangles on a standard 8x8 chess board.

  • The number of squares can be calculated using the formula n(n+1)(2n+1)/6, where n is the number of rows/columns.

  • The number of rectangles can be calculated using the formula n(n+1)m(m+1)/4, where n and m are the number of rows and columns respectively.

  • For an 8x8 chess board, there are 64 squares of size 1x1, 49 squares of size 2x2, 36 squares of size 3x3, 25 squares of size 4x4, 16 squares of size 5x5, 9 s...read more

Add your answer
right arrow
Share interview questions and help millions of jobseekers 🌟
man with laptop
Q9. What is TCP/IP?
Ans.

TCP/IP is a set of protocols that governs the way data is transmitted over the internet.

  • TCP/IP stands for Transmission Control Protocol/Internet Protocol.

  • It is a suite of communication protocols used to connect devices on the internet.

  • TCP ensures that data is reliably transmitted between devices.

  • IP is responsible for addressing and routing data packets across networks.

  • Examples of TCP/IP protocols include HTTP, FTP, and SMTP.

Add your answer
right arrow

Q10. Vertical sum of binary tree

Ans.

Vertical sum of binary tree is the sum of all nodes in each vertical line of the tree.

  • Traverse the tree in-order and keep track of the horizontal distance of each node from the root.

  • Use a hash table to store the sum of nodes at each horizontal distance.

  • Recursively traverse the left and right subtrees and update the hash table accordingly.

Add your answer
right arrow

Q11. defective ball puzzle problem

Ans.

Defective ball puzzle involves finding the odd ball out of a group of identical balls using a balance scale.

  • Divide the balls into groups and weigh them on the balance scale.

  • If the scale tips, the odd ball is in the heavier group.

  • If the scale doesn't tip, the odd ball is in the remaining group.

  • Repeat the process until the odd ball is found.

  • Example: 8 identical balls, one is heavier. Divide into groups of 3 and weigh. If the scale tips, weigh two of the three balls to find the ...read more

Add your answer
right arrow

Q12. Find the pair element from the array

Ans.

Find the pair element from the array

  • Iterate through the array and use a hashmap to store elements and their counts

  • Check if the current element's complement exists in the hashmap

  • Return the pair if found, otherwise return null

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 Process at Snapdeal Software Engineer

based on 1 interviews
2 Interview rounds
Technical Round
HR Round
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Engineer Interview Questions from Similar Companies

Samsung Logo
3.9
 • 40 Interview Questions
Xoriant Logo
4.1
 • 15 Interview Questions
FIS Logo
3.9
 • 14 Interview Questions
Adobe Logo
3.9
 • 12 Interview Questions
View all
Recently Viewed
INTERVIEWS
Moglix
No Interviews
INTERVIEWS
Spinny
No Interviews
REVIEWS
Godrej Industries Group
No Reviews
INTERVIEWS
Zetwerk
No Interviews
INTERVIEWS
Zetwerk
No Interviews
DESIGNATION
INTERVIEWS
Zetwerk
No Interviews
INTERVIEWS
Zetwerk
No Interviews
INTERVIEWS
Moglix
No Interviews
INTERVIEWS
Snapdeal
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