During this 45-minute video call, you will be asked to complete three coding exercises. You're encouraged to discuss your thought process, the trade-offs you consider, and the complexity of your solutions. We are using TypeScript and Node.js for our stack, so please ensure your solutions are compatible with these technologies.
Given an array of n
objects, each with properties id
(a unique integer) and timestamp
(a JavaScript Date
object), write a function to sort the array. The primary sort key should be timestamp
(oldest to newest), and the secondary key (in case of ties) should be id
(smallest to largest).