Skip to content
Related Articles
Get the best out of our app
Open App

Related Articles

Zomato Interview Experience for SDE-2

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Round 1(Problem Solving+Discussion on Past Work 1.5hrs)

  1. Reverse words in a sentence. Two words are separated by one or more spaces


    "ab cd    efg” -> “ba dc   gfe”
  2. Given a sorted array containing duplicates and a key, find the frequency of the key in the array


    [1,1,1,2,2,2,2,3,3,4,4,4,4] and key = 2 => Frequency = 4

Round 2(Design+Discussion on Past Work 1.5hrs)

  1. Design Twitter.

    • Users can view/post tweets
    • Users can follow other users
    • Generate Newsfeed for a User
  2. Given a pair of x, y values sorted by x, use the below equation to output the values sorted by y.

    y = 3x2 + 3x - 36
    x, y
    … 0

    Hint: The given equation is of an upward parabola, thus there will be a minimum. As the input is sorted by x, after finding the minima, sorting by y can be done by having two pointers traversing on both sides of the minima)

  3. Given two arrays, where if a value is present in both the array, you can switch b/w arrays, find the maximum sum.

    Input: ar1[] = {2, 3, 7, 10, 12, 15, 30, 34}
               ar2[] = {1, 5, 7, 8, 10, 15, 16, 17}
    Output: 122

    In the above input, since both arrays contain 7, at 7, you can switch from ar1- > ar2 and vice versa

My Personal Notes arrow_drop_up
Last Updated : 10 Dec, 2020
Like Article
Save Article
Similar Reads