← Akuna Capital Interview Insights

Akuna Capital·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Akuna Capital Data Engineer interview with a coding problem around portfolio rebalancing in Java. Pretty focused on clean implementation details rather than raw algorithmic complexity.

Questions Asked (1)

Q1

Given two portfolio objects each exposing a map of asset names to integer allocations, compute the per-asset difference (target minus current) and return the result in insertion-order-preserving map.

Algorithms & Data StructuresAPI & IntegrationsTechnical Trade-offs
Author's notes

The core logic isn't hard but I spent a minute second-guessing whether to iterate over the target keys or union both key sets.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the requirements: the function should compute target minus current for each asset, include assets that appear in either map, and preserve insertion order. Then outline an algorithm that iterates over both maps, using a LinkedHashMap to accumulate differences, and discuss handling of missing keys and zero differences.

Pro tip: Mention that you would use a LinkedHashMap to preserve insertion order and that you would decide whether to include zero-difference entries based on business needs, showing attention to detail and domain awareness.

1. Clarify requirements

Confirm that the result should include all assets from both portfolios, with missing allocations treated as zero, and that insertion order must be preserved.

2. Choose data structures

Use a LinkedHashMap to store the result, ensuring insertion order is maintained. Iterate over the target portfolio first, then the current portfolio.

3. Compute differences

For each asset in the target map, compute target - current (using 0 if absent in current) and put into the result map. Then iterate over the current map to handle assets not in target, computing 0 - current.

4. Handle edge cases

Decide whether to include zero-difference entries; if not, skip them. Also consider null inputs, empty maps, and negative allocations.

5. Analyze complexity

State that the time complexity is O(n + m) where n and m are the sizes of the two maps, and space complexity is O(k) where k is the number of unique assets.

Key Points to Mention

  • Use of LinkedHashMap to preserve insertion order
  • Iterating over both maps to include all assets
  • Treating missing assets as zero allocation
  • Deciding whether to include zero-difference entries
  • Time and space complexity analysis
  • Handling edge cases like null inputs or empty maps

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