Panda Guru LogoPanda
Guru

Flipkart | SDE 3 | Banglore | December 2024 [Reject]

Round 1 (DSA)

Questions:

Question 1:

Design a map that allows you to do the following:

Question 2:

You have “n” empty baskets, you are given the position of the empty baskets in an array called "position", where position[i] specifies the position of the ith basket. Additionally, you have m balls to be distributed among the n baskets. You have to distribute the m balls into n baskets such that the minimum magnetic force between any two balls is maximum. The magnetic force between two different balls at position x and y is defined as |x-y|.

Candidate's Approach:

Candidate's Approach

Solved using Trie for Question 1 and Binary Search for Question 2.

Interviewer's Feedback

No feedback provided.


Round 2 (Machine Coding)

Questions: Food ordering system Description: Implement an online food ordering system. Below are the expected features of the system.

Features:

  1. This system has tie-ups with restaurants, each with a menu with all the items at their prices.
  2. Each restaurant has a maximum processing capacity (food preparation and dispatch) of items at any given time. It will not accept any further item requests until items in processing are completed.
  3. Each restaurant takes some time to prepare and dispatch food. Once the item is fulfilled the system gets the notification of it which adds back to the processing capacity of that restaurant.
  4. One or multiple restaurants can be selected based on the restaurant selection strategy.
  5. Order is accepted from customers only if all the items can be fulfilled by one or more restaurants.

Requirements:

  1. Onboard new restaurant with its menu and item processing capacity. The menu should be reflected in the food ordering system.
  2. A restaurant should be able to change its menu.
  3. Customers should be able to place an order by giving items. We can assume that each item will be of only 1 quantity.
  4. Restaurants should be selected based on the lowest price offered by the restaurant for that item.
  5. The system should be able to keep track of all items served by each restaurant, and the system should be aware of the remaining capacity of each restaurant at a given time.
  6. Once the order is fulfilled by the restaurant, the capacity should be replenished for the given restaurant.

Test-cases:

  1. add_restaurant("A2B", [Idly for 40Rs, Vada for 30Rs, Paper Plain Dosa for 50Rs], 4)
  2. add_restaurant("Rasaganga", [Idly for 45Rs, Set Dosa for 60Rs, Poori for 25Rs], 6)
  3. add_restaurant("Eat Fit", [Idly 30Rs, Vada for 40Rs], 2)
  4. order(["Idly", "Poori"])
    1. output: Order Id#1: Ordered from "Eat Fit" & "Rasaganga"
  5. order(["Idly", "Vada"])
    1. output: Order Id#2 : Ordered from "Eat Fit" & "A2B"
  6. Print system stats:
    1. output (Restaurant name and current processing power):
      1. A2B: 3
      2. Rasaganga: 5
      3. Eat Fit: 0
  7. order(["Idly"])
    1. output: Ordered from "A2B" ("Eat Fit" was not selected since there was no further capacity left)
  8. fulfilled_item_for_restaurant("Order Id#1")
  9. Print system stats:
    1. output (Restaurant name and current processing power):
      1. A2B: 2
      2. Rasaganga: 6
      3. Eat Fit: 1
  10. fulfilled_item_for_restaurant("#2")
  11. change_menu("Eat Fit", [Idly 60Rs, Vada for 40Rs], 2)
  12. order(["Idly"])
    1. output: Ordered from "A2B"

Candidate's Approach:

Candidate's Approach

The follow-up discussion on the Machine coding round didn’t go well, as it was one of my early machine coding rounds.

Interviewer's Feedback

No feedback provided.


Overall Verdict: No Hire

Microsoft Interview Experience
Linkedin Interview Experience
Groupon Interview Experience
Allen Interview Experience