FastPrepCount Dropped Rate-Limited Requests
Problems/Count Dropped Rate-Limited Requests

Count Dropped Rate-Limited Requests

Oracle logoOracle● MediumFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Oracle onsite interview. The report gives sorted timestamps, the three capacity limits, and the rule that dropped requests still count. It does not say exactly where the rolling window starts and ends, how large timestamps can be, or the function signature. We chose the usual answers and kept all the reported limits. Our version is about 95% the same as the reported question.

You are given a nondecreasing array requestTimes, where each value is the integer second when one request arrives. Process requests in array order. A request is dropped if accepting it would exceed any of these limits:

  • At most 3 requests in one second.
  • At most 20 requests in any rolling 10-second interval.
  • At most 60 requests in any rolling 60-second interval.

For a request at second t, the rolling intervals are [t - 9, t] and [t - 59, t], respectively. Dropped requests still count when evaluating every later limit. If multiple limits reject the same request, count that request only once.

Return the total number of dropped requests.

Function

countDroppedRequests(requestTimes: int[]) → int

Examples

Example 1

requestTimes = [1,1,1,1]return = 1

The fourth request at second 1 exceeds the three-per-second limit.

Example 2

requestTimes = [1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7]return = 1

The first twenty requests fit in the rolling ten-second interval. The twenty-first request is dropped.

Example 3

requestTimes = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,60]return = 1

The final request is the sixty-first request in the interval from second 1 through second 60, so it is dropped by the sixty-second limit.

Constraints

  • 0 <= requestTimes.length <= 200000
  • 1 <= requestTimes[i] <= 1000000000
  • requestTimes is sorted in nondecreasing order.

More Oracle Onsite Interview questions

  • Course ScheduleONSITE INTERVIEW · Seen Nov 2026
  • Shortest Subarray with Sum at Least KONSITE INTERVIEW · Seen Nov 2026
  • Longest Substring Without Repeating CharactersONSITE INTERVIEW · Seen Nov 2026
  • Minimum Meeting RoomsONSITE INTERVIEW · Seen Nov 2026
  • Shortest Window with Required CountsONSITE INTERVIEW · Seen Nov 2026
  • Maximum Subarray Sum with One DeletionONSITE INTERVIEW · Seen Nov 2026
  • Shortest Deletion for Distinct CharactersONSITE INTERVIEW · Seen Nov 2026
  • Design Authentication ManagerONSITE INTERVIEW · Seen Oct 2026
  • Maximum Bouquet ValueONSITE INTERVIEW · Seen Oct 2026
  • Cache an Expensive Service Across ThreadsONSITE INTERVIEW · Seen Oct 2026

Similar questions at other companies

  • Maximum Earnings Across WarehousesAmazon · ONSITE INTERVIEW
  • Count Zero Request ServersSalesforce · ONSITE INTERVIEWSalesforce interview questions
  • Longest Subarray Within an Absolute-Difference LimitGoogle · ONSITE INTERVIEWGoogle interview questions
  • Longest Binary Subarray With at Most K OnesLinkedIn · ONSITE INTERVIEWLinkedIn interview questions
  • Max Consecutive Ones IIIMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Longest Continuous Subarray Within an Absolute-Difference LimitUber · ONSITE INTERVIEWUber interview questions
  • Sliding-Window Rate LimiterSnowflake · ONSITE INTERVIEWSnowflake interview questions
  • Count Equal Code Pairs Within Distance KInfosys · ONSITE INTERVIEWInfosys interview questions
  • Maximize Element FrequencyGoldman Sachs · ONSITE INTERVIEWGoldman Sachs interview questions
  • Longest Subarray with At Most Two Distinct ValuesMoody's Investors Service · ONSITE INTERVIEW

Oracle interview experiences

  • Oracle SWE Onsite Interview Experience: 1 Experience
All Oracle interview questionsSee Oracle hiring insights
Saved
class Solution {
    public int countDroppedRequests(int[] requestTimes) {
      // write your code here
    }

}
Checking account…