GamifiedGamified challengesPracticeRaceLeaderboardPricing

Learn data structures by watching them move, then doing it yourself. Press M anytime to toggle sound.

A product of Amypo Technologies, Coimbatore.

Learn

  • All topics
  • Learning path
  • How it works
  • About dotprep

Practice

  • Practice arena
  • Daily challenge
  • Gamified challenges
  • Race mode
  • Leaderboard

Interview prep

  • Java interview
  • Coding questions
  • Company questions
  • System design
  • Jobs & careers

You

  • Dashboard
  • Settings
  • Pricing
  • Create account

© 2026 dotprep

Content last updated 20 November 2026

GamifiedGamified challengesPracticeRaceLeaderboardPricing
Log inStart free
Gamified challengesRecent Calls Counter

Gamified challenge · Queues

Recent Calls Counter

pings[i] is the time in milliseconds of the i-th call to the switchboard. Times never go down, but several calls may share the same millisecond.

Write recent(pings) that returns a list with one number per ping: how many pings so far (including this one) happened in the inclusive window [t - 3000, t], where t is this ping's time.

For [1, 100, 3001, 3002] the answer is [1, 2, 3, 3]: at 3002 the window is [2, 3002], so the ping at 1 has dropped out. No pings gives [].

Sign in to play Recent Calls Counter

This game is part of the paid plans. Sign in, then pick a plan to write your answer, watch it play out, and step through the algorithm with its guide.

Sign in with Google

or log in with email · create an account