Array Manipulation Online Test
سؤال انترفيو في آي تي ووركس (مصر) · المرحلة: اختبار أونلاين · المجال: برمجة · الوظيفة: مهندس برمجيات · الصعوبة: متوسط · اتسأل مرتين، آخرها فبراير 2026
What they ask
Before any human interview there is an online coding test with two or three medium problems. The themes reported are array manipulation and what candidates describe as API integration logic: you are handed data in the shape an API would return and asked to transform, merge or aggregate it. Questions in this area, for example:
Top customers. Given an array of order records {customerId, amount, status}, return the k customers with the highest total of completed orders, highest first; break ties by the smaller customerId.
Example: orders [(1, 50, completed), (2, 80, completed), (1, 40, completed), (3, 500, cancelled)], k = 2 gives [1, 2] (customer 1 has 90, customer 2 has 80, customer 3 has nothing completed).
Merging paginated pages. Given several pages (arrays of items with id and updatedAt) fetched from a paginated endpoint, produce one list deduplicated by id, keeping the most recently updated copy, sorted by id.
Example: page 1 [{id: 7, updatedAt: 3}, {id: 2, updatedAt: 1}], page 2 [{id: 7, updatedAt: 9}] gives [{id: 2, updatedAt: 1}, {id: 7, updatedAt: 9}].
Constraints
- Up to 10^5 records per problem; an O(n log n) solution is fine, O(n^2) will time out.
- Any language on the platform; most candidates use JavaScript or Python.
What they look for
Correct handling of edge cases (empty input, k larger than the number of customers, all orders cancelled) and code that reads cleanly. Nobody expects clever tricks at this stage.