FastPrepFurthest Episode Meeting a Completion Threshold
Problems/Furthest Episode Meeting a Completion Threshold

Furthest Episode Meeting a Completion Threshold

Bloomberg LP logoBloomberg LP● EasyNEW GRADONSITE INTERVIEW

Updated Sep 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported with a 70%-of-finishers example in a first-hand Bloomberg 2018 new-grad onsite. The final count is treated as a baseline, with the largest earlier qualifying episode returned.

viewerCounts[i] is the recorded viewer count for episode i + 1. The final entry is used only as the number of people who finished the complete series; it is not a candidate episode.

Let threshold = ceil(70% * viewerCounts[n - 1]). Return the largest 1-based index among episodes 1..n-1 whose count is at least threshold. Return -1 if no earlier episode qualifies.

Function

furthestEpisodeAtCompletionThreshold(viewerCounts: int[]) → int

Examples

Example 1

viewerCounts = [40,20,6,5,4,6,7,4,3,10]return = 7

The final count is 10, so the threshold is 7. Episode 7 is the largest earlier index whose count reaches 7.

Constraints

  • 2 <= viewerCounts.length <= 100000.
  • 0 <= viewerCounts[i] <= 10^9.
  • The final count is positive.

More Bloomberg LP Onsite Interview 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
  • Top K Frequent WordsONSITE INTERVIEW · Seen Nov 2026
  • Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Add Two Numbers IIPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026

Similar questions at other companies

  • Maximum Profit with Exactly One Stock TransactionRetool · PHONE SCREEN · ONSITE INTERVIEWRetool interview questions
  • Best Time to Buy and Sell Stock IIGroww · ONSITE INTERVIEW
  • Maximize Two Endpoint ValuesGoogle · ONSITE INTERVIEWGoogle interview questions
  • Best Time to Buy and Sell StockOracle · PHONE SCREEN · ONSITE INTERVIEWOracle interview questions
  • Cheapest Round TripUber · ONSITE INTERVIEWUber interview questions
  • Best Time to Buy and Sell StockZoox · ONSITE INTERVIEW
  • Evaluate a Blackjack HandGoldman Sachs · ONSITE INTERVIEWGoldman Sachs interview questions
  • Best Time to Buy and Sell StockMotive · ONSITE INTERVIEWMotive interview questions
  • Maximum Profit with Repeated Stock TradesPalantir · ONSITE INTERVIEWPalantir interview questions
  • Pair Coders by RatingExpedia · ONSITE INTERVIEWExpedia interview questions

Interview reports that mention this question

  • Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)
  • Bloomberg New Grad SWE Offer Loops: 14 Experiences (Part 2 of 5)
  • Bloomberg New Grad SWE Interviews: 98 Experiences (Part 1 of 5)

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
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public int furthestEpisodeAtCompletionThreshold(int[] viewerCounts) {
      // Write your code here.
    }
}
Checking account…