FastPrepValid Parentheses
Problems/Valid Parentheses

Valid Parentheses

Bloomberg LP logoBloomberg LP● EasyNEW GRADINTERNPHONE SCREENONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in many firsthand Bloomberg new-grad phone and onsite interviews. Our version follows the standard Valid Parentheses exercise.

Given a string s containing only the bracket characters (, ), [, ], {, and }, determine whether it is valid.

A string is valid when every opening bracket is closed by the same type of bracket and brackets close in the reverse order in which they were opened. The empty string is valid.

Return true if s is valid; otherwise, return false.

Function

isValidParentheses(s: String) → boolean

Examples

Example 1

s = "()[]{}"return = true

Each opening bracket is immediately followed by its matching closing bracket.

Example 2

s = "([{}])"return = true

The brackets are properly nested and close in reverse opening order.

Example 3

s = "([)]"return = false

The closing parenthesis appears before the nested square bracket is closed.

Constraints

  • 0 <= s.length <= 100000.
  • Every character of s is one of ()[]{}.

More Bloomberg LP Phone Screen questions

  • Collatz Conjecture with Shared MemoizationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Fewest Coins CombinationPHONE SCREEN · Seen Nov 2026
  • Recommend Films from Viewers Who Watched Everything You DidPHONE SCREEN · Seen Nov 2026
  • Track New Values in Sorted OrderPHONE SCREEN · Seen Nov 2026
  • Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Sparse Vector and Matrix OperationsPHONE SCREEN · Seen Oct 2026

Similar questions at other companies

  • Valid ParenthesesByteDance · PHONE SCREENByteDance interview questions
  • Valid ParenthesesCisco · PHONE SCREENCisco interview questions
  • Valid ParenthesesMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Stack Formula InterpreterTypeSafe AI · PHONE SCREEN
  • Valid ParenthesesEPAM · ONSITE INTERVIEWEPAM interview questions
  • Valid ParenthesesQualys · ONSITE INTERVIEWQualys interview questions
  • Validate a Bracket SequenceTripAdvisor · PHONE SCREEN
  • Rich Text Parser Part 1 (Validate Tokens)Figma · PHONE SCREEN · ONSITE INTERVIEWFigma interview questions
  • Valid ParenthesesOracle · PHONE SCREENOracle interview questions
  • Valid ParenthesesAmazon · PHONE SCREEN · ONSITE INTERVIEW

Interview reports that mention this question

  • Bloomberg SWE Intern Interview Questions: 68 Questions
  • Bloomberg Interview Questions, Level Not Reported: 65 Questions
  • Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)
  • Bloomberg New Grad Interviews: 2025 vs 2026 Guide
  • Bloomberg New Grad VOs: 32 Experiences (Part 5 of 5)

Bloomberg LP interview experiences

  • Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public boolean isValidParentheses(String s) {
        // write your code here
    }
}
Checking account…