FastPrepFile Download Coverage Percentage
Problems/File Download Coverage Percentage

File Download Coverage Percentage

Persona logoPersona● MediumINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Three firsthand Persona intern online assessment reports describe the same file-downloader interval task. You work out the percentage of a file covered by chunk intervals. A bonus asks a true or false question: is every point covered twice? One report gives total 5 and interval [3,4] as 40 percent. Chunks are inclusive and start at one, and we round down. Those are the smallest fixed choices that fit that example. Our version is about 90% the same as the reported question.

A file has chunks numbered 1..totalChunks. Each inclusive interval records one completed download of every chunk in that range.

If requireTwice is false, return the integer percentage of chunks downloaded at least once, rounded down. If it is true, return 100 only when every chunk was downloaded at least twice; otherwise return 0.

Function

downloadCoveragePercent(totalChunks: int, intervals: int[][], requireTwice: boolean) → int

Examples

Example 1

totalChunks = 5intervals = [[3,4]]requireTwice = falsereturn = 40

Two of five chunks were downloaded.

Example 2

totalChunks = 5intervals = [[1,5],[1,5]]requireTwice = truereturn = 100

Every chunk appears in both intervals.

Example 3

totalChunks = 5intervals = [[1,5],[2,5]]requireTwice = truereturn = 0

Chunk 1 was downloaded only once.

Constraints

  • 1 <= totalChunks <= 100000.
  • 0 <= intervals.length <= 100000.
  • 1 <= start <= end <= totalChunks.

More Persona Online Assessment questions

  • Rank Football TeamsOA · Seen Oct 2026
  • Escape the Haunted CastleOA · Seen Oct 2024
  • Escape the Haunted Castle with TreasuresOA · Seen Oct 2024
  • Treasure HunterOA · Seen May 2022

Similar questions at other companies

  • Earliest Time to Schedule a MeetingMathWorks · OAMathWorks interview questions
  • Earliest Meeting Start on a 24-Hour ClockIMC Trading · OAIMC Trading interview questions
  • Earliest Time to Schedule a MeetingMicrosoft · OAMicrosoft interview questions
  • Earliest Common Meeting StartVisa · OAVisa interview questions
  • Smallest Most-Lit Street PositionHudson River Trading · OAHudson River Trading interview questions
  • Most Visited Sprint MarkerChubb · OAChubb interview questions
  • Earliest Common Meeting TimeZipRecruiter · OAZipRecruiter interview questions
  • Peak Chat Load Across AgentsCresta · PHONE SCREENCresta interview questions
  • Majority Labels over Audio IntervalsNooks · PHONE SCREEN
  • Zero Array Transformation IGoogle · ONSITE INTERVIEWGoogle interview questions
All Persona interview questionsSee Persona hiring insights
Saved
class Solution {
    public int downloadCoveragePercent(int totalChunks, int[][] intervals, boolean requireTwice) {
        // Compute ordinary or double coverage.
    }
}
Checking account…