---
# System prepended metadata

title: interview questions

---

# interview questions

- if you have an endpoint that gets all orders, inside you get an array of orderIds and then you need to query the db for each id, if you have 10000 how would you handle that.

```js
const orderIds = await getIds();
return Promise.all(orderIds.map(id => getOrderDetailsById({id})))

```

- how to run synchronous code run async/another thread (workers, processes).
- if you have a query that is taking so long, how would you debug,fix it. (using indexing)
- how to add index on exisitng table with lots of data.
- how does the migration works.
- if you use express server that return a json, then you have just one client that want ther response xml, how would you handle that  (middlware maybe, not sure, ask mooh).
- explain event loop.
- if you have export api that stream the file to front end, how could you limit the number of concerent requests. (said caching but doesn't wor, he said something about sending a jobid/key and based on that limit the number of requests/cach whatever, i didn't really understand).
- when we might not use index in db columns
- object inside useEffect dependency cause re-renders
- component have 2 props and do heavy calculation on these props, and it's causing performance issues. (useMemo vs useCallback).
- 