ROLLS-ROYCE Hiring Challenge | Online Interview Question | Off-Campus OA (2024)

Question · Posted Jun 2026

Problem: Find Total Time Spent by Each Employee Problem Statement You are given an array events, where each event is represented as: events[i] = [empId, inTime, outTime] Each event indicates that an employee with ID empId entered the office at inTime and exited at outTime. Your task is to calculate the total time spent by each employee inside the office by summing all their session durations. The final output should be sorted in ascending order of employee ID. Example Input ...

The full answer & interview discussion are available to premium members.

Log in Create a free account