FastPrepAverage Process Time from CSV
Problems/Average Process Time from CSV

Average Process Time from CSV

Abnormal Security logoAbnormal Security● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A first-hand report from an Abnormal Security machine learning engineer phone screen asks for CSV parsing, grouping with a dictionary, and the average process time for each ID. We chose the columns: id, start and end. We also chose cases where the average is a whole number and the output is sorted. Our version is about 88% the same as the reported question.

You are given rows, a list of CSV rows. Each row has the form id,start,end, where start and end are integer timestamps and end >= start. The process duration of a row is end - start.

Group the rows by id and find each ID's average process duration. The input guarantees every average is an integer.

Return one pair [id, average] per ID, with the average written as a string. Sort the pairs lexicographically by ID.

Function

averageProcessTimes(rows: String[]) → String[][]

Examples

Example 1

rows = ["a,10,20","b,0,4","a,30,50"]return = [["a","15"],["b","4"]]

ID a has two rows with durations 10 and 20, so its average is 15. ID b has one row, so its average is that row's duration. Sorted by ID, a comes before b, which gives the output shown.

Constraints

  • 1 <= rows.length <= 100000.
  • IDs are nonempty ASCII strings without commas.
  • 0 <= start <= end <= 10^9.
  • Each per-ID duration sum is divisible by its row count.

More Abnormal Security Phone Screen questions

  • Find Duplicate Image FilesPHONE SCREEN · Seen Jul 2025

Similar questions at other companies

  • Shared Courses for Every Pair of StudentsCrunchyroll · PHONE SCREENCrunchyroll interview questions
  • Portfolio Valuation, Part 1Stripe · PHONE SCREENStripe interview questions
  • Summarize Server Healthcheck LogsNVIDIA · PHONE SCREENNVIDIA interview questions
  • Convert an Entry List to a MapEPAM · PHONE SCREENEPAM interview questions
  • Best Anagram MatchGoogle · PHONE SCREENGoogle interview questions
  • Word Frequency in a Large TextRobinhood · PHONE SCREENRobinhood interview questions
  • Remove Later Anagrams From a ListBloomberg LP · PHONE SCREENBloomberg LP interview questions
  • Employees With Shared InterestsPalantir · PHONE SCREENPalantir interview questions
  • Rank Words by FrequencyDatadog · PHONE SCREENDatadog interview questions
  • Sort Letters by FrequencyScale AI · PHONE SCREENScale AI interview questions
See Abnormal Security hiring insights
Saved
class Solution {
    public String[][] averageProcessTimes(String[] rows) {
        // Parse id,start,end rows and return sorted id,average pairs.
    }
}
Checking account…