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
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.
Please Login to comment...