Zynga | SDE-1 | Bangalore | Feb 2021(Offer)

First Round (1 Hour)

  1. There is an array with each element representing working day in an organization . You have to take k consecutive days such that maximum working days are covered .
  • Example : the days are [2,4,5,8,14,18] k = 4
  • The answer would be 3 as you can take [2,3,4,5] and it would cover 3 working days(2,4,5) .
  • Solution using sliding window techinque .
  1. given a 2D array of 0s and 1s and a starting point , find the closest one .
  • Solved using bfs

Second Round (1 Hour)

  1. It was a simple question to print pascal triangle given the size .
  2. Given a string containting only A-Z characters , if 2 adjancent characters are same, change the second character(right) to next character (For example A->B , B->C , if its Z->A and so on). Perform this series of steps until no two adjacent characters are same in the string . Print the final string after performing this operation .
    Note : You have to scan from right to left in one pass and do the operation

For Example - > We have AAAA
the final string would AAAA -> ABBB -> ABCC -> ABCD (Final)
For ABBBCC -> ABCCCD -> ABCDDD -> ABCDEE -> ABCDEF

Third Round ( 1 hour)

  1. Questions about current work
  2. Why do you want to join and expections from the role ?
  3. Question about indexing
  4. Write a program to generate all permutations of a string (https://leetcode.com/problems/permutations/)

Got the verdict(selected) the next day after all rounds were completed

Comments (1)