DEV Community

Cover image for Akuna Capital OA Checks Whether You Used AI — Even Analyzing Your Syntax Tree
interviewshow-cs
interviewshow-cs

Posted on

Akuna Capital OA Checks Whether You Used AI — Even Analyzing Your Syntax Tree


I just finished Akuna Capital's OA on HackerRank. The format was three coding problems in two hours.
The problems themselves were not extremely difficult, but there is one thing worth mentioning first.


Akuna Capital clearly states in the OA instructions that AI tools are not allowed.
Their detection methods are also quite advanced: they analyze the code's abstract syntax tree (AST),
compare patterns against typical AI-generated solutions, and check for similarities between candidates'
submissions.


Even more interestingly, they have reportedly included AI trap questions.
Some problem statements contain details designed to mislead AI reasoning, causing generated solutions
to fail in specific ways. For candidates who rely heavily on vibe coding, this OA is definitely not
something to gamble on.


The good news is that Akuna's question pool is relatively small. There are only around a dozen recurring
problems, and the overlap rate is quite high. Here is a breakdown of the three questions I encountered.

Question 1: Minimum Swaps


A store wants to arrange products from highest popularity to lowest popularity. Each product has a unique
popularity value. In one operation, you can swap any two products. Find the minimum number of swaps needed.


Example:
[3, 4, 1, 2]


Swap 3 and 4:
[4, 3, 1, 2]

Swap 1 and 2:
[4, 3, 2, 1]


The answer is 2 swaps.

Solution Approach


This is a classic permutation cycle problem.
Map every element's current position to its correct position after sorting.
The array can then be divided into several cycles.
A cycle of length k requires exactly k - 1 swaps to fix.


Therefore, the answer is:


number of elements - number of cycles


Implementation steps:

  • Find the target index of each element after sorting in descending order.
  • Use a visited array to detect cycles.
  • For each cycle of length k, add k - 1 to the answer.

Question 2: Delivery Management System


A company delivers packages between cities. Cities are connected by bidirectional roads, and some cities
may not be reachable.


Delivery order follows these rules:

  • Visit cities with smaller distance from headquarters first.
  • If two cities have the same distance, visit the city with the smaller index first.


Example:


Four cities with roads:
1-2, 2-3, 2-4


Starting from city 1:
[2, 3, 4]

Solution Approach


Use BFS to calculate the shortest distance from the starting city because all edges have equal weight.
Then sort reachable cities by:


(distance, city_number)


Important edge cases:

  • The headquarters city should not appear in the result.
  • Ignore unreachable cities.
  • Be careful with 1-based indexing.

Question 3: Movie Ratings


Alex has a sequence of movie ratings, including positive and negative values.
He wants to select a subsequence with the maximum possible total rating.
However, he cannot skip two movies consecutively.


Example:


For:
[-1, -3, -2]


The second movie must be selected, or both the first and third movies must be selected.
The maximum score is:
-3


Another example:


[-3, 2, 4, -1, -2, -5]


The optimal selection is:
[2, 4, -2]
with a total score of 4.

Solution Approach


This is a linear dynamic programming problem.
The rule "cannot skip two consecutive movies" means the distance between any two selected indexes
cannot exceed 2.


Define:


dp[i] = maximum score when selecting the i-th movie.


Transition:


dp[i] = ratings[i] + max(dp[i-1], dp[i-2])


The final answer is:


max(dp[n-1], dp[n-2])


because skipping the last movie is allowed, but skipping the last two movies is not.

Final Thoughts


These three problems test three classic patterns:

  • Permutation cycles for minimum swaps
  • BFS shortest path with custom sorting
  • Linear dynamic programming


The common theme is that the problems are wrapped in business scenarios:
product ranking, delivery systems, and movie festivals.
Once you remove the story, they are standard algorithm patterns.


The most valuable information is that Akuna's OA question pool is relatively small and has a high overlap
rate. Reviewing the recurring patterns before the assessment can significantly improve your preparation
efficiency.


I collected these verified Akuna OA questions and similar quantitative interview materials through
InterviewShow.
For companies with smaller question pools, practicing representative problems before the OA usually
provides the highest return.


Good luck with your interviews!


Top comments (0)