Google L3 onsite experience
Anonymous User
648

First onsite:
Implement a restaurant waitlist data structure. It should support the following features:

  1. A party of customers can join the waitlist.

  2. A previously joined party can leave the waitlist at any time.

  3. The restaurant serves the first party whose size fits the empty table size at a time (a table size is given as an argument

Second onsite:

So the second one, the interviewer gave me a question: Given a formula of letters with parentheses, return a simplified equivalent version of the formula without parentheses. also handle nested paranthesis.

Examples:

a-(b+c) -> a-b-c

a-(a-b) -> b

Third Onsite

Write a function to decompress string from an encoded format. For example: "a(bcd) (3)}e" -> "abcdbcdbcde "a(bc(d){4}e){3}f"-> "abcddddebcddddebcddddef A group of characters surrounded by parentheses should be repeated by the number in the following curly braces. Note that the parentheses can be nested.

Comments (5)