Citadel Securities OA (C++ Engineer)
- Result
- Ongoing
- Posted
- 12 Oct 2025
Summary
I participated in the Citadel Securities Online Assessment for a C++ Engineer role. The task involved refactoring complex C++ code to improve its time complexity, specifically solving a problem to find the maximum difference between elements x[i] - x[j] where j <= i within a 1.5-hour time limit.
How it went
I recently took the Online Assessment for a C++ Engineer position at Citadel Securities. The assessment was a challenging 1.5-hour task focused on refactoring existing, complex C++ code. A significant part of the challenge involved identifying misleading variable names and deceptive logic. For instance, some variables were named to suggest graph structures when none existed, and tricks like casting and bit shifting were used instead of simple x >= 0 checks, or squaring and then taking a square root instead of a direct a >= b comparison. The core algorithmic problem I needed to optimize was finding the max(x[i] - x[j]) where j <= i. I was required to reduce the initial O(n2) complexity to an O(n) solution.
Questions asked (1)
- 01
Max Difference x[i] - x[j] with j <= i
Data Structures & Algorithms · Medium
The primary algorithmic challenge was to implement a function that finds the maximum value of
x[i] - x[j]from a given arrayx, with the constraint that the indexjmust be less than or equal toi(j <= i). The initial implementation presented was O(n2) and needed to be optimized to achieve O(n) time complexity.