Akuna Capital Interview Questions
Practice the exact questions companies are asking right now.
Find minimum swaps to sort array with duplicates
Problem Given an integer array nums of length n that may contain duplicate values, you may perform swaps where you choose any two indices i and j and ...
Design user communication functions
In-Memory Communication Manager Context Build a simple in-memory component that tracks which users can communicate with each other. Treat a communicat...
Implement a ring buffer
Implement a fixed-capacity circular buffer (ring buffer) supporting push, pop, peek, isEmpty, isFull, and size in O( 1) time using an array. Define an...
Count inversions in an array efficiently
Given the array [5, 7, 9, 2, 3, 12, 8, 4], compute the number of inversion pairs (i, j) where i < j and arr[i] > arr[j]. Describe both a naive O(n^ 2)...
Design communication handler and exceptions
Implement a Communication Handler with Exceptions Context You are building a single-line communication handler that can connect exactly two Caller ins...
Design two-user communications handler with exceptions
Implement a two-user communications handler. Create: (A) CommsHandler(CommsHandlerABC) with methods connect(self, user1: Caller, user2: Caller) -> str...
Heapify an array into a max-heap
Given the array [6, 15, 2, 4, 3, 8, 19], apply heapify to build a max-heap using the standard in-place bottom-up method with a 0-indexed array represe...
Implement a two-user communications handler
One-at-a-time Two-User Communications Handler Context Design and implement a communications handler that supports exactly one active conversation at a...
Compute max profit across dated stock quotes
You are given an unsorted list of price records for multiple stocks, each record as (date, symbol, price). Dates may be repeated across different symb...
Design an order-matching engine
In-Memory Limit Order-Matching Engine (Limit Order Book) Context You are asked to design and implement an in-memory, single-instrument limit order boo...
Break a palindrome to smallest non-palindrome
Given a palindromic string s of lowercase English letters, change exactly one character to obtain a new string that is not a palindrome and is lexicog...
Implement React check-in/out month dropdowns
React UI Enhancement: Check-in/Check-out Month Dropdowns Context You are working on a hotel reservation form in a React codebase. The form needs two n...
Count subarrays equal to target
Given an integer array nums and an integer k, count the number of contiguous subarrays whose sum equals k. Solve it in O(n) time and O(n) space by mai...
Fix and harden an object pool
Refactor a Buggy C++ Object Pool Into a Correct, Thread-Safe Template Context You are given a buggy C++ object pool that suffers from races, double-fr...
Maximize profitable pairs
You are given an array profits of n integers representing net profit per item and an integer threshold T. You may form disjoint pairs (i, j). What is ...
Compute statistics in data stream
Question Design a data structure that supports computing the current max, mean, and mode for an unbounded integer data stream. Estimate the memory usa...
Trace code and find frequent character
1) Trace a simple algorithm: Given a short loop-and-conditional pseudo-code operating over an integer array, trace the values of key variables (e.g., ...
Evaluate SQL expressions for zero
Which of the following SQL expressions evaluate to 0? Evaluate each independently, justify the result, and note any dialect-specific behavior (e.g., M...
Compute min operations to transform integers
Given integers A and B, transform A into B using the minimum number of operations. Allowed operations: ( 1) subtract 1 from the current value; ( 2) mu...
Identify false MySQL foreign key statement
MySQL: Which of the following statements is false? A) A column might have a foreign key reference to itself. B) MySQL supports foreign key references ...