FastPrepFirst and Last Access Time per User
Problems/First and Last Access Time per User

First and Last Access Time per User

Indeed logoIndeed● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The reported per-user minimum and maximum task matches the source at about 95%; record grammar, time units, output order and bounds are defined for this exercise.

Each entry in logs has the form userId,resourceId,timestamp and records a user accessing a resource. For each user, return the minimum and maximum timestamp across all resources.

Return rows [userId,firstTimestamp,lastTimestamp], with timestamps written as decimal strings.

For this exercise, assume records have exactly three comma-separated fields without spaces, identifiers are nonempty case-sensitive alphanumeric strings, and timestamps are nonnegative integer seconds.

For this exercise, assume rows are ordered lexicographically by user identifier and an empty log produces an empty result.

Function

accessRanges(logs: String[]) → String[][]

Examples

Example 1

logs = ["bob,r1,10","amy,r2,20","bob,r3,2","amy,r1,40"]return = [["amy","20","40"],["bob","2","10"]]

Bob spans 2 through 10 across resources; Amy spans 20 through 40. Rows are sorted by user.

Example 2

logs = ["u,resource,7"]return = [["u","7","7"]]

One event supplies both endpoints.

Constraints

  • For this exercise, assume 0 <= logs.length <= 10^4.
  • Identifier lengths are between 1 and 30.
  • Timestamps are integers from 0 through 10^9.

More Indeed Phone Screen questions

  • Insert into an Unrolled Linked ListPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Course Completion OrderPHONE SCREEN · Seen May 2025
  • Recipes You Can PreparePHONE SCREEN · Seen May 2025
  • Rotting Orange PropagationPHONE SCREEN · Seen May 2025
  • Courses Shared by Every Student PairPHONE SCREEN · Seen Aug 2022
  • Most Accessed Resource in Five MinutesPHONE SCREEN · Seen Jul 2022
  • Resource Transition GraphPHONE SCREEN · Seen Jul 2022
  • Count Disappearing Connected TilesPHONE SCREEN · Seen Jul 2022
  • First Dictionary Word from Note LettersPHONE SCREEN · Seen Jul 2022
  • Word Path Moving Only Right or DownPHONE SCREEN · Seen Jul 2022

Similar questions at other companies

  • Transaction Fee Calculator — Parts 1–2: Basic Fee Calculation and Conditional Fee RulesStripe · PHONE SCREENStripe interview questions
  • Detect a Straight FlushTemu · PHONE SCREENTemu interview questions
  • First Letter to Appear TwiceCisco · PHONE SCREENCisco interview questions
  • Halfway Course in a Single TrackCrunchyroll · PHONE SCREENCrunchyroll interview questions
  • Single-Condition Product FilterCrowdstrike · PHONE SCREENCrowdstrike interview questions
  • Summarize Server Healthcheck LogsNVIDIA · PHONE SCREENNVIDIA interview questions
  • Known Words Matching Phone DigitsLinkedIn · PHONE SCREENLinkedIn interview questions
  • First Non-Repeated CharacterDell Technologies · PHONE SCREENDell Technologies interview questions
  • Convert an Entry List to a MapEPAM · PHONE SCREENEPAM interview questions
  • First Non-Repeating CharacterGoldman Sachs · PHONE SCREEN · ONSITE INTERVIEWGoldman Sachs interview questions

Interview reports that mention this question

  • Indeed Experienced SWE Karat Screens and OAs: 6 Experiences

Indeed interview experiences

  • Indeed SWE Intern Karat Screens and OA: 3 Experiences
  • Indeed New Grad SWE Online Assessments: 3 Experiences
All Indeed interview questionsSee Indeed hiring insights
Saved
class Solution {
    public String[][] accessRanges(String[] logs) {
        // Write your code here.
        return new String[0][0];
    }
}
Checking account…