Skip to content
Related Articles

Related Articles

Improve Article
BrowserStack Interview Experience | Set 1 (On-Campus)
  • Difficulty Level : Easy
  • Last Updated : 02 Jan, 2016

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




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
}

Output:




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

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.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, Amazon and Microsoft Test Serieses.




My Personal Notes arrow_drop_up
Recommended Articles
Page :