Three Calls Within Three Seconds
Updated
Problem statement
You are given timestamps, the times of calls in milliseconds, in nondecreasing order. After each call, return whether this call and the two calls just before it all happened within 3000 milliseconds. In other words, the current time minus the time two calls earlier is at most 3000.
Function
threeCallsWithinWindow(timestamps: long[]) → boolean[]Examples
Example 1
timestamps = [0,1000,3000,7000,7500,8000]return = [false,false,true,false,false,true]The calls at 0 and 1000 do not have three calls yet, so they give false. The call at 3000 is the third call and fits exactly in three seconds, so it gives true. The next call at 7000 and the one at 7500 are too far from the calls two places before them. The call at 8000 and the two before it fit together, so it gives true.
Constraints
0 <= timestamps.length <= 2 * 10^5.- Timestamps are nondecreasing.
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
- Moving Average of a Data StreamSquarepoint Capital · PHONE SCREENSquarepoint Capital interview questions
- Rate Limiter with a Sliding Window per ClientStackAdapt · PHONE SCREENStackAdapt interview questions
- Rolling Hit CounterDatabricks · PHONE SCREEN · ONSITE INTERVIEWDatabricks interview questions
- Per-Client API Rate LimiterDocker · PHONE SCREEN
- Per-Client Sliding-Window Rate LimiterCVS Health · PHONE SCREEN
- Rolling CSAT TrackerDecagon · PHONE SCREEN · ONSITE INTERVIEWDecagon interview questions
- Sliding-Window Rate LimiterAmazon · ONSITE INTERVIEW
- Sliding-Window Rate LimiterUber · PHONE SCREENUber interview questions
- Rate Limiter with Global and Per-User LimitsOpenAI · ONSITE INTERVIEWOpenAI interview questions
- Real-Time Temperature Window StatisticsGoogle · ONSITE INTERVIEWGoogle 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)