← Chicagotrading Interview Insights

Chicagotrading·Software Engineer·Online Assessment (OA)·Intermediate

Intermediate
Jun 2026

Summary

Short Codility OA for a software engineer role at Chicago Trading. One coding question, 20 minutes, pretty straightforward Python problem.

Questions Asked (1)

Q1

Write a function that merges multiple Python dictionaries into one, handling key collisions however you see fit.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Flat dicts only, no recursion needed, so the core logic isn't complicated.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: input format (list of dicts or *args), collision policy (last wins, first wins, or custom merge), and whether to mutate inputs. Then present a clean implementation using dictionary unpacking or a loop, and discuss trade-offs like performance and readability.

Pro tip: Mention that in Python 3.9+ you can use the | operator for merging, but be aware it creates a new dictionary and only works for two at a time. Also, highlight that handling collisions with a custom function (e.g., summing values) shows deeper understanding of real-world scenarios.

1. Clarify requirements

Ask about input structure, collision handling preference, and whether to modify original dictionaries. This shows you think about edge cases before coding.

2. Choose an approach

Decide between using dictionary unpacking ({**d1, **d2}), a loop with update(), or a functional approach. Consider Python version compatibility.

3. Implement the function

Write clean code with clear variable names. If handling collisions, implement a custom merge function that takes two values and returns the merged value.

4. Analyze trade-offs

Discuss time and space complexity (O(n) where n is total key-value pairs), and compare readability vs. performance of different methods.

5. Test and validate

Mention testing with empty dictionaries, overlapping keys, and non-string keys. Also consider if order of merging matters.

Key Points to Mention

  • Collision handling strategies: last-wins, first-wins, or custom merge function (e.g., summing values).
  • Python version differences: dict.update(), {**d1, **d2}, and the | operator (Python 3.9+).
  • Time and space complexity: O(n) time and space for creating a new dictionary.
  • Mutability: whether to modify the first dictionary in-place or create a new one.
  • Edge cases: empty input, non-string keys, and nested dictionaries (if applicable).
  • Readability vs. performance: using built-in methods vs. manual loops.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.