Snapdeal Ltd. interview experience Real time questions & tips from candidates to crack your interview

Software Developer

Snapdeal Ltd.
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 5 months
Topics: Data Structures, Algorithms, System Design, Aptitude, OOPS
Tip
Tip

Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.

Application process
Where: Referral
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.

Interview rounds

01
Round
Medium
Face to Face
Duration60 minutes
Interview date29 May 2015
Coding problem2

Technical Interview round with 2 DSA based questions.

1. Find a pair with the given sum in a BST

Easy
15m average time
85% success
0/40
Asked in companies
HikeDunzoPayPal

You are given a Binary Search Tree (BST) and a target value ‘K’. Your task is to return true if there exist two nodes in the given BST such that the sum of their values is equal to the given target ‘K’, else return false.


A binary search tree (BST) is a binary tree data structure which has the following properties.

• The left subtree of a node contains only nodes with data less than the node’s data.

• The right subtree of a node contains only nodes with data greater than the node’s data.

• Both the left and right subtrees must also be binary search trees.


Note:
1. All the elements of the Binary Search Tree are unique.

2. You can’t use the same node value/element of BST twice.


For example:
tree: 8 5 10 2 6 -1 -1 -1 -1 -1 7 -1 -1
'K' = 13,

The nodes with values 8 and 5 as shown in the above figure gives sum equal to the given target 13. 

Therefore, the output will be “true” i.e it is possible to find a pair in the given BST having sum equal to ‘K’.
Problem approach

This problem can be solved using hashing. The idea is to traverse the tree in an inorder fashion and insert every node’s value into a set. Also check if, for any node, the difference between the given sum and node’s value is found in the set, then the pair with the given sum exists in the tree.
Time Complexity : O(n).

Try solving now

2. Zig Zag Tree Traversal

Easy
10m average time
90% success
0/40
Asked in companies
Goldman SachsAmazonFlexiEle Consulting Services (FE)

You are given a ‘Binary Tree’.


Return the level-order traversal of the Binary Tree.


Example:
Input: Consider the following Binary Tree:

Example

Output: 
Following is the level-order traversal of the given Binary Tree: [1, 2, 3, 5, 6, 4]


Problem approach

This problem can be solved using two stacks.
Assume the two stacks are current : current level and next level. We would also need a variable to keep track of the current level order(whether it is left to right or right to left). We pop from the current level stack and print the nodes value. Whenever the current level order is from left to right, push the nodes left child, then its right child to the stack next level. 
Since a stack is a LIFO(Last-In-First_out) structure, next time when nodes are popped off nextlevel, it will be in the reverse order. On the other hand, when the current level order is from right to left, we would push the nodes right child first, then its left child. Finally, do-not forget to swap those two stacks at the end of each level(i.e., when current level is empty).

Try solving now
02
Round
Easy
Face to Face
Duration60 minutes
Interview date29 May 2015
Coding problem2

Technical round with questions on OS and DSA.

1. Operating System Question

Print "Hello" and "world" multiple times using two threads in java.
Follow up questions : 
-- Why sleep() cannot be used?
– Why have you used synchronized keyword?
– How will a deadlock occur in this program?
– What will be the solution for breaking the deadlock?

Problem approach
public class ThreadSeq 
{

	Object hello = new Object();
	Object world = new Object();

	public static void main(String[] args) throws InterruptedException 
	{
		for(int i=0; i<6;i++)
		{
			Runnable helloTask = new Runnable()
			{
				@Override
				public void run()
				{
					new ThreadSeq().printHello();
				}
			};

			Runnable worldTask = new Runnable()
			{
				@Override
				public void run()
				{
					new ThreadSeq().printWorld();
				}
			};

			Thread t1 = new Thread(helloTask);
			Thread t2 = new Thread(worldTask);
			t1.start();
			t1.join();
			t2.start();
			t2.join();
		}

	}

	public void printHello()
	{
		synchronized (hello) 
		{
			System.out.println("Hello");
		}
	}

	public void printWorld()
	{
		synchronized (world) 
		{
			System.out.println("World");
		}
	}
}

2. Check if a binary tree is subtree of another binary tree

Easy
10m average time
90% success
0/40
Asked in companies
MicrosoftFacebookAmazon

Given two binary trees T and S, check whether tree S has exactly the same structure and node values with a subtree of T, i.e., check if tree S is a subtree of the tree T.

A subtree of a tree T is a tree S consisting of a node in T and all of its descendants in T. The subtree corresponding to the root node is the entire tree; the subtree corresponding to any other node is called a proper subtree.

Problem approach

The recursive approach would be to traverse the tree T in preorder fashion. For every visited node in the traversal, see if the subtree rooted with this node is identical to S.
Time worst-case complexity is O(mn) where m and n are number of nodes in given two trees. 
Auxiliary space : O(n)

The above approach can be optimised to O(n) time complexity. The idea is based on the fact that inorder and preorder/postorder uniquely identify a binary tree. Tree S is a subtree of T if both inorder and preorder traversals of S arew substrings of inorder and preorder traversals of T respectively.
Steps : 
1) Find inorder and preorder traversals of T, store them in two auxiliary arrays inT[] and preT[].
2) Find inorder and preorder traversals of S, store them in two auxiliary arrays inS[] and preS[].
3) If inS[] is a subarray of inT[] and preS[] is a subarray preT[], then S is a subtree of T. Else not.

Try solving now
03
Round
Easy
HR Round
Duration30 minutes
Interview date29 May 2015
Coding problem1

HR round with typical behavioral problems.

1. Basic HR Questions

1. Tell me something about yourself?
2. How were the interviews?
3. How were the interview questions?
4. What are the demerits in SnapDeal?
5. Rank Snap Deal? Suggestions? Questions?

Problem approach

Tip 1 : The cross questioning can go intense some time, think before you speak.

Tip 2 : Be open minded and answer whatever you are thinking, in these rounds I feel it is important to have opinion.

Tip 3 : Context of questions can be switched, pay attention to the details. It is okay to ask questions in these round, like what are the projects currently the company is investing, which team you are mentoring. How all is the work environment etc.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

What is recursion?

Choose another skill to practice
Similar interview experiences
Software Developer
3 rounds | 9 problems
Interviewed by Snapdeal Ltd.
1013 views
0 comments
0 upvotes
Software Developer
4 rounds | 10 problems
Interviewed by Snapdeal Ltd.
651 views
0 comments
0 upvotes
Software Developer
4 rounds | 10 problems
Interviewed by Snapdeal Ltd.
927 views
0 comments
0 upvotes
SDE - 1
3 rounds | 5 problems
Interviewed by Snapdeal Ltd.
985 views
1 comments
0 upvotes
Companies with similar interview experiences
company logo
Software Developer
5 rounds | 14 problems
Interviewed by Microsoft
3931 views
1 comments
0 upvotes
company logo
Software Developer
6 rounds | 12 problems
Interviewed by SAP Labs
2806 views
0 comments
0 upvotes
company logo
Software Developer
3 rounds | 3 problems
Interviewed by Amazon
1134 views
0 comments
0 upvotes