Post-interview FE Coding Insights in 2025

Uber 60-min FE Interview - mid-July

Problem: on Hackerrank online IDE, given the function definitions, implement certain logic to obtain the expected output while ensuring the function calls running in parallel.

Note that (based on clarification made by the interviewer):

  • Only JS/TS allowed for this problem;
  • The function of getNameById is meant to simulate certain time consuming task; no change should be made other than under TODO inside asyncMap;
  • callback param passed into getNameById is not the same as that in asyncMap.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function getNameById(id, callback) {
// simulating async request
const randomRequestTime = Math.floor(Math.random() * 100) * 200;
setTimeout(() => {
callback("User" + id);
}, randomRequestTime);
}

// Input
const userIds = [1, 2, 3, 4, 5];
async function asyncMap(input, iterateeFn, callback) {
// TODO: implement this function, ensuring parallelism and the correct ordering in the output
}

asyncMap(userIds, getNameById, (names) => {
console.log(names); // * ["user1", "user2", "user3", "user4", "user5"]
});
Read more