← Akuna Capital Interview Insights

Akuna Capital·Software Engineer·Technical Phone Screen·Junior

JuniorPrefer not to say
May 2026

Summary

Interviewed for a software engineer role at Akuna Capital. Two questions, both pretty algorithmic. Nothing too wild but the tracing question had some gotchas I didn't fully anticipate going in.

Questions Asked (2)

Q1

Given a short pseudo-code snippet with a loop and conditionals operating over an integer array, trace the values of key variables step by step for a given input, state the final result, identify the time and space complexity, and flag any off-by-one errors.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

The tracing part was fine until I rushed the last iteration and got the final value wrong.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, restate the pseudo-code in your own words and clarify the input array and any assumptions. Then trace the loop iteration by iteration, maintaining a table of variable values, and finally analyze time/space complexity and check for off-by-one errors.

Pro tip: While tracing, explicitly state the loop bounds and array indices to catch off-by-one errors early. Also, mention that you would test edge cases like empty array or single element to validate the logic.

1. Understand and restate the problem

Read the pseudo-code carefully, identify the input array, loop bounds, and conditional logic. Restate the goal: trace variables, find final result, analyze complexity, and flag off-by-one errors.

2. Trace the execution step by step

Create a table with columns for iteration number, index, and key variables. Walk through each iteration, updating values according to the pseudo-code, and note any conditional branches taken.

3. Determine the final result

After the loop terminates, state the final values of all relevant variables and the overall output or return value of the pseudo-code.

4. Analyze time and space complexity

Count the number of operations in terms of input size n. Identify if the loop is O(n), O(n^2), etc., and determine auxiliary space usage (e.g., O(1) if only a few variables).

5. Check for off-by-one errors

Examine loop conditions (e.g., i < n vs i <= n) and array indexing (0-based vs 1-based). Verify if the loop processes all elements correctly and if any element is skipped or accessed out of bounds.

Key Points to Mention

  • Loop bounds and array indexing (0-based vs 1-based) to identify off-by-one errors.
  • Conditional logic and how it affects variable updates.
  • Time complexity analysis: count iterations and operations per iteration.
  • Space complexity: auxiliary space used beyond input.
  • Edge cases: empty array, single element, all elements satisfying condition, etc.
  • Final result and any side effects or return values.

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

Q2

Given a case-insensitive string, return the most frequently occurring character. If there's a tie, return the lexicographically smallest one. Walk through an O(n) solution and discuss the space trade-offs involved.

Algorithms & Data Structures
Author's notes

Got the frequency map approach out fast.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem constraints (e.g., character set, input size) and then propose a single-pass O(n) solution using a frequency array or hash map. After counting, iterate through the frequency structure to find the most frequent character, breaking ties by lexicographical order. Finally, discuss the space trade-offs between using a fixed-size array (O(1) space for ASCII) versus a hash map (O(k) space for k distinct characters).

Pro tip: Mention that for ASCII, a fixed array of size 128 or 256 is more efficient and uses constant space, but for Unicode, a hash map is necessary—this shows you consider practical constraints and scalability.

1. Clarify requirements and constraints

Ask about the character set (ASCII vs. Unicode), input size, and whether the string can be empty. This determines the appropriate data structure and edge case handling.

2. Choose data structure for frequency counting

Decide between a fixed-size array (for ASCII) or a hash map (for Unicode) based on the character set. Explain the trade-offs: array is O(1) space and faster, but limited to a known set; hash map is O(k) space and flexible.

3. Count frequencies in one pass

Iterate through the string, convert each character to lowercase (for case-insensitivity), and update the frequency count in the chosen data structure. This is O(n) time.

4. Find the most frequent character with tie-breaking

Iterate through the frequency structure to find the character with the highest count. For ties, compare characters lexicographically (e.g., using their ASCII values) and keep the smallest. This is O(k) time, where k is the number of distinct characters.

5. Analyze time and space complexity

State that the overall time complexity is O(n + k) which simplifies to O(n) since k ≤ n. Discuss space: O(1) for fixed array (if ASCII) or O(k) for hash map, and note that k is bounded by the alphabet size.

Key Points to Mention

  • Case-insensitivity: normalize characters to lowercase (or uppercase) before counting.
  • Tie-breaking: when counts are equal, choose the lexicographically smallest character (e.g., 'a' < 'b').
  • Time complexity: O(n) for counting plus O(k) for finding max, which is O(n) overall.
  • Space trade-offs: fixed array (O(1) space, fast, limited to ASCII) vs. hash map (O(k) space, flexible for Unicode).
  • Edge cases: empty string (return null or throw exception), all characters same, multiple ties.
  • Optimization: if using a fixed array, iterate from smallest to largest character to naturally handle tie-breaking.

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