Akuna Capital Coding & Algorithms Interview Questions
Master your tech interview with our curated database of real questions from top companies.
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...
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...
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...
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...
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)...
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...
Solve sliding window, graph top-k, and greedy tasks
You have three coding tasks. Task 1 — Sliding window on strings: Given a string s and an integer k, find one longest substring of s that contains at m...
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...
Compute delivery order via BFS
A city road network is an unweighted, undirected graph G(V, E) with a depot node s and D delivery requests located at nodes r1..rD, each with an integ...
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 ...
Solve three C++ algorithmic tasks
Solve the following three C++ algorithmic tasks. For each, implement an efficient function and state time and space complexity. a) Diminishing prices ...
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...
Solve swaps, graph paths, and movie DP
Design and implement solutions for three tasks derived from a HackerRank-style assessment. 1) Minimum swaps to reverse sort an array: - Input: an inte...
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...
Design streaming stats with sliding window
Design a data structure that ingests an integer stream and supports online queries for maximum, mean, and mode. 1) Describe your update and query oper...
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., ...