Citadel Software Engineer Interview Experience — Optimizing a Correct C++ Function to Run Under 100 Microseconds

Citadel·Software Engineer·Aug 2026
Online Assessmentmedium

The assessment provided C++ source code for a root_node function. Its logic was correct, but it ran extremely slowly. The task was to refactor and optimize it so that it would finish in strictly less than 100 microseconds on large inputs.

The original code contained nested loops and operations such as std::find_if and std::advance, producing O(N²) complexity. I needed to reduce that to O(N).

It also used std::pow for squaring, complicated bit-shift operations, and mathematical functions such as std::sqrt. These needed equivalent mathematical derivations and faster replacements.

The optimized code still had to be logically identical to the original. It also needed to avoid unnecessary memory copies, for example by passing a vector as const vector<int>&.

Published

Curated and edited by PracHub

Practice the questions from this interview

Discussion

Sign in to join the discussion. The author is notified of every comment.

Loading comments…

Interview at a glance

Company
Citadel
Role
Software Engineer
Rounds
Online Assessment
Difficulty
medium
Interview date
Aug 2026
Questions from this interview
1 question

Real Citadel interview experiences

First-hand reports from Citadel candidates — the rounds, the questions they were asked, and how it went.

All 15 Citadel interview experiences