i
Snapdeal
Filter interviews by
I was interviewed before Apr 2021.
Round duration - 60 minutes
Round difficulty - Medium
It’ll range from the very very basics of programming to the toughest of DPs. In between questions were being popped up on your projects. If you’ve some worth-discussing development projects in your resume(like I’ve my BTP and an Android game), substantial amount of time goes in discussing that.
Calculate the Nth term of the Fibonacci series, denoted as F(n), using the formula: F(n) = F(n-1) + F(n-2)
where F(1) = 1
and F(2) = 1
.
The first line of each test...
The recursive approach involves direct implementation of mathematical recurrence formula.
F(n) = F(n-1)+F(n-2)
Pseudocode :
fibonacci(n):
if(n<=1)
return n;
return fibonacci(n-1) + fibonacci(n-2)
This is an exponential approach.
It can be optimized using dynamic programming. Maintain an array that stores all the calculated fibonacci numbers so far and return the nth fibonacci number at last...
Given a Binary Tree consisting of 'N' nodes with integer values, your task is to perform an In-Order traversal of the tree without using recursion.
Inorder traversal requires that we print the leftmost node first and the right most node at the end.
So basically for each node we need to go as far as down and left as possible and then we need to come back and go right. So the steps would be :
1. Start with the root node.
2. Push the node in the stack and visit it's left child.
3. Repeat step 2 while node is not NULL, if it's NULL then pop the topmost n...
Given an array HEIGHTS
of length N
, where each element represents the height of a histogram bar and the width of each bar is 1, determine the area of the largest rec...
Traverse all bars from left to right, maintain a stack of bars. Every bar is pushed to stack once. A bar is popped from stack when a bar of smaller height is seen. When a bar is popped, calculate the area with the popped bar as smallest bar. The current index is the ‘right index’ and index of previous item in stack is the ‘left index’.
Following is the complete algorithm.
1) Create an empty stack.
2) Start fro...
Round duration - 60 minutes
Round difficulty - Hard
Director (search) had come along with the recruitment team this time. So, he was only taking the rounds for all the candidates in this round. Summary, two questions were asked.
After these two, he asked me if I’d any questions for him. I asked about the work culture and what kind of people he was looking for. It’ll give you an idea whether you’re selected or not. Be eager to hear the answer he gives and feel attracted to the prospects he puts forward about the company! AGAIN IMPORTANT, DON’T GIVE UP ANY QUESTION. UNTIL HE DECIDES TO MOVE ON TO THE NEXT. If you’re not able to come up with a solution. Don’t panic. Show your fighting spirit.
You are given an N * N matrix of integers where each row and each column is sorted in increasing order. Your task is to find the positi...
The brute force solution is to traverse the array and to search elements one by one. Run a nested loop, outer loop for row and inner loop for the column
Check every element with x and if the element is found then print “element found”. If the element is not found, then print “element not found”.
Efficient Approach : The idea here is to remove a row or column in each comparison until an element is found. Start searc...
Given an array containing 'N' points in a plane, your task is to find the distance between the closest pair of points.
The distance between two poin...
Algorithm:
1) Sort all points according to x coordinates.
2) Divide all points in two halves.
3) Recursively find the smallest distances in both subarrays.
4) Take the minimum of two smallest distances. Let the minimum be d.
5) Create an array that stores all points which are at most d distance away from the middle line dividing the two sets.
6) Find the smallest distance in the created array.
7) Return the minimum of d...
Round duration - 30 minutes
Round difficulty - Easy
Most Important here is do not fake your personality here. They’re HR guys, they’re trained to catch the fake ones. So, be genuine.
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.
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.
I was interviewed before Apr 2021.
Round duration - 60 minutes
Round difficulty - Medium
Technical Interview round with 2 DSA based questions.
You are provided with a Binary Search Tree (BST) and a target value 'K'. Your task is to determine if there exist two unique elements in the BST such that their sum equals ...
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).
Given a binary tree, compute the zigzag level order traversal of the nodes' values. In a zigzag traversal, start at the root node and traverse from left to right a...
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.&nb...
Round duration - 60 minutes
Round difficulty - Easy
Technical round with questions on OS and DSA.
You are given two binary trees, T and S. Your task is to determine whether tree S is a subtree of tree T, meaning S must match the structure and node values of some subtree i...
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 un...
Round duration - 30 minutes
Round difficulty - Easy
HR round with typical behavioral problems.
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.
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.
I was interviewed before Apr 2021.
Round duration - 60 minutes
Round difficulty - Easy
Technical Interview round with questions based on DSA.
You are given a binary tree consisting of distinct integers and two nodes, X
and Y
. Your task is to find and return the Lowest Common Ancestor (LCA) of these two nodes...
The recursive approach is to traverse the tree in a depth-first manner. The moment you encounter either of the nodes node1 or node2, return the node. The least common ancestor would then be the node for which both the subtree recursions return a non-NULL node. It can also be the node which itself is one of node1 or node2 and for which one of the subtree recursions returns that particular node.
Pseudo code :
LowestCommonA...
You are given a Singly Linked List of integers. Your task is to reverse the Linked List by changing the links between nodes.
The first line of input contai...
This can be solved both: recursively and iteratively.
The recursive approach is more intuitive. First reverse all the nodes after head. Then we need to set head to be the final node in the reversed list. We simply set its next node in the original list (head -> next) to point to it and sets its next to NULL. The recursive approach has a O(N) time complexity and auxiliary space complexity.
For solving the question is c...
Determine if a given singly linked list of integers forms a cycle.
A cycle in a linked list occurs when a node's next reference points back to a previous node in...
Floyd's algorithm can be used to solve this question.
Define two pointers slow and fast. Both point to the head node, fast is twice as fast as slow. There will be no cycle if it reaches the end. Otherwise, it will eventually catch up to the slow pointer somewhere in the cycle.
Let X be the distance from the first node to the node where the cycle begins, and let X+Y be the distance the slow pointer travels. To catch up, t...
Round duration - 45 minutes
Round difficulty - Medium
Technical round with questions on DSA and DBMS.
It is a type of join operation in SQL. Inner join is an operation that returns combined tuples between two or more tables where at least one attribute is in common. If there is no attribute in common between tables then it will return nothing.
Syntax:
select *
from table1 INNER JOIN table2
on table1.column_name = table2.column_name;
It is a type of Join operation in SQL. Outer join is an operation that returns combined tuples from a specified table even if the join condition fails. There are three types of outer join in SQL i.e.
Left Outer Join
Right Outer Join
Full Outer Join
Syntax of Left Outer Join:
select *
from table1 LEFT OUTER JOIN table2
on table1.column_name = table2.column_name;
Given a grid with 'M' rows and 'N' columns, calculate the total number of unique rectangles that can be formed within the grid using its rows and columns.
The firs...
If the grid is 1×1, there is 1 rectangle.
If the grid is 2×1, there will be 2 + 1 = 3 rectangles
If it grid is 3×1, there will be 3 + 2 + 1 = 6 rectangles.
we can say that for N*1 there will be N + (N-1) + (n-2) … + 1 = (N)(N+1)/2 rectangles
If we add one more column to N×1, firstly we will have as many rectangles in the 2nd column as the first,
and then we have that same number of 2×M rectangles.&nb...
Round duration - 40 minutes
Round difficulty - Easy
Technical round with questions on DSA and Puzzles.
1 pick of an eatable is required to correctly label the Jars.
Solution :
You have to pick only one eatable from jar C. Suppose the eatable is a candy, then the jar C contains candies only(because all the jars were mislabeled).
Now, since the jar C has candies only, Jar B can contain sweets or mixture. But, jar B can contain only the mixture because its label reads “sweets” which is wrong.
Therefore, Jar A contains sweets. ...
If we light a stick, it takes 60 minutes to burn completely. What if we light the stick from both sides? It will take exactly half the original time, i.e. 30 minutes to burn completely.
0 minutes – Light stick 1 on both sides and stick 2 on one side.
30 minutes – Stick 1 will be burnt out. Light the other end of stick 2.
45 minutes – Stick 2 will be burnt out. Thus 45 minutes is completely measured.
Given a string STR
and a non-empty string PTR
, your task is to identify all starting indices of PTR
’s anagrams in STR
.
An anagram of a string is another string...
Algorithm :
Define a map m, n := size of s, set left := 0, right := 0, counter := size of p
define an array ans
store the frequency of characters in p into the map m
for right := 0 to n – 1
if m has s[right] and m[s[right]] is non zero, then decrease m[s[right]] by 1, decrease counter by 1 and if counter = 0, then insert left into ans
otherwise
while left < right{
if s[left] is not present in m, then incr...
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.
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.
Snapdeal interview questions for designations
Get interview-ready with Top Snapdeal Interview Questions
Finding lowest common ancestor of two nodes in binary tree
Traverse the tree from root to both nodes and store the paths in separate arrays
Compare the paths to find the last common node
Return the last common node as the lowest common ancestor
Use recursion to traverse the tree efficiently
To find the merging point of two linked lists
Traverse both linked lists and find their lengths
Move the pointer of the longer list by the difference in lengths
Traverse both lists simultaneously until they meet at the merging point
Reverse a linked list iteratively
Create three pointers: prev, curr, and next
Initialize prev to null and curr to head
Loop through the list and set next to curr's next node
Set curr's next node to prev
Move prev and curr one step forward
Return prev as the new head
The number of rectangles in an MxN matrix can be calculated using a formula.
The formula is (M * (M + 1) * N * (N + 1)) / 4
The matrix can be divided into smaller sub-matrices to count the rectangles
The number of rectangles can also be calculated by counting all possible pairs of rows and columns
The number is 7744.
The number must end in 00 or 44.
The square root of the number must be a whole number.
The only possible number is 7744.
I am a software developer with experience in multiple programming languages and a passion for problem-solving.
Proficient in Java, Python, and C++
Experience with web development using HTML, CSS, and JavaScript
Familiarity with agile development methodologies
Strong problem-solving and analytical skills
Passionate about learning new technologies and staying up-to-date with industry trends
Java function to return subnet mask of IP and URL after www.
Read the file and store IP addresses and URLs in separate arrays
Use regex to extract subnet mask from IP address
Use substring to extract URL after www.
Return subnet mask and URL as separate strings
Inner join returns only the matching rows between two tables, while outer join returns all rows from one table and matching rows from the other.
Inner join combines rows from two tables based on a matching column.
Outer join returns all rows from one table and matching rows from the other.
Left outer join returns all rows from the left table and matching rows from the right table.
Right outer join returns all rows from the...
To find the length of non-looped linked list, we need to traverse the list and count the number of nodes.
Traverse the linked list using a pointer and count the number of nodes until the end of the list is reached.
If a loop is encountered, break out of the loop and continue counting until the end of the list.
Return the count as the length of the non-looped linked list.
A program to check if a number is a palindrome or not.
Convert the number to a string
Reverse the string
Compare the original and reversed string
If they are the same, the number is a palindrome
For Snapdeal's shoe section, I would design a DBMS with separate entities for Sports and Casual Shoes.
Create a main entity for shoes with attributes like brand, size, color, etc.
Create separate entities for Sports and Casual Shoes with attributes specific to each category.
Link the Sports and Casual Shoe entities to the main Shoe entity using a foreign key.
Use indexing and normalization techniques to optimize performanc...
DNS servers translate domain names into IP addresses to enable communication between devices on the internet.
DNS servers act as a phone book for the internet, translating domain names into IP addresses.
When a user types a domain name into their browser, the browser sends a request to a DNS server to resolve the domain name into an IP address.
DNS servers operate in a hierarchical system, with root servers at the top, fo...
Merge two sorted arrays into one sorted array of larger size
Create a new array of size m+n
Compare the last elements of both arrays and insert the larger one at the end of the new array
Repeat until all elements are merged
If any elements are left in the smaller array, insert them at the beginning of the new array
Time complexity: O(m+n)
Example: arr1=[1,3,5,7,0,0,0], arr2=[2,4,6], output=[1,2,3,4,5,6,7]
To find square root of a number, use Math.sqrt() function in JavaScript.
Use Math.sqrt() function in JavaScript to find square root of a number.
For example, Math.sqrt(16) will return 4.
If the number is negative, Math.sqrt() will return NaN.
Algorithm to find LCM of all numbers from 1 to n and its time complexity
Find prime factors of all numbers from 1 to n
For each prime factor, find the highest power it appears in any number from 1 to n
Multiply all prime factors raised to their highest power to get LCM
Time complexity: O(n*log(log(n)))
NoSQL databases are flexible, scalable, and can handle large amounts of unstructured data.
NoSQL databases are schema-less, allowing for easy and flexible data modeling.
They can handle large amounts of unstructured data, making them suitable for big data applications.
NoSQL databases are highly scalable and can easily handle high traffic and large user bases.
They provide horizontal scalability by distributing data across...
The question asks to find the count of words in a dictionary that can be formed by a given number.
Iterate through each word in the dictionary
Check if the characters in the word can be formed using the given number
Increment the count if the word can be formed
Top trending discussions
Some of the top questions asked at the Snapdeal Software Developer interview -
based on 1 interview
3 Interview rounds
based on 8 reviews
Rating in categories
Assistant Manager
104
salaries
| ₹4 L/yr - ₹12 L/yr |
Category Manager
94
salaries
| ₹6.9 L/yr - ₹24 L/yr |
Senior Executive
89
salaries
| ₹2.8 L/yr - ₹6.6 L/yr |
Deputy Manager
59
salaries
| ₹5.2 L/yr - ₹15 L/yr |
Associate Category Manager
50
salaries
| ₹5.8 L/yr - ₹17.6 L/yr |
Flipkart
Amazon
Meesho
eBay