Round 1 – Online assessment
5 coding questions were asked (1 Basic, 2 Easy, and 2 medium)
1. Given a string “https://www.domain.com/about” or “http://www.domain.com//type=xyz%filters=content” (Basic)
Return an array of strings having
0th element = http or https
1st element = domain name
2nd element = about, home (or any other)
or if attributes are given 2nd element = type: [xyz] filters: [content]
2. Given an array having 1, 0 or -1 (Easy)
0 means the shop is open
1 means the shop is closed and a new stock of items is received
-1 means the shop is closed and all items are returned
Return the maximum number of consecutive days when the customer can come to the shop and the shop has items
Answer – Maximum continuous number of zeroes after 1 and before any 1 or -1
4. Given an array and return the maximum product of 1st and last element of a subsequence of size k. (Medium)
Example – Array = 5 6 2 1 3 4 and k = 3
Answer – 18 (subsequence 6 2 3 or 6 1 3)
4. Given a 2D matrix and a number k (Medium)
from each row, you can select a single element, choose such elements that the difference between their sum and k is the minimum
Answer – Solved using dynamic programming (memoization)
I don’t remember the 5th question(easy), I solved all 5 questions and got selected for the interviews on the next day. Some students got shortlisted after solving 4 or 4.5 questions as their GPA was high.