Makemytrip | Senior Software Engineer -1 | Bangalore | Feb 2021(Offer)
  1. Online hackerearth test
  1. First round (1 hour)
  • Check whether a given Linked list is palindrome or not -

  • Design a data structure such that given values and its priority for each element it returns maximum priority elements and if priority is same then it return the items with equals probablitiy.
    Example : Value - [2,3,4,5,6] -
    Prioritity - [1,1,2,3,4]
    Element number 1 && 2 have equal priority so they are removed with equal probability .
    Solved this using a treemap<Priority,List> , whenever multiple elements with same priority occurs , use a random index and remove it from list .

    Afterwards , the question was modified to introduce weight for each elements , such that if two elements have equal priority , their weight will dictate the probability of returning the item

  1. Second round (1 hour)
  • Given a list of lists , return all permutations such that 1st element - from 1st list , 2nd element from 2nd list and so on ..

Example : [1,2,3,4]
[2,3,4,5]
[4,5,6,7]
The answer would [1,2,4] , [1,2,5],[1,2,6],[1,2,7], [1,3,4] and so on

  • write a function to jsonify a map<string,object>. Object can Number ,boolean , double ,
    array , and another map as well .
  1. Third round (1 hour )
  • Introduction
  • Most challenging work at curreny company
  • What are you looking and why do you want to join ?
  • Design a leaderboard system for a game s.t we can see top k highest scores players in real time
  • Given a stream a characters coming one by one , Return the maximum length palidrome in the stream at any given time
Comments (1)