TESCO

tesco logo
tesco
August 4, 2026 · 1 reads

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 -

  1. Introduce yourself
  2. Project + Role and Responsibility + Code Review
  3. 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)

1.

Product Search by Keyword

Data Structures & Algorithms

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.

📣 Found this helpful? Please share it with friends who are preparing for interviews!

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!