TESCO
Summary
I attended a first round interview at Tesco, which included introductions, discussion of my project and a coding problem about searching products by keyword.
Full Experience
Hi Everyone -
Tesco Round 1 Question -
- Introduce yourself
- Project + Role and Responsibility + Code Review
- Program
/*Enabling efficient search in online is very crucial for enabling the customer to find the product from a huge set of product collection. Finding relevant product is crucial for increasing hit ratio of the search.
Given a bunch of products[id,Name] as below , if a customer searches for the product by entering keywords say (“milk”)
Example: Products : [ {1, “Amul milk”}, {2, “Nandini Chocolate Milk”}, {3, “Milk Chocolate”}, {4, “Chocolate Milk"}, {5, "Milky Way Chocolate Bar"}] return all the products [id and name] that contain that search string. For example search for “Milk” should return :
Products : [ {1, “Amul milk”}, {2, “Nandini Chocolate Milk”}, {3, “Milk Chocolate"}, {4, “Chocolate Milk"}]
Similarly, search for “Chocolate Milk” : [ {2, “Nandini Chocolate Milk"}, {3, “Milk Chocolate"}, {4, “Chocolate Milk"}]*/
Expectation - working all happy scenerio plus edge case.
Interview Questions (1)
Product Search by Keyword
Enabling efficient search in online is very crucial for enabling the customer to find the product from a huge set of product collection. Finding relevant product is crucial for increasing hit ratio of the search.
Given a list of products represented as pairs of [id, name], implement a function that returns all products whose name contains a given search string (case‑insensitive). For example:
Products = [ {1, "Amul milk"}, {2, "Nandini Chocolate Milk"}, {3, "Milk Chocolate"}, {4, "Chocolate Milk"}, {5, "Milky Way Chocolate Bar"} ]
Search string = "Milk" should return: [{1, "Amul milk"}, {2, "Nandini Chocolate Milk"}, {3, "Milk Chocolate"}, {4, "Chocolate Milk"}]
Search string = "Chocolate Milk" should return: [{2, "Nandini Chocolate Milk"}, {3, "Milk Chocolate"}, {4, "Chocolate Milk"}]
The solution should handle all happy scenarios and edge cases.