SnapDeal interview questions

300 questions from 24 interviews · updated from reports 2014-2021

Practise SnapDeal-style

About

Snapdeal is an Indian e-commerce marketplace where customers buy products across categories from third-party sellers. In India, it is known to hire for technical roles such as software engineer, SDET, and Android developer.

The roles that come up most are Software Engineer, SDET and Android Developer. This covers 24 candidate interviews reported from 2014 to 2021. Most sat it at entry level (17 of 24 that recorded a level), with 2 internship interviews alongside. Among the 17 that recorded either route, arrivals split between campus drives (14, 82%) and off-campus applications (3, 18%). Most questions fall under CS fundamentals and DSA.

Category
Difficulty
Round

Interview questions

Q. Find the next greater number using the same set of digits.

asked 3xmediumArraysOnline test2015

Ans. Scan digits from right to left to find the first digit smaller than the digit after it. Swap it with the smallest larger digit to its right, then sort or reverse the suffix into ascending order. If no such digit exists, no greater number is possible. This is the next permutation algorithm, O(n) time.

Q. Check whether a given binary tree is a Binary Search Tree (BST).

asked 3xmediumTreesTechnical2015

Ans. Check it by traversing the tree recursively with an allowed value range for each node. The root can have an infinite range; the left child must be less than the node, and the right child greater. Use the call stack as the data structure. Time complexity is O(n), space is O(h).

Q. Given coordinates of two line segments A(x1,y1,x2,y2) and B(x3,y3,x4,y4), determine whether the two segments intersect

asked 3xmediumGeometryOnline test2015

Ans. Use the orientation test on the four point triples to decide if the segments cross. Compute orientations of (p1,p2,p3), (p1,p2,p4), (p3,p4,p1), and (p3,p4,p2). They intersect if the orientations differ on both sides, or if any collinear point lies within the other segment’s bounding box. Time complexity is O(1).

Q. Find the diameter of a binary tree.

asked 2xmediumTreesTechnical2015

Ans. Use a postorder DFS that returns the height of each subtree and updates a global maximum diameter at every node. For each node, the longest path through it is left height plus right height, measured in edges. Visit each node once, so the time complexity is O(n), with O(h) recursion stack space.

Q. Find the next greater number with the same set of digits as the given number.

asked 2xmediumArraysOnline test2015

Ans. Scan digits from right to left to find the first digit smaller than the digit after it. Swap it with the smallest larger digit to its right, then sort or reverse the suffix into ascending order. If no such digit exists, no greater number is possible. This is the next permutation, taking O(n) time.

Q. Explain exception handling in Java.

asked 2xeasyOOPTechnical2017-2019

Ans. Exception handling in Java is a mechanism for dealing with runtime errors without abruptly stopping normal program flow. Risky code is placed in a try block, errors are handled in catch blocks, and cleanup goes in finally. Java has checked exceptions, which must be caught or declared, and unchecked exceptions.

Q. What are SQL joins and why do we use joins?

asked 2xeasySQLTechnical2020

Ans. SQL joins combine rows from two or more tables using a related column, such as a customer ID or department ID. We use joins because relational databases store data in separate tables to reduce duplication and keep data consistent. Common join types include inner join, left join, right join and full outer join.

Q. How do you create a user-defined exception in Java?

asked 2xeasyOOPTechnical2017-2019

Ans. Create a user-defined exception in Java by defining a class that extends Exception or RuntimeException. Extend Exception for a checked exception that callers must handle or declare, and RuntimeException for an unchecked one. Usually you add constructors that accept a message and optionally a cause, then throw it with throw.

Q. Check whether an expression has balanced parentheses

asked 2xeasyStackOnline test, Technical2015

Ans. Use a stack to scan the expression from left to right and verify that every closing bracket matches the most recent unmatched opening bracket. Push opening brackets, pop and compare on closing brackets, and ignore other characters. The expression is balanced only if no mismatch occurs and the stack is empty at the end. This runs in O(n) time.

Q. What are the different data types used in R language?

asked 2xeasyProgrammingTechnical2020

Ans. R mainly uses logical, integer, numeric or double, complex, character and raw data types. The most important detail is that R stores these as vectors by default, even for a single value. Common higher-level structures include lists, factors, matrices, arrays and data frames, which are built from these basic types.

Q. Explain the difference between a Process and a Thread.

asked 2xeasyOperating systemsTechnical2015

Ans. A process is an independent running program with its own memory space, while a thread is a smaller unit of execution within a process that shares that process’s memory. Processes are more isolated and cost more to create or switch between. Threads are lighter, but shared memory makes synchronisation and race conditions important.

Q. Explain the Java String Pool.

asked 1xmediumOOPTechnical2021

Ans. The Java String Pool is a special area on the heap where Java stores unique String literals. When the same literal appears again, Java reuses the existing String object instead of creating a new one. This saves memory, but it also means == may be true for pooled strings, while equals checks content.

Q. Sort a partially sorted array.

asked 1xmediumArraysTechnical2019

Ans. Use a min-heap to sort a k-sorted array, where every element is at most k positions from its final sorted position. Put the first k plus 1 elements in the heap, repeatedly extract the minimum into the output, and insert the next array element. This takes O(n log k) time and O(k) space.

Q. Find the top view of a binary tree.

asked 1xmediumTreesTechnical2019

Ans. Use level order traversal with a horizontal distance for each node, root at 0, left child minus 1 and right child plus 1. Store the first node seen at each horizontal distance in a map, since BFS sees topmost nodes first. Finally output map values by increasing distance. Time is O(n log n), or O(n) with ordered handling.

Q. How does caching work in Hibernate?

asked 1xmediumDBMSTechnical2019

Ans. Hibernate caches entities to avoid repeated database reads, mainly through the first-level cache in each Session. It stores loaded entities by identifier and returns the same object within that session. An optional second-level cache can share entity data across sessions, and a query cache can store query result identifiers when explicitly enabled.

Q. Print the power set of a given set.

asked 1xmediumBacktrackingOnline test2015

Ans. Generate all subsets by making a include or exclude choice for each element. Use backtracking with an index and a current list, printing the list when the index reaches the end. There are 2^n subsets, so time is O(n · 2^n) and space is O(n) excluding output.

Q. Explain tree balancing and AVL trees

asked 1xmediumTreesTechnical2016

Ans. Tree balancing keeps a binary search tree’s height small so search, insert and delete stay efficient. An AVL tree is a self-balancing BST where each node’s left and right subtree heights differ by at most one. After updates, it restores balance using rotations, giving O(log n) operations.

Q. Implement a stack using only one queue.

asked 1xmediumStacksTechnical2015

Ans. Use one queue by making each push place the new element at the front. Enqueue the new value, then rotate the previous elements by dequeuing and enqueuing them again. This keeps the stack top at the queue front, so pop and top are O(1), while push is O(n).

Q. Explain cache implementation strategies.

asked 1xmediumOperating systemsTechnical2015

Ans. Cache implementation strategies decide how items are stored, found, evicted, and updated. A common software cache uses a hash map for O(1) lookup plus a linked list or priority structure for eviction policies such as LRU, LFU, FIFO, or TTL. Important choices include size limits, invalidation, write-through versus write-back, and concurrency control.

Q. Implement Merge Sort for an integer array.

asked 1xmediumSortingTechnical2015

Ans. Split the integer array into two halves recursively until each part has one element, then merge pairs of sorted parts back together in order. Use a temporary array during merging to store the sorted result before copying back. Merge sort runs in O(n log n) time and uses O(n) extra space.

Q. Reverse a linked list in groups of size k.

asked 1xmediumLinked listsTechnical2014

Ans. Reverse each block of k nodes by rewiring next pointers, then connect the previous block’s tail to the new head of the reversed block. Use three pointers to reverse a block in place, and first check that k nodes remain if partial groups should stay unchanged. Time complexity is O(n), space complexity is O(1).

Q. Design and write test cases for Google Maps.

asked 1xmediumOOPManagerial2017

Ans. Test Google Maps across search, routing, navigation, location, UI, performance, and reliability. Verify place search, autocomplete, map zoom, current location permission, route options, ETA, rerouting, traffic updates, offline behaviour, wrong inputs, accessibility, and different devices. The most important detail is validating accuracy and graceful failure under poor GPS or network conditions.

Q. Explain WSDL syntactically and semantically.

asked 1xmediumNetworkingTechnical2019

Ans. Syntactically, WSDL is an XML document that describes a web service using elements such as types, messages, port types, bindings, and service endpoints. Semantically, it defines what operations the service offers, what input and output data they use, how messages are transported, and where clients can access the service.

Q. Search an element in a rotated sorted array.

asked 1xmediumBinary searchTechnical2014

Ans. Use a modified binary search: compare the middle element with the ends to decide which half is sorted, then check whether the target lies inside that sorted half. If it does, search there, otherwise search the other half. For distinct elements, this takes O(log n) time and O(1) space.

Q. Find the left or right view of a binary tree.

asked 1xmediumTreesTechnical2015

Ans. Use level order traversal and record one node per level: the first node seen for the left view, or the last node seen for the right view. Use a queue for breadth first search, processing nodes level by level. The time complexity is O(n), and the space complexity is O(w), where w is tree width.

Q. How do you create a clustered index in MySQL?

asked 1xmediumDBMSTechnical2021

Ans. Create a clustered index in MySQL by defining a primary key on an InnoDB table, either when creating the table or later with an alter table statement. InnoDB stores the table rows physically organised by the primary key, so there is only one clustered index per table.

Q. Implement an LRU (Least Recently Used) cache.

asked 1xmediumDesignTechnical2015

Ans. Use a hash map plus a doubly linked list. The map gives O(1) access to cache nodes by key, and the list keeps usage order, with most recent at the front and least recent at the back. On get or put, move the node to the front. When capacity is exceeded, remove the back node.

Q. Convert a Binary Tree to a Doubly Linked List.

asked 1xmediumTreesTechnical2015

Ans. Use an inorder traversal and relink nodes as you visit them, treating left as previous and right as next. Keep two pointers: head for the first node and prev for the last processed node. For each visited node, connect prev.right to it and it.left to prev. Time is O(n), space is O(h).

Q. Print the boundary traversal of a binary tree.

asked 1xmediumTreesTechnical2015

Ans. Print the root, then the left boundary excluding leaves, then all leaves left to right, then the right boundary excluding leaves in reverse. Use recursive or iterative tree traversal, storing the right boundary in a stack or list before reversing. This avoids duplicates. Time complexity is O(n), with O(h) recursion space.

Q. What is profiling in Spring and how is it used?

asked 1xmediumOOPTechnical2019

Ans. Profiling in Spring means using Spring Profiles to enable different beans or configuration for different environments, such as dev, test, or production. You mark beans or configuration with @Profile and activate one or more profiles using spring.profiles.active, environment variables, command-line arguments, or application properties.

Q. Explain the request-response flow in Spring MVC.

asked 1xmediumOOPTechnical2019

Ans. In Spring MVC, every request first reaches the DispatcherServlet, which acts as the front controller. It uses HandlerMapping to find the right controller, calls it through a handler adapter, receives a model and view, resolves the view using ViewResolver, renders it, and sends the HTTP response back.

Q. Find the intersection point of two linked lists.

asked 1xmediumLinked listsTechnical2015

Ans. Use two pointers, one on each list, and advance them one node at a time; when a pointer reaches the end, move it to the head of the other list. If the lists intersect, the pointers meet at the intersection node after equalised traversal. This uses constant extra space and runs in O(m + n) time.

Q. How do annotations work in the Jersey framework?

asked 1xmediumOOPTechnical2021

Ans. Annotations in Jersey declare how Java classes and methods become REST endpoints. Jersey scans resource classes, reads JAX-RS annotations such as @Path, @GET, @POST, @Produces and @Consumes, then maps incoming HTTP requests to the matching method. The key point is that annotations provide metadata, while Jersey handles routing, binding and response conversion.

Q. What are generics in Java and why are they used?

asked 1xmediumOOPTechnical2019

Ans. Generics in Java let classes, interfaces and methods work with types specified as parameters, such as a list of strings. They are used to provide compile time type safety, reduce casting, and make reusable code clearer. The key point is that most generic type information is removed at runtime through type erasure.

Q. What is Apache Kafka and when should it be used?

asked 1xmediumSystem designTechnical2019

Ans. Apache Kafka is a distributed event streaming platform used to publish, store, and process streams of records in real time. It should be used when systems need scalable, durable, high-throughput messaging, such as event-driven architectures, log aggregation, data pipelines, analytics, and decoupling services that produce and consume events independently.

Q. Explain Java Util package classes and their usage

asked 1xmediumOOPTechnical2016

Ans. Java util provides general purpose utility classes for data structures, algorithms, dates, random numbers, input parsing and helper operations. Common classes include ArrayList, LinkedList, HashMap, HashSet, Collections, Arrays, Scanner, Random, Date, Calendar, Optional and UUID. The most important usage is the Collections Framework, which stores, searches, sorts and manages groups of objects efficiently.

Q. Explain table indexing and database partitioning.

asked 1xmediumDBMSTechnical2021

Ans. Table indexing creates a separate data structure, commonly a B-tree or hash index, to find rows faster without scanning the whole table. Database partitioning splits a large table into smaller physical parts by range, list, hash, or key. Indexes improve lookup speed, while partitioning improves manageability and can reduce scanned data.

Q. Design and write test cases for Google Translator.

asked 1xmediumOOPManagerial2017

Ans. Test Google Translator by covering language selection, text input, translation accuracy, formatting, speech, camera, offline mode, and error handling. Include cases for empty text, very long text, slang, idioms, mixed languages, special characters, right-to-left scripts, copied output, network loss, unsupported languages, slow responses, and privacy of submitted text.

Q. Explain Heap Tree data structure and its operations

asked 1xmediumHeapsTechnical2016

Ans. A heap is a complete binary tree where each parent has priority over its children, usually min-heap or max-heap. It is commonly stored in an array, which makes parent and child indexing efficient. Insert adds at the end then bubbles up. Extract removes the root then heapifies down. Both take O(log n), peek is O(1).

Q. Explain Trie data structure and related operations.

asked 1xmediumTreesTechnical2015

Ans. A Trie is a tree used to store strings, where each edge represents a character and paths from the root form words or prefixes. Insert and search process one character at a time, creating or following child links. Prefix search is similar. These operations take O(L) time, where L is the string length.

Q. Explain different hashing algorithms and techniques

asked 1xmediumDBMSTechnical2016

Ans. Hashing maps a key to an array index using a hash function, then handles collisions when keys map to the same index. Common algorithms include division, multiplication, universal hashing, and cryptographic hashes like SHA. Collision techniques include separate chaining and open addressing with linear probing, quadratic probing, or double hashing. Load factor controls resizing and performance.

Q. Explain the difference between NIO and BIO in Java.

asked 1xmediumOOPTechnical2021

Ans. BIO is blocking I/O, where each read or write waits until it completes, while NIO is non-blocking I/O, allowing a thread to manage many channels using selectors. The key difference is scalability: BIO often needs one thread per connection, but NIO can handle many connections with fewer threads.

Q. Solve problems based on Linked List data structure.

asked 1xmediumLinked listsSystem design2019

Ans. Use pointer manipulation to traverse, insert, delete, reverse, or detect cycles in a linked list without losing node references. The key detail is to keep track of previous, current, and next nodes carefully. Most linked list problems run in O(n) time and O(1) extra space.

Q. Explain HashMap in Java and how it works internally.

asked 1xmediumOOPTechnical2021

Ans. A Java HashMap stores key value pairs in an array of buckets, using the key’s hashCode to choose a bucket and equals to find the exact key. Collisions are handled by a linked list, or a balanced tree after enough entries. It resizes when the load factor threshold is crossed, giving average constant time operations.

Q. Explain virtual constructors and destructors in C++.

asked 1xmediumOOPTechnical2015

Ans. C++ has no true virtual constructors, but the idea is usually implemented with a virtual clone function or factory that creates the right derived type. Destructors can and should be virtual in polymorphic base classes, so deleting an object through a base pointer calls the derived destructor first and releases resources correctly.

Q. Find the total number of rectangles in a chessboard.

asked 1xmediumMathHR2015

Ans. A chessboard contains 1296 rectangles in total. An 8 by 8 board has 9 vertical grid lines and 9 horizontal grid lines. Any rectangle is formed by choosing 2 vertical lines and 2 horizontal lines. So the count is 9C2 × 9C2 = 36 × 36 = 1296.

Q. Find a triplet in an array that sums to a given value.

asked 1xmediumArraysTechnical2015

Ans. Sort the array, then fix each element in turn and use two pointers on the remaining suffix to find the other two values. If the current sum is too small, move the left pointer right; if too large, move the right pointer left. This uses no extra data structure and runs in O(n²) time.

Q. Explain how to create sequences and indexes in MongoDB.

asked 1xmediumDBMSTechnical2017

Ans. MongoDB creates indexes with createIndex on a collection field, while sequences are usually simulated with a counters collection and an atomic increment operation. The key detail is that MongoDB does not provide traditional auto-increment sequences by default, so you use ObjectId unless you specifically need numeric, ordered IDs.

Q. Explain normalization and denormalization in databases.

asked 1xmediumDBMSTechnical2015

Ans. Normalization structures a database to reduce duplication and avoid update anomalies, usually by splitting data into related tables with keys. Denormalization deliberately adds redundancy, such as copied fields or precomputed summaries, to make reads simpler or faster. The key trade-off is data integrity and storage versus query performance.

Q. Solve the coin change problem using dynamic programming.

asked 1xmediumDynamic programmingTechnical2014

Ans. Use a one-dimensional DP array where dp[x] stores the minimum number of coins needed to make amount x. Initialise dp[0] to 0 and all other entries to infinity, then for each amount try every coin and update dp[x]. The answer is dp[amount], or -1 if unreachable. Time is O(amount × coins), space is O(amount).

Q. Estimate how many students go to Kota for coaching every year.

asked 1xmediumLogical reasoningTechnical2020

Ans. Around 2 to 3 lakh students go to Kota for coaching each year. I would estimate this by listing major institutes, approximating batches, classroom capacity and batch cycles, then adding smaller centres. I would cross-check with hostel and paying guest capacity, since most students come from outside and need accommodation.

Q. What key points should be considered while designing a REST endpoint?

asked 1xmediumApi designTechnical2019

Ans. Design a REST endpoint around a clear resource, correct HTTP method, predictable URL, request and response schema, status codes, authentication, authorisation, validation, pagination, idempotency, caching and versioning. The most important detail is to make the contract explicit and stable, so clients know exactly what to send, what they get back, and how errors behave.

Q. Develop REST APIs for adding, fetching, updating, and deleting bookmarks.

asked 1xmediumRest apiSystem design2015

Ans. Expose /bookmarks with POST to add, GET to list, GET /bookmarks/{id} to fetch, PATCH or PUT /bookmarks/{id} to update, and DELETE /bookmarks/{id} to remove. Store userId, URL, title, tags, createdAt, updatedAt, and enforce authentication so users can only access their own bookmarks.

Q. Design an e-commerce recommendation system that recommends items to users.

asked 1xmediumLow level designTechnical2015

Ans. Build a two-stage recommendation system: generate candidate items from user behaviour, similar users and popular products, then rank them with a model using user, item and context features. The key detail is feedback data quality: track views, clicks, carts, purchases and negatives, then retrain regularly while serving low-latency cached recommendations with fallback popular items.

Q. If your colleague is slow in catching up and the deadline is fast approaching, what will you do?

asked 1xmediumTeamworkHR2014

Ans. Pick a real example where you protected the deadline without blaming the colleague. Emphasise clarifying the gap, offering focused help, reprioritising tasks, and escalating early if risk remained. Interviewers listen for teamwork, ownership, calm communication, and judgement: you support others, but you also keep the project and customer commitments visible.

Q. Given a biased coin with P(Head)=0.6 and P(Tail)=0.4, suggest a method to make the outcomes unbiased.

asked 1xmediumProbabilityTechnical2015

Ans. Flip the coin twice. If the result is HT, output Head; if it is TH, output Tail; if it is HH or TT, discard and repeat. This is unbiased because P(HT)=0.6×0.4=0.24 and P(TH)=0.4×0.6=0.24, so the two accepted outcomes are equally likely.

Q. Your manager has high expectations from you, but assigns a task that you are unable to understand despite trying hard. What will you do?

asked 1xmediumProblem solvingHR2014

Ans. Pick a real example where you first tried to understand the task independently, then asked clear, specific questions. Emphasise ownership, not helplessness. Mention confirming priorities, expected output, deadlines, and success criteria. Interviewers listen for humility, communication, problem solving, and the ability to protect delivery without hiding confusion.

Q. Solve the puzzle of 3 couples crossing a river with constraints.

asked 1xhardLogical reasoningTechnical2015

Ans. Label couples H1/W1, H2/W2, H3/W3. Send W1W2, W1 back, W1W3, W1 back, H2H3, H2W2 back, H1H2, W3 back, W1W2, W2 back, W2W3. At every step, any wife sharing a bank with another husband has her own husband there. Thus all three couples cross safely in eleven crossings.

Q. Solve the 25 horses puzzle to find the fastest 3 horses with minimum races.

asked 1xhardLogical reasoningTechnical2015

Ans. Minimum is 7 races. Race the 25 horses in 5 groups of 5. Race the 5 group winners. The winner of that race is fastest overall. Only possible second and third are from the winner’s group top three, the runner-up’s group top two, and the third-place group winner. Race those 5 candidates to find second and third.

Q. How does an e-commerce website earn money?

asked 1xeasyBusiness understandingTechnical2020

Ans. A strong answer explains the main revenue model clearly, such as selling products at a margin, taking commission from third-party sellers, charging delivery or subscription fees, and earning from advertising. Pick a familiar example, emphasise unit economics, customer acquisition cost, repeat purchase, conversion rate, and profit after fulfilment. Interviewers listen for commercial awareness.

Showing 60 of 300 questions. Ranked by how often the same question came back across interviews.

Practise a SnapDeal-style interview

A spoken interview built from these questions, scored when you finish; the feedback is yours.

Start practising

When you are ready, record The One: a single interview hiring teams watch, so you stop repeating first rounds.

Common questions

What questions does SnapDeal ask?

Candidate interviews most often cover CS fundamentals (46%) and DSA (43%).

How many rounds does SnapDeal interview have?

Candidate interviews show an average of 4.3 rounds per experience, with a typical sequence of Online test → Technical → Technical → HR. Individual interview paths can vary.

Is the SnapDeal interview hard?

Among questions with a recorded difficulty, the mix is easy 33%, medium 56%, hard 11%.