← Microsoft questions

Remove Duplicates, Top K Elements, and Max Parenthesis Depth

Filed under Microsoft

Solve three sub-tasks: 1) Remove duplicate characters from a string while preserving order. 2) Return the sum of the top K elements in an array. 3) Find the maximum depth of nested parentheses in a…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Microsoft questions

Collected from public candidate posts and coding forums. Updated Nov 2026.