Add office photos
Employer?
Claim Account for FREE

Hike

3.6
based on 56 Reviews
Filter interviews by

10+ Distributors Basket (gala) Interview Questions and Answers

Updated 21 Feb 2025
Popular Designations

Q1. Given a cartesian x-y plane and lot of points in that plane with x and y coordinates and 1 more point(say x,y) is given, so we have to find all the points in that plane which are lying in a radius of length r f...

read more
Ans.

Given a point and a radius, find all points in a cartesian plane within the radius.

  • Calculate the distance between the given point and all other points in the plane using the distance formula.

  • If the distance is less than or equal to the radius, add the point to the result set.

  • Return the result set of points within the radius of the given point.

Add your answer

Q2. how you will find out 3rd smallest element from an array

Ans.

To find the 3rd smallest element from an array, sort the array and return the element at index 2.

  • Sort the array in ascending order

  • Return the element at index 2

  • If the array has less than 3 elements, return null

Add your answer

Q3. Designing a LRU Cache which is thread safe and can be scaled

Ans.

Design a thread-safe LRU cache that can be scaled.

  • Use a ConcurrentHashMap to ensure thread safety.

  • Implement a doubly linked list to keep track of the least recently used items.

  • Use a HashMap to store the cache items for fast retrieval.

  • Implement a size limit for the cache and remove the least recently used item when the limit is reached.

  • To scale the cache, use a distributed cache like Redis or Memcached.

Add your answer

Q4. Write code to get maximum and second maximum element of a stack. The given function should be in O(1) complexity

Ans.

Code to get max and second max element of a stack in O(1) complexity.

  • Create two variables to store max and second max values

  • Update the variables whenever a new element is pushed or popped from the stack

  • Return the max and second max values when required

Add your answer
Discover Distributors Basket (gala) interview dos and don'ts from real experiences

Q5. Given a biotonic array ( first numbers increase and then decrease ) write code to search a given number. Time complexity O(logn)

Ans.

Code to search a given number in a biotonic array with O(logn) time complexity.

  • Use binary search to find the peak element in the array.

  • Divide the array into two subarrays and perform binary search on each subarray.

  • Return the index of the element if found, else return -1.

Add your answer

Q6. How does Stack work internally and what data it holds?

Ans.

Stack is a data structure that follows LIFO (Last In First Out) principle.

  • Stack holds a collection of elements

  • It has two main operations: push (adds element to top) and pop (removes element from top)

  • It also has peek operation (returns top element without removing it)

  • Stack can be implemented using arrays or linked lists

  • Examples: undo-redo functionality in text editors, back-forward navigation in web browsers

Add your answer
Are these interview questions helpful?

Q7. A sorted array is rotated K times. Sort it in o(n) traversal without extra space

Ans.

Sort a rotated sorted array in O(n) time without extra space

  • Find the index of the minimum element using binary search

  • Reverse the two subarrays on either side of the minimum element

  • Reverse the entire array

  • Example: [4,5,6,7,0,1,2] -> [0,1,2,4,5,6,7]

Add your answer

Q8. do you know spell checker in micro soft word

Ans.

Yes, spell checker is a built-in feature in Microsoft Word.

  • Spell checker automatically checks for spelling errors as you type.

  • It underlines misspelled words in red and suggests corrections.

  • You can also customize the spell checker settings and add words to the dictionary.

  • To access the spell checker, go to the Review tab and click on Spelling & Grammar.

  • Alternatively, you can use the shortcut key F7 to run the spell checker.

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. two pair with a given sum in a bst with o(log n) space

Ans.

Finding two pairs with a given sum in a BST using O(log n) space.

  • Traverse the BST in-order and store the nodes in an array

  • Use two pointers approach to find the pairs with the given sum

  • Time complexity: O(n), Space complexity: O(log n)

  • Optimized approach: Use two stacks to traverse the BST in-order and find the pairs

  • Time complexity: O(log n), Space complexity: O(log n)

Add your answer

Q10. K random numbers from infinite stream of array with equal probability

Ans.

To select k random numbers from an infinite stream of array with equal probability.

  • Use reservoir sampling algorithm to randomly select k numbers from the stream

  • Maintain a reservoir array of size k to store the selected numbers

  • For each incoming number, generate a random number between 0 and the total count of numbers seen so far

  • If the generated number is less than k, replace the corresponding number in the reservoir array with the incoming number

  • At the end, the reservoir array...read more

Add your answer

Q11. How to analyze usage history of a application

Ans.

Usage history of an application can be analyzed by tracking user actions and behavior.

  • Collect data on user interactions with the application

  • Analyze the frequency and duration of usage

  • Identify patterns and trends in user behavior

  • Use data visualization tools to present findings

  • Consider user feedback and reviews for additional insights

Add your answer

Q12. Designing a file sharing mechanism between two users

Ans.

Design a file sharing mechanism between two users

  • Use a secure protocol like HTTPS or SFTP

  • Implement access control to ensure only authorized users can access the files

  • Consider implementing encryption to protect the files during transit and at rest

  • Provide a user-friendly interface for uploading and downloading files

  • Implement version control to track changes made to the files

  • Consider implementing a notification system to alert users of new file uploads or changes

Add your answer

Q13. Implement Inorder Traversal with and without using recursion

Ans.

Inorder Traversal can be implemented using recursion or without recursion.

  • Inorder Traversal using recursion involves traversing the left subtree, visiting the root node, and then traversing the right subtree.

  • Inorder Traversal without recursion involves using a stack to keep track of the nodes to be visited.

  • For each node, push it onto the stack and traverse its left subtree until there are no more left nodes.

  • Pop the top node from the stack, visit it, and then traverse its righ...read more

Add your answer

Q14. Reverse alternate levels of a binary tree

Ans.

Reverse alternate levels of a binary tree

  • Traverse the tree level by level

  • Reverse the nodes of alternate levels

  • Use a queue or stack to keep track of nodes at each level

  • Recursively apply the same process to the children of reversed nodes

Add your answer

Q15. Why manhole is round ?

Ans.

Manholes are round because it prevents them from falling into the hole and allows for easy movement of the cover.

  • Round covers cannot fall into the hole as they cannot fit through diagonally

  • Round covers can be easily moved in any direction

  • Round shape distributes weight evenly

  • Round shape is easier to manufacture and install

Add your answer

Q16. Explain the architecture of transformer models.

Add your answer

Q17. Median of a stream of array

Ans.

Finding the median of a stream of array in real-time.

  • Use two heaps to keep track of the median

  • Maintain a max heap for the lower half and a min heap for the upper half

  • If the heaps are balanced, the median is the average of the top elements of both heaps

  • If the heaps are unbalanced, the median is the top element of the heap with more elements

Add your answer

Q18. Lru Cache leet problem in deep

Ans.

Implement a Least Recently Used (LRU) cache

  • Use a combination of a doubly linked list and a hashmap to efficiently implement the LRU cache

  • When a new element is accessed, move it to the front of the linked list and update the hashmap

  • When the cache is full, remove the least recently used element from the end of the linked list and the hashmap

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Distributors Basket (gala)

based on 10 interviews
Interview experience
4.0
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

3.5
 • 448 Interview Questions
3.7
 • 305 Interview Questions
4.1
 • 162 Interview Questions
4.1
 • 149 Interview Questions
4.1
 • 142 Interview Questions
View all
Top Hike Interview Questions And Answers
Share an Interview
Stay ahead in your career. Get AmbitionBox app
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