[ INFO ]category: Behavioral · Onsite difficulty: medium freq: first seen: 2024-12-21
[MEDIUM][ONSITE]OnsiteSDE IIUnknown
$catproblem.md
Microsoft SDE II
Round 1:
A data structures and algorithms question:
Person A is organizing a party and will invite friends with the condition that the invited friends do not know each other. There is a direct edge from person1 to person2 if they are friends. How many people can A invite at max?
Example: A->B, A->C, A->D, B->C. Here A can invite either [B,D] or [C, D], so 2.
Round 2:
Given a correctly parenthesized string, every second first character is removed, and there are m ways to balance the whole string again. You need to keep doing the same operation until the string becomes empty.
Example: (())
After the first round, it will be ()) -> so you can remove any two ) characters (second or third one). So there are two ways, then you will get (), after removing it will become ), then only one way. So total 2*1 ways.