# gather returns results in the ORDER you submitted the tasks, not the order they finish

Canonical URL: <https://datadriven.io/problems/gather-returns-results-in-the-order-you-submitted-the-tasks-f1b32d0b>

Domain: Python · Difficulty: medium

## Problem

gather returns results in the ORDER you submitted the tasks, not the order they finish. You submit tasks for ids [1,2,3]; they finish in the order [3,1,2] with results {1:'a',2:'b',3:'c'}. Reconstruct what gather returns: a list of results in SUBMISSION order. Print the list. (Model it, no asyncio.)

## Related

- [All practice problems](https://datadriven.io/problems)
- [Mock interview mode](https://datadriven.io/interview/gather-returns-results-in-the-order-you-submitted-the-tasks-f1b32d0b)
- [Python Interview Questions](https://datadriven.io/python-interview-questions)
- [Data Engineering Interview Prep Guide](https://datadriven.io/data-engineer-interview-prep)
- [Daily Challenge](https://datadriven.io/daily)

---

Source: DataDriven (https://datadriven.io). 100% free data engineering interview prep. Live code execution against Postgres 16, Python 3.11, and Spark sandboxes. No paywall, no premium tier, no signup gate.