Open In App

GAP Inc Interview Experience

Round-1(Online Assessment):

  • Given a string stn containing only ‘x’ and ‘y’. find and replace all occurrences of the substring ‘xy’ with ‘yyx’ . Find the minimum number of operations you need to make so that no substring ‘xy’ is present.
  • Example: ‘xxy’ Output:3
  • if you replace ‘xy’ in ‘xxy’ it will becoms ‘xyyx’
  • ‘xyyx’ -> ‘yyxyx’
  • ‘yyxyx’ -> ‘yyyyxx’
  • so 3 operations.

Round-2(Technical Interview):

Round-3(Managerial & HR Round):

Article Tags :