BrowserStack Interview Experience | Set 1 (On-Campus)

Hi, BrowserStack recently visited our campus for written test for December placements. The written round was conducted on HackerEarth and was of 3 hours and had 2 coding questions.

1. Comment removal
Given a piece of code, the task was to remove all the comments from the code.

Eg. Input

filter_none

edit
close

play_arrow

link
brightness_4
code

int main(){
  // this is a comment
  int i = 1;
  /*
   some more
   comments
  */
  cout<<i;
  cout<<endl; // this is for new line
  return 0;
  // last one
}

chevron_right


Output:

filter_none

edit
close

play_arrow

link
brightness_4
code

int main(){
  int i = 1;
  cout<<i;
  cout<<endl;
  return 0;
}

chevron_right


PS : take special care of corner cases, how to deal with string properly.



2. JSON matching

Given two JSON objects, find the values of fields. whose values are different.

Eg. Input 
{"Geeks":"Test1","Are":"hey","Cool":"yeah"}
{"Geeks":"Test1","Are":"20","Cool":['B','C']}

Output:
Are:Cool 

PS : take special care of input and output format.

The questions were easy but the main task was to read the input correctly and string parsing related stuff.

Hope this will help you all.

If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.


Write your Interview Experience or mail it to contribute@geeksforgeeks.org



My Personal Notes arrow_drop_up

Recommended Posts:



    Article Tags :
    Practice Tags :


    Be the First to upvote.


    Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.