FastPrepClicked One-Dimensional Candy Crush
Problems/Clicked One-Dimensional Candy Crush

Clicked One-Dimensional Candy Crush

Bloomberg LP logoBloomberg LP● MediumNEW GRADPHONE SCREEN

Updated Sep 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported with a complete multistep example in a first-hand Bloomberg 2020 new-grad phone screen.

Click the zero-based position clickIndex in gems. If its maximal equal-character run has fewer than three gems, return the original string.

Otherwise remove that run. Whenever the two exposed boundary runs have the same character and their combined length is at least three, remove the combined run and continue outward. Return the final string.

Function

clickCandyCrush(gems: String, clickIndex: int) → String

Examples

Example 1

gems = "ABCCCBBBBCCCBBAAAB"clickIndex = 5return = "B"

BBBB, then six Cs, then three Bs, then four As are removed in sequence.

Constraints

  • 1 <= gems.length <= 10^5.
  • 0 <= clickIndex < gems.length.

More Bloomberg LP Phone Screen questions

  • Pascal's TrianglePHONE SCREEN · ONSITE INTERVIEW · Seen Dec 2026
  • Valid Triangle NumberPHONE SCREEN · ONSITE INTERVIEW · Seen Dec 2026
  • 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

Similar questions at other companies

  • Adjacent Pair and Run RemovalWhatNot · PHONE SCREEN · ONSITE INTERVIEWWhatNot interview questions
  • Compress Editor Actions into Operational Transform OperationsReplit · OA · PHONE SCREEN · ONSITE INTERVIEW
  • Multiline Text Editor with Cursor MovementDatologyAI · PHONE SCREEN
  • Run a Stack Language InterpreterJane Street · PHONE SCREENJane Street interview questions
  • Trace Nested Object Destruction OrderArista Networks · PHONE SCREENArista Networks interview questions
  • Stack Language EvaluatorRetell AI · PHONE SCREENRetell AI interview questions
  • Text Document HistoryNotion · PHONE SCREEN · ONSITE INTERVIEWNotion interview questions
  • Text Editor, Part 2: Undo and RedoOpenAI · PHONE SCREENOpenAI interview questions
  • Trace Events from Stable Whole-Stack StatesAnthropic · ONSITE INTERVIEWAnthropic interview questions
  • Most Frequent Call Path in Interleaved LogsRoblox · ONSITE INTERVIEWRoblox interview questions

Bloomberg LP interview experiences

  • Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
  • Bloomberg SWE Intern Interview Questions: 68 Questions
  • Bloomberg Interview Questions, Level Not Reported: 65 Questions
  • Bloomberg Experienced Design & More: 126 Questions (Part 2 of 2)
  • Bloomberg Experienced SWE Interviews: 167 Questions (Part 1 of 2)
  • Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public String clickCandyCrush(String gems, int clickIndex) {
      // Write your code here.
    }
}
Checking account…