Company-style OA practice sets with full problem statements, sample test cases, and solutions.
Have you recently taken Meta's Online Assessment or coding test? Share the questions, test cases, or assessment patterns you encountered. Earn SWE180 Coins for every verified submission and use them to unlock other company OA sets and premium tools for free!
There are n buildings in a row. You are given an integer array heights where heights[i] represents the height of the ith building.
To the right of the buildings is the ocean. A building has an ocean view if all the buildings to its right have a strictly smaller height.
Return a list of indices (0-indexed) of buildings that have an ocean view, sorted in increasing order.
Example 1
Input
4 4 2 3 1
Output
0 2 3
Explanation
Building 0 (height 4) has an ocean view since 4 > 2, 3, 1.
Building 1 (height 2) does not (building 2 is taller).
Building 2 (height 3) has an ocean view (3 > 1).
Building 3 (height 1) has an ocean view (rightmost building).
Indices: [0, 2, 3].
Given a string s of '(', ')' and lowercase English characters.
Your task is to remove the minimum number of parentheses ('(' or ')', in any positions) so that the resulting parentheses string is valid and return any valid string.
Formally, a parentheses string is valid if and only if it is the empty string, contains only lowercase characters, or can be written as AB or (A) where A and B are valid strings.
Example 1
Input
lee(t(c)o)de)
Output
lee(t(c)o)de
Explanation
The last closing parenthesis ')' has no matching '(' and is removed.
Gain complete transparency into the Meta online assessment process. Prepare effectively with real, verified coding challenges, test patterns, and platform details.
Wondering what top companies are actually asking in their initial screening rounds? We provide exact Data Structures, Algorithms, and logical reasoning questions reported by candidates who recently took the Meta online tests. Stop guessing and start practicing the right problems.
Understand exactly how many questions to expect, the typical time limits, and the platforms used (e.g., HackerRank, Codility, CodeSignal). Knowing the format in advance is the first step to clearing the Meta OA.