Citadel's SDE Intern OA is the "easy on paper, brutal on edges" archetype among quant firms. Three HackerRank problems—Price Check, Framing Text, Friend Recommendation—each LeetCode Easy~Medium, but Citadel's grader is the strictest among fintech OA platforms for string-format precision and boundary completeness. This post gives full Python AC solutions, complexity analysis, and hidden-case defenses for the 2026 internship OA.
Citadel SDE Intern OA Overview
| Dimension | Detail |
|---|---|
| Platform | HackerRank for Work |
| Duration | 70 minutes |
| Questions | 3 |
| Difficulty | LeetCode Easy ~ Medium |
| Pass rate | ~25-30% |
| Target roles | Citadel SDE Intern / Citadel Securities SDE Intern |
Problem 1: Price Check (Sale Price Errors)
Description
A cash-register clerk types prices manually and may mistype. Given:
products[n]: product namesproductPrices[n]: correct pricesproductSold[m]: names of items soldsoldPrice[m]: prices typed in
Return the count of incorrectly entered prices.
Example:
products = ['eggs', 'milk', 'cheese']
productPrices = [2.89, 3.29, 5.79]
productSold = ['eggs', 'eggs', 'cheese', 'milk '] # trailing space
soldPrice = [2.89, 2.99, 5.79, 3.29]
errors = 2 (second eggs sale wrong, cheese price wrong)
Approach
Build a name → price dict; compare each sale. Citadel's hidden cases stress:
- Trailing/leading spaces in product names →
.strip() - Floating point precision:
abs(a - b) < 1e-2, not== - Unknown product in
productSold: counts as an error
Python Solution
from typing import List
def price_check(
products: List[str],
product_prices: List[float],
products_sold: List[str],
sold_prices: List[float],
) -> int:
catalog = {p.strip(): pr for p, pr in zip(products, product_prices)}
errors = 0
for name, price in zip(products_sold, sold_prices):
key = name.strip()
if key not in catalog:
errors += 1
elif abs(catalog[key] - price) > 1e-2:
errors += 1
return errors
Time: O(n + m)
Space: O(n)
Hidden cases
| Input | Expected |
|---|---|
| Unknown product in productSold | counts as 1 error |
Different case (e.g., "Eggs") |
distinct product |
| Tiny float drift (0.001) | not an error |
Problem 2: Framing Text (Boxed Word Output)
Description
Given a multi-word string, output a rectangular frame with one word per line, padding 1 space on each side.
Input:
"Hello World in a frame"
Output:
+-------+
| Hello |
| World |
| in |
| a |
| frame |
+-------+
Approach
- Find the longest word length
L - Frame width =
L + 4(|+ word + right padding +|) - Left-align each word with right-padding
Python Solution
def print_boxed_text(s: str) -> str:
words = s.split()
if not words:
return ""
max_len = max(len(w) for w in words)
border = "+" + "-" * (max_len + 2) + "+"
lines = [border]
for w in words:
padded = w.ljust(max_len)
lines.append(f"| {padded} |")
lines.append(border)
return "\n".join(lines)
Time: O(n × L)
Space: O(n × L)
Hidden cases
| Input | Expected |
|---|---|
"" (empty) |
empty string (no border) |
| Multiple spaces | split() handles arbitrary whitespace |
| Single word | one-line frame |
| All words same length | width = len + 4 |
Scoring note: Citadel is strict about trailing newlines—no extra \n at the end of the returned string.
Problem 3: Friend Recommendation (Mutual Friends)
Description
n users (0 to n-1) and m friendship pairs. For each user, recommend the non-friend with the most mutual friends, breaking ties by lower index. Return -1 if no candidate exists.
Example:
n = 5
friendships = [[0,1], [0,2], [1,3], [2,3], [3,4]]
| User | Friends | Candidates | Mutual count | Recommend |
|---|---|---|---|---|
| 0 | {1, 2} | {3, 4} | 0&3={1,2}, 0&4={3} | 3 |
| 1 | {0, 3} | {2, 4} | 1&2={0,3}, 1&4={3} | 2 |
| 2 | {0, 3} | {1, 4} | 2&1={0,3}, 2&4={3} | 1 |
| 3 | {1, 2, 4} | {0} | 3&0={1,2} | 0 |
| 4 | {3} | {0, 1, 2} | all={3} | 0 (lowest index) |
Output: [3, 2, 1, 0, 0]
Approach
Store each user's friends in a set. For each user i, iterate all non-friends j and pick max-mutual.
Python Solution
from typing import List
def recommend(n: int, friendships: List[List[int]]) -> List[int]:
friends = [set() for _ in range(n)]
for a, b in friendships:
friends[a].add(b)
friends[b].add(a)
result: List[int] = []
for i in range(n):
best_j = -1
best_count = -1
for j in range(n):
if j == i or j in friends[i]:
continue
count = len(friends[i] & friends[j])
if count > best_count or (count == best_count and j < best_j):
best_count = count
best_j = j
if best_count <= 0:
result.append(-1)
else:
result.append(best_j)
return result
Time: O(n² × avg_degree)
Space: O(n + m)
Hidden cases
| Input | Expected |
|---|---|
| Isolated user | -1 (no mutuals possible) |
| All candidates have 0 mutuals | -1 |
Self-loop [i, i] |
excluded by j == i |
| Duplicate friendship pair | set deduplicates |
The Citadel twist: "0 mutual friends → -1," not "the lowest-index candidate." There's at least one all-zero hidden case.
Pass Strategy (70 minutes)
1) Time budget
| Problem | Recommended time |
|---|---|
| Price Check | 10 min |
| Framing Text | 15 min |
| Friend Recommendation | 30 min |
| Debug buffer | 15 min |
2) Treat string formatting as priority 1
Citadel's grader does exact-match string comparison. Before submitting, repr() your output and visually compare.
3) Don't over-optimize Friend Recommendation
n ≤ 1000 typically; O(n²) suffices. Premature optimization introduces bugs.
FAQ
What's the Citadel SDE Intern OA pass rate?
~25-30%. Among quant firms, Citadel has moderate OA difficulty but the lowest pass rate—primarily because the resume screen is already extremely tight; the candidates who reach the OA are uniformly top-tier.
Will these 3 problems still appear in 2026?
Yes. Price Check and Framing Text are evergreen Citadel questions (2024-2026). Friend Recommendation appears in ~40% of 2026 internship cycle reports, rotating with Process Allocation / Load Balancing.
Can I skip questions on HackerRank?
Yes, but highly recommended to go in order—Price Check is a warmup; finishing it stabilizes nerves. Jumping to Friend Recommendation increases timeout risk.
When does Citadel reply post-OA?
Typically 3-5 business days. Citadel decides faster than JPMorgan / Goldman Sachs—rapid decision-making is part of Citadel's hiring culture.
Same OA for Citadel and Citadel Securities interns?
No. Citadel (the hedge fund) tilts toward algorithms / data structures. Citadel Securities (market-making) adds 1 probability/market-making problem or Pandas data-processing problem.
Preparing for the Citadel SDE Intern OA?
oavoservice supports OA prep across Citadel / Citadel Securities / Two Sigma / Jane Street / HRT: question taxonomies, hidden-case defenses, Python production templates. Our coaches include former Citadel quant developers who specifically address Citadel's strict-format grading.
Add WeChat Coding0201 to book Citadel OA coaching.
#Citadel #CitadelOA #SDEIntern #HackerRank #QuantFinance #OARealQuestions
Contact
Email: [email protected]
Telegram: @OAVOProxy