Selected || Paytm || Senior Software Engineer || September 2024 || Round 2
Question 1:
You are given an array of task names in the format ['task1', 'task2', ..., 'taskn']. Each time you consume a task (i.e., remove it from the array), you must make an API call to process the task. Once all tasks have been consumed and processed, return a success message.
Write a function in Node.js that:
Consumes tasks from the array one by one.
For each task, makes an API call using a function processTask(taskName) (assume this function is provided and returns a promise).
Once all tasks are consumed and API calls are successfully completed, return a success message.
- How would you design this function to ensure that all tasks are processed asynchronously and efficiently?
Question 2:
Question:
Imagine you have a system where there are 100 publishers producing data and only 1 consumer processing it. The publishers are continuously pushing data, potentially leading to a bottleneck at the consumer end.
- How would you design the system to handle this imbalance between publishers and the consumer?
- Would you impose a maximum waiting time for data to be processed by the consumer? If yes, how long would the maximum waiting time be, and why?
- If no maximum waiting time is imposed, what do you think would happen to the incoming data? How would you address issues like data overflow, loss, or delays in such a scenario?
Question 3:
You are given a 200GB CSV file, and you need to process each row of the file. Given the size of the file, loading it into memory is not feasible.
- How would you approach processing the CSV file row by row without loading the entire file into memory?
- What tools or techniques would you use to efficiently handle such large data?
- How would you ensure that the processing is optimized for performance, and what strategies would you implement to handle potential bottlenecks, such as I/O speed or memory limitations?
Verdit : Selected
Round1 : https://leetcode.com/discuss/interview-experience/5765903/paytm-senior-software-engineer-september-2024-round-1
Round 3: https://leetcode.com/discuss/interview-question/5812902/paytm-senior-software-engineer-september-2024-round-3


