Akuna Capital Software Engineer Coding & Algorithms Interview Questions
Master your tech interview with our curated database of real questions from top companies.
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...
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)...
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...
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...
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 ...
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...
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., ...