Citadel Interview Questions

Citadel analyzes global markets with discipline and focuses on and employs a range of strategies in an effort to deliver market-leading investment returns to our capital partners. Citadel empowers the most talented minds in finance with an unparalleled combination of deep fundamental research, predictive analytics, and leading-edge technology to identify and capture new opportunities. Our world-class global team brings together the art of investing with the science of finance to help our capital partners achieve their financial goals. Citadel drives our mission through a culture of excellence: constantly improving, continuously learning, rewarding results, and winning with integrity.

It has got a 3.7* rating on Glassdoor and is considered one of the best product-based companies. It is highly regarded for its work-life balance.

They provide good training as well which will be beneficial in future too. You can practice the below Citadel Interview Questions for the interview. We have collected past frequently asked Citadel Interview Questions for your reference.

Citadel Array Questions

Question 1. Insert Delete GetRandom O(1) Leetcode Solution Problem Statement The Insert Delete GetRandom O(1) LeetCode Solution – “Insert Delete GetRandom O(1)” asks you to implement these four functions in O(1) time complexity. insert(val): Insert the val into the randomized set and return true if the element is initially absent in the set. It returns false when the ...

Read more

Question 2. Trapping Rain Water Leetcode Solution Problem Statement The Trapping Rain Water LeetCode Solution – “Trapping Rain Water” states that given an array of heights which represents an elevation map where the width of each bar is 1. We need to find the amount of water trapped after rain. Example: Input: height = [0,1,0,2,1,0,1,3,2,1,2,1] Output: 6 Explanation: Check ...

Read more

Question 3. Coin Change 2 Leetcode Solution Problem Statement The Coin Change 2 LeetCode Solution – “Coin Change 2” states that given an array of distinct integers coins and an integer amount, representing a total amount of money. We need to return the count of the total number of different possible combinations that sum to the amount.  ...

Read more

Question 4. Count of index pairs with equal elements in an array Suppose, we have given an integer array. The problem “Count of index pairs with equal elements in an array” asks to find out the no of pair of indices (i,j) in such a way that arr[i]=arr[j] and i is not equal to j. Example arr[] = {2,3,1,2,3,1,4} 3 Explanation Pairs ...

Read more

Question 5. Longest subarray not having more than K distinct elements The problem “Longest subarray not having more than K distinct elements” states that suppose you have an array of integers, the problem statement asks to find out the longest sub-array that having not greater than k different elements. Example arr[] = {4, 3, 5, 2, 1, 2, 0, 4, 5} ...

Read more

Question 6. Minimum operation to make all elements equal in array The problem “Minimum operation to make all elements equal in array” states that you are given an array with some integers in it. You have to find out the minimum operations that can be done to make an array equal. Example [ 1,3,2,4,1] 3 Explanation Either 3 subtractions can be ...

Read more

Question 7. Difference between highest and least frequencies in an array The problem “Difference between highest and least frequencies in an array” states that suppose that you have an integer array. The problem statement asks to find out the maximum difference between the highest frequency and lowest frequency of two distinct numbers in an array. Example arr[] = {1, 2, 3, ...

Read more

Question 8. k-th missing element in increasing sequence which is not present in a given sequence The problem “k-th missing element in increasing sequence which is not present in a given sequence” states that you are given two arrays. One of them is arranged in ascending order and another normal unsorted array with number k. Find the kth missing element which is not present in normal ...

Read more

Question 9. Check if a given array contains duplicate elements within k distance from each other The problem “Check if a given array contains duplicate elements within k distance from each other” states that we have to check for duplicates in given unordered array within the range of k. Here the value of k is smaller than the given array. Examples K = 3   arr[] = ...

Read more

Question 10. Find all pairs (a, b) in an array such that a % b = k Problem Statement The problem “Find all pairs (a, b) in an array such that a % b = k” states that you are given an array of integers and an integer value called k. The problem statement asks to find out the pair in such a way that that x ...

Read more

Question 11. Queries on XOR of greatest odd divisor of the range Problem Statement The problem “Queries on XOR of greatest odd divisor of the range” states that you are given an array of integer and query q, each query consists of a range. The problem statement asks to find out the XOR of the greatest odd divisor within the given range ...

Read more

Question 12. Three way partitioning of an array around a given range Problem Statement You are given an array of integers and a range of lowValue and highValue. The problem “Three way partitioning of an array around a given range” asks to partition the array such that array will be divided into three parts. The partitions of the arrays will be: Elements ...

Read more

Question 13. Replace two consecutive equal values with one greater Problem Statement Suppose you have an integer array. The problem “Replace two consecutive equal values with one greater” asks to replace all those pair values say ‘a’ which comes consecutively with a number “a+1” 1 greater than them (two consecutive numbers), such that even after the modification or repetition there ...

Read more

Question 14. Find a sorted subsequence of size 3 in linear time Problem Statement The problem “Find a sorted subsequence of size 3 in linear time” states that you have an integer array. The problem statement asks to find out the three numbers in such a way that array[i] < array [k] < array[k], and i < j < k. Example arr[] ...

Read more

Question 15. Rearrange an array in order – smallest, largest, 2nd smallest, 2nd largest Problem Statement Suppose you have an integer array. The problem “Rearrange an array in order – smallest, largest, 2nd smallest, 2nd largest, ..” asks to rearrange the array in such a way that the smallest number comes first and then the largest number, then second smallest and then the second ...

Read more

Question 16. Count pairs from two sorted arrays whose sum is equal to a given value x Problem Statement “Count pairs from two sorted arrays whose sum is equal to a given value x” problem states that you are given two sorted arrays of integers and an integer value called sum. The problem statement asks to find out the total number of pair which sums up to ...

Read more

Question 17. Printing brackets in Matrix Chain Multiplication Problem Problem Statement We need to find the order of multiplication of matrices such that the number of operations involved in the multiplication of all the matrices is minimized. Then we need to print this order i.e. printing brackets in matrix chain multiplication problem. Consider you have 3 matrices A, B, ...

Read more

Question 18. Insert Delete GetRandom In Insert Delete GetRandom problem we need to design a data structure that supports all following operations in average O(1) time. insert(val): Inserts an item val to the set if not already present. remove(val): Removes an item val from the set if present. getRandom: Returns a random element from the current set ...

Read more

Question 19. Increasing Subsequence of Length three with Maximum Product Problem Statement In the “Increasing Subsequence of Length three with Maximum Product” problem, we have given an array of positive integers. Find the subsequence of length 3 with the maximum product. Subsequence should be increasing. Input Format The first and only one line containing an integer N denoting the size ...

Read more

Question 20. Find the Maximum Repeating Number in Array Problem Statement In the “Find the Maximum Repeating Number in Array” problem we have given an unsorted array of size N. Given array contains numbers in range {0, k} where k <= N. Find the number that is coming the maximum number of times in the array. Input Format The ...

Read more

Question 21. Count of Triplets With Sum Less than Given Value Problem Statement We have given an array containing N number of elements. In the given array, Count the number of triplets with a sum less than the given value. Example Input a[] = {1, 2, 3, 4, 5, 6, 7, 8} Sum = 10 Output 7 Possible triplets are : ...

Read more

Question 22. Find Triplet in Array With a Given Sum Problem Statement Given an array of integers, find the combination of three elements in the array whose sum is equal to a given value X. Here we will print the first combination that we get. If there is no such combination then print -1. Example Input N=5, X=15 arr[] = ...

Read more

Question 23. First Repeating Element Problem Statement We have given an array that contains n integers. We have to find the first repeating element in the given array. If there is no repeated element then print “No repeating integer found”. Note: Repeating elements are those elements that come more than once. (Array may contain duplicates) ...

Read more

Question 24. A Product Array Puzzle Problem Statement In a product array puzzle problem we need to construct an array where the ith element will be the product of all the elements in the given array except element at the ith position. Example Input  5 10 3 5 6 2 Output 180 600 360 300 900 ...

Read more

Question 25. Find the first Repeating Number in a Given Array Problem Statement There can be multiple repeating numbers in an array but you have to find the first repeating number in a given array (occurring the second time). Example Input 12 5 4 2 8 9 7 12 5 6 12 4 7 Output 5 is the first repeating element ...

Read more

Citadel String Questions

Question 26. Different Ways to Add Parentheses Leetcode Solution Problem Statement The Different Ways to Add Parentheses LeetCode Solution – “Different Ways to Add Parentheses” states that given a string expression of numbers and operators. We need to return all possible results from computing all different possible ways to group numbers and operators. Return the answer in any order. ...

Read more

Question 27. Check if all Rows of a Matrix are Circular Rotations of Each Other Problem Statement In the “Check if all Rows of a Matrix are Circular Rotations of Each Other” problem we have given a char matrix, write a program to find whether all rows are circular rotations of each other or not. If all rows are circular rotations of each other print ...

Read more

Question 28. Length of Longest valid Substring Problem Statement In the “Length of Longest valid Substring” we have given a string that contains the opening and closing parenthesis only. Write a program that will find the longest valid parenthesis substring. Input Format The first and only one line containing a string s. Output Format The first and ...

Read more

Citadel Tree Questions

Question 29. Construct Binary Tree from Given Inorder and Preorder Traversals In this problem, we have inorder and preorder of the binary tree. We need to construct a binary tree from the given Inorder and Preorder traversals. Example Input: Inorder= [D, B, E, A, F, C] Preorder= [A, B, D, E, C, F] Output: Pre-order traversal of the tree formed by ...

Read more

Question 30. Validate Binary Search Tree Problem In Validate Binary Search Tree problem we have given the root of a tree, we have to check if it is a binary search tree or not. Example : Output: true Explanation: The given tree is a binary search tree because all elements which are left to each subtree ...

Read more

Citadel Stack Questions

Question 31. Trapping Rain Water Leetcode Solution Problem Statement The Trapping Rain Water LeetCode Solution – “Trapping Rain Water” states that given an array of heights which represents an elevation map where the width of each bar is 1. We need to find the amount of water trapped after rain. Example: Input: height = [0,1,0,2,1,0,1,3,2,1,2,1] Output: 6 Explanation: Check ...

Read more

Citadel Queue Questions

Question 32. Priority Queue using doubly linked list Problem Statement The problem “Priority Queue using doubly linked list” asks to implement the following functions of priority queue using doubly linked list. push(x, p) : Enqueue an element x with priority p in the priority queue at appropriate position. pop() : Remove and return the element with highest priority ...

Read more

Citadel Matrix Questions

Question 33. Printing brackets in Matrix Chain Multiplication Problem Problem Statement We need to find the order of multiplication of matrices such that the number of operations involved in the multiplication of all the matrices is minimized. Then we need to print this order i.e. printing brackets in matrix chain multiplication problem. Consider you have 3 matrices A, B, ...

Read more

Question 34. Check if all Rows of a Matrix are Circular Rotations of Each Other Problem Statement In the “Check if all Rows of a Matrix are Circular Rotations of Each Other” problem we have given a char matrix, write a program to find whether all rows are circular rotations of each other or not. If all rows are circular rotations of each other print ...

Read more

Citadel Other Questions

Question 35. Best Time to Buy and Sell Stock IV LeetCode Solution Problem Statement: Best Time to Buy and Sell Stock IV LeetCode Solution: You are given an integer array prices where prices[i] is the price of a given stock on the ith day, and an integer k. Find the maximum profit you can achieve. You may complete at most k transactions. Note: You may not engage in multiple transactions simultaneously ...

Read more

Question 36. Group Anagrams LeetCode Solution Problem Statement Group Anagrams LeetCode Solution Says that – Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. Example 1: ...

Read more

Question 37. Sliding Window Maximum LeetCode Solution Problem Statement Sliding Window Maximum LeetCode Solution Says that – You are given an array of integers nums, and there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time ...

Read more

Question 38. Pairs of Songs With Total Durations Divisible by 60 LeetCode Solution Problem Statement Pairs of Songs With Total Durations Divisible by 60 LeetCode Solution – Pairs of Songs With Total Durations Divisible by 60 LeetCode Solution says that – You are given a list of songs where the ith song has a duration of time[i] seconds. Return the number of pairs of songs for which ...

Read more

Question 39. LRU Cache Leetcode Solution Problem Statement The LRU Cache LeetCode Solution – “LRU Cache” asks you to design a data structure that follows Least Recently Used (LRU) Cache We need to implement LRUCache class that has the following functions: LRUCache(int capacity): Initializes the LRU cache with positive size capacity. int get(int key): Return the value ...

Read more

Question 40. Evaluate Reverse Polish Notation LeetCode Solution Problem Statement Evaluate Reverse Polish Notation LeetCode Solution – Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, and /. Each operand may be an integer or another expression. Note that the division between two integers should truncate toward zero. It is guaranteed that the given ...

Read more

Question 41. Time Based Key-Value Store LeetCode Solution Problem Statement Time Based Key-Value Store LeetCode Solution – Design a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key’s value at a certain timestamp. Implement the TimeMap class: TimeMap() Initializes the object of the data structure. void set(String key, String ...

Read more

Question 42. Find Median from Data Stream LeetCode Solution Problem Statement Find Median from Data Stream LeetCode Solution – The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value and the median is the mean of the two middle values. For example, for arr = [2,3,4], the median ...

Read more

Question 43. Asteroid Collision LeetCode Solution Problem Statement Asteroid Collision LeetCode Solution – We are given an array asteroids of integers representing asteroids in a row. For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative meaning left). Each asteroid moves at the same speed. Find out the state ...

Read more

Question 44. Serialize and Deserialize Binary Tree LeetCode Solution Problem Statement Serialize and Deserialize Binary Tree LeetCode Solution – Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in ...

Read more

Question 45. Product of Array Except Self LeetCode Solution Problem Statement Product of Array Except Self LeetCode Solution – Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i]. The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer. You must write an algorithm that runs in O(n) time and without using the division ...

Read more

Question 46. Kth Smallest Element in a BST Leetcode Solution Problem Statement Kth Smallest Element in a BST Leetcode Solution – Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree. Examples: Input: root = [3,1,4,null,2], k = 1 Output: 1   Input: root = [5,3,6,2,4,null,null,1], k ...

Read more

Question 47. Ugly Number II LeetCode Solution Problem Statement Ugly Number II LeetCode Solution – An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5. Given an integer n, return the nth ugly number. Input: n = 10 Output: 12 Explanation: [1, 2, 3, 4, 5, 6, 8, 9, 10, 12] is the sequence of the first 10 ...

Read more

Question 48. Integer Break LeetCode Solution Problem Statement Integer Break LeetCode Solution – Given an integer n, break it into the sum of k positive integers, where k >= 2, and maximize the product of those integers. We need to Return the maximum product we can get. Input: n = 2 Output: 1 Explanation: 2 = 1 + 1, ...

Read more

Question 49. Maximum Product of Three Numbers LeetCode Solution Problem Statement Maximum Product of Three Numbers LeetCode Solution – We are given an array, the question asks us to calculate the maximum product of any 3 numbers. Examples Example 1: Input: nums = [1,2,3] Output: 6 Example 2: Input: nums = [1,2,3,4] Output: 24 Example 3: Input: nums = ...

Read more

Question 50. Word Ladder LeetCode Solution Problem Statement The Word Ladder LeetCode Solution – “Word Ladder” states that you are given a string beginWord, string endWord, and a wordList. We need to find the shortest transformation sequence length (if no path exists, print 0) from beginWord to endWord following the given conditions: All the Intermediate Words should ...

Read more

Question 51. Best Time to Buy and Sell Stock LeetCode Solution Problem Statement The Best Time to Buy and Sell Stock LeetCode Solution – “Best Time to Buy and Sell Stock” states that You are given an array of prices where prices[i] is the price of a given stock on an ith day. You want to maximize your profit by choosing ...

Read more

Question 52. Print n terms of Newman-Conway Sequence Problem Statement The problem “Print n terms of Newman-Conway Sequence” states that you are given an integer “n”. Find the first n terms of Newman-Conway Sequence then print them. Example n = 6 1 1 2 2 3 4 Explanation All the terms which are printed follow the Newman-Conway Sequence ...

Read more

Question 53. Sliding Window Maximum In Sliding Window Maximum problem we have given an array nums, for each contiguous window of size k, find the maximum element in the window. Example Input nums[] = {1,3,-1,-3,5,3,6,7} k = 3 Output {3,3,5,5,6,7} Explanation Naive Approach for Sliding Window Maximum For every contiguous window of size k, traverse ...

Read more

Question 54. LRU Cache Implementation Least Recently Used (LRU) Cache is a type of method which is used to maintain the data such that the time required to use the data is the minimum possible. LRU algorithm used when the cache is full. We remove the least recently used data from the cache memory of ...

Read more

Question 55. Serialize and Deserialize Binary Tree We have given a binary tree containing N number of nodes where each node has some value. We need to serialize and deserialize the binary tree. Serialize The process of storing a tree in a file without disturbing its structure is called serialization. DeserializeSerialize and Deserialize Binary Tree The process ...

Read more

Translate »