CodeSignal OAs logo

CodeSignal OAs Hard Interview Questions

24 hard-level practice questions for CodeSignal OAs technical interviews

CodeSignal OAs software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.

Software Engineer Backend Engineer Frontend Engineer Full Stack Engineer Mobile Engineer Data Engineer Data Scientist ML Engineer DevOps Engineer DevOps Engineer Product Manager SRE Security Engineer Engineering Manager Data Analyst UX/UI Designer QA Engineer
coding Hard Verified Question #1

1. OA[CodeSignal] Cloud File Storage System


Category: Graph coding problem

Question Your task is to implement a simple in-memory cloud storage system that maps objects (files) to their metadata (name, size, etc.). You...

Input: Graph (nodes and edges)
Output: Array
Want to practise this one?
Create a free account to open the full question and practise CodeSignal OAs questions with AI.
Sign up free
coding Hard Verified Question #2

2. OA[CodeSignal] Design Banking System


Category: Graph coding problem

Question Design a banking system that supports account management, transactions, and various financial operations.

Input: Graph (nodes and edges)
Output: Computed result
coding Hard Verified Question #3

3. OA[CodeSignal] In-Memory Database


Category: Graph coding problem

Description Implement a simplified in-memory database that supports record manipulation with various operations. The system should handle basic...

Input: Graph (nodes and edges)
Output: Array
coding Hard Verified Question #4

4. OA[CodeSignal] Employee Management System


Category: Graph coding problem
You are tasked with designing an employee management system that tracks work sessions, calculates work hours, handles promotions, and manages salary...
Input: Graph (nodes and edges)
Output: Computed result
coding Hard Verified Question #5

5. OA [CodeSignal] Adventure Levels


Category: Array coding problem

OA [CodeSignal] Adventure Levels You start with initial energy K. You need to clear a series of adventure levels. For each level i: -...

Input: Array
Output: Array
coding Hard Verified Question #6

6. OA [CodeSignal] Balanced Numbers in Permutation


Category: Array coding problem

OA [CodeSignal] Balanced Numbers in Permutation Given a permutation p of integers from 1 to n. A number k (where 1 <= k <= n) is called...

Input: Array
Output: Computed result
coding Hard Verified Question #7

7. OA [CodeSignal] Count Palindrome Paths in Tree


Category: Tree coding problem
Given a tree with n nodes where each node has a lowercase English character c[i]. A path is palindromic if the characters along the path can...
Input: List
Output: Computed result
coding Hard Verified Question #8

8. OA [CodeSignal] Max Throughput With Budget


Category: Algorithm coding problem
You have a pipeline of services. Each service has: - Current throughput throughput[i] - Cost to scale up by 1 unit scalecost[i] You have a fixed...
Input: List
Output: Integer
coding Hard Verified Question #9

9. OA [CodeSignal] Minimum Edge Reversal Root


Category: Graph coding problem
Given a directed graph (represented as a tree with directed edges), choose a root node such that the minimum number of edges must be reversed so that...
Input: Graph (nodes and edges)
Output: Integer
coding Hard Verified Question #10

10. OA [CodeSignal] Purchase Optimization


Category: Array coding problem
Alex is shopping at Ozone Gallerie Mall where cubicles are arranged in non-decreasing order of prices from left to right. Given: - prices: array of...
Input: Array
Output: Integer
coding Hard Verified Question #11

11. OA [CodeSignal] Touring the Building


Category: Algorithm coding problem
You are on floor 0 of a building and need to reach floor n. You can use either the lift or stairs. Lift: - Takes t1 time per floor -...
Input: Given input
Output: Computed result
coding Hard Verified Question #12

12. [CodeSignal] House Segments After Destruction


Category: Array coding problem

Question You are monitoring the building density in a district of houses. The district is represented as a number line, where each house is located...

Input: Array of integers
Output: Array
coding Hard Verified Question #13

13. [CodeSignal] Warehouse Emergency Deliveries


Category: Array coding problem
Amazon has opened a new warehouse recently. There are no products in the warehouse currently. The warehouse is under inspection for n days. The...
Input: Array
Output: Integer
coding Hard Verified Question #14

14. [CodeSignal] Permutation Sorter


Category: Combinatorics coding problem
Amazon engineers are testing a new tool, the Permutation Sorter, built to reorder sequences using limited operations. Given a permutation of...
Input: Integer(s)
Output: Integer
coding Hard Verified Question #15

15. [CodeSignal] Maximum Product Rating


Category: Array coding problem
The engineers at Amazon are working on a new rating system for their products. For each product, an array customer_rating is maintained for the...
Input: Array
Output: Computed result
coding Hard Verified Question #16

16. OA [CodeSignal] Knowledge Base System


Category: Graph coding problem
Design and implement a personal knowledge base called KnowledgeBaseSystem that stores articles with CRUD operations. The system operates entirely...
Input: Graph (nodes and edges)
Output: Computed result
coding Hard Verified Question #17

17. [CodeSignal] Synchronized Pipeline Delays


Category: Binary tree coding problem
A hierarchical data pipeline consists of n broadcast stages, numbered 1 to n, arranged in a perfect binary tree rooted at stage 0. Each stage...
Input: Binary tree
Output: Computed result
coding Hard Verified Question #18

18. [CodeSignal] Fibonacci Storage System


Category: Graph coding problem
A research facility stores artifacts in underground vaults. Each vault has multiple tiers, indexed from 0 (deepest) upward. The capacity of each tier...
Input: Graph (nodes and edges)
Output: Computed result
coding Hard Verified Question #19

19. [CodeSignal] Fixed Price Purchase Optimizer


Category: Algorithm coding problem
A procurement team must purchase n identical components one at a time. For each component, the quoted market price is drawn independently and...
Input: Given input
Output: Integer
coding Hard Verified Question #20

20. [CodeSignal] Battery Rotation Scheduler


Category: Array coding problem
A remote system uses a circular array of backup generators to sustain a critical task. Each generator can power the system for a fixed number of...
Input: Array
Output: Integer
coding Hard Verified Question #21

21. [CodeSignal] Grid Arithmetic Path


Category: Matrix coding problem
You are given a grid where each cell contains either a single digit ('0' to '9') or an arithmetic operator ('+' or '-'). Starting from any cell, you...
Input: Matrix (2D array)
Output: Integer
coding Hard Verified Question #22

22. [CodeSignal] Round-Robin Package Dispatcher


Category: Trie-based coding problem
A logistics platform assigns packages to processing stations in round-robin order. You are given stationCapacity (max packages each station can...
Input: Given input
Output: Integer
coding Hard stack queue #1

1. [Monotonic Stack] — Largest square that fits beneath a histogram


Background
CodeSignal-hosted online assessments often include an optimization-heavy array problem alongside shorter implementation tasks. A September 2025 Capital One Senior SWE candidate report describes a largest-square-in-a-histogram question and notes that a monotonic-stack approach was needed to avoid timeouts; this problem adapts that reported pattern.
Problem statement
You are given an array heights representing a histogram. Bar i occupies the horizontal interval [i, i + 1], has height heights[i], and rests on a shared baseline at height zero.
Find the maximum area of an axis-aligned square that fits entirely beneath the histogram. The square's bottom edge must lie on the baseline, and its left and right edges must have integer horizontal coordinates.
Equivalently, a square with integer side length s fits if there are at least s consecutive bars, each with height at least s. Return its area, s * s. Return 0 if no positive-area square fits.
Your implementation must run in O(n) time, where n is the number of bars.
Function or class signature
  • largest_square_area(heights: list[int]) -> int


Example 1:
  • Input: heights = [2, 4, 4, 4, 1]

  • Output: 9

  • Explanation: Bars at indices 1, 2, and 3 support a square of side 3, giving area 3 * 3 = 9. A square of side 4 would require four consecutive bars of height at least 4, which do not exist.


Example 2:
  • Input: heights = [5, 5]

  • Output: 4

  • Explanation: Both bars are tall enough for a larger square, but their combined width is only 2. The largest square has side 2 and area 4.


Constraints:
  • 1 <= len(heights) <= 200000.

  • 0 <= heights[i] <= 1000000000.

  • Each bar has width exactly 1.

  • Return an integer area; use a 64-bit integer in languages with fixed-width integer types.

  • Do not modify the input array.


Follow-up:
Return (area, left_index, side_length) identifying an optimal square. Among equally large squares, choose the smallest left_index; return (0, -1, 0) when no positive-area square exists. Can you preserve O(n) time?
Want to practise this one?
Create a free account to open the full question and practise CodeSignal OAs questions with AI.
Sign up free
system design Hard heap #2

2. Design BankingSystem — a progressive CodeSignal banking assessment with deferred cashback


Background
A community report of eBay's CodeSignal Industry Coding Assessment describes a banking system that progresses from accounts and transfers to spender rankings and payments with cashback tracking. Implement an in-memory class modeling those reported assessment stages, rather than a production banking service. This adaptation specifies exact timing and failure semantics; account merging is outside its scope.
Requirements
1. Maintain accounts with unique, case-sensitive IDs and integer balances in cents. Creating an existing account returns false. Deposits accept nonnegative amounts and return the updated balance, or null if the account does not exist.
2. Transfers require two distinct existing accounts, a positive amount, and sufficient source funds. A successful transfer debits the source, credits the target, and returns the source's remaining balance. Otherwise return null without changing balances or spending totals.
3. pay immediately debits a positive amount from an existing account with sufficient funds. Successful payments receive globally sequential IDs payment1, payment2, and so on; failed payments return null and do not consume an ID. Each successful payment schedules cashback of floor(amount * 2 / 100) cents exactly 86,400,000 milliseconds later.
4. Before executing every public method, apply all cashback events whose due timestamps are less than or equal to that method's timestamp, even if the requested operation subsequently fails. Cashback credits the original paying account and changes the payment status from IN_PROGRESS to CASHBACK_RECEIVED. Zero-cent cashback still changes the status. All call timestamps are strictly increasing.
5. An account's outgoing total is the sum of its successful outgoing transfers and successful payments. Deposits, incoming transfers, and cashback do not affect this total. top_spenders returns up to n strings formatted as account_id(total), ordered by descending outgoing total and then ascending account ID. Include accounts with zero outgoing total when needed.
6. Payment status is visible only through the account that made the payment. Return null if the account or payment does not exist, or the payment belongs to another account. Apart from processing already-due cashback, failed operations must leave state unchanged.
Class API
  • BankingSystem() — construct an empty system.

  • create_account(timestamp: int, account_id: str) -> bool — create an account with zero balance.

  • deposit(timestamp: int, account_id: str, amount: int) -> Optional[int] — deposit cents and return the new balance.

  • transfer(timestamp: int, source_id: str, target_id: str, amount: int) -> Optional[int] — transfer cents and return the source balance.

  • pay(timestamp: int, account_id: str, amount: int) -> Optional[str] — debit a payment and schedule cashback.

  • get_payment_status(timestamp: int, account_id: str, payment_id: str) -> Optional[str] — return the owned payment's status.

  • top_spenders(timestamp: int, n: int) -> List[str] — return the requested spender ranking.


Example 1:
Input sequence:
[
  ["create_account", 1, "a"],
  ["create_account", 2, "b"],
  ["deposit", 3, "a", 1000],
  ["transfer", 4, "a", "b", 200],
  ["pay", 5, "a", 300],
  ["top_spenders", 6, 2],
  ["deposit", 86400004, "a", 0],
  ["get_payment_status", 86400005, "a", "payment1"],
  ["deposit", 86400006, "a", 0]
]

Output:
[true, true, 1000, 800, "payment1", ["a(500)", "b(0)"], 500, "CASHBACK_RECEIVED", 506]

Explanation: Account a spends 200 + 300 = 500 cents. Its payment cashback is floor(300 * 2 / 100) = 6 cents, due at 5 + 86400000 = 86400005. The balance is 500 immediately before that timestamp and 506 afterward.
Example 2:
Input sequence:
[
  ["create_account", 1, "z"],
  ["deposit", 2, "z", 49],
  ["pay", 3, "z", 49],
  ["create_account", 4, "a"],
  ["top_spenders", 5, 2],
  ["get_payment_status", 6, "a", "payment1"],
  ["pay", 7, "z", 1],
  ["get_payment_status", 86400003, "z", "payment1"],
  ["deposit", 86400004, "z", 0]
]

Output:
[true, 49, "payment1", true, ["z(49)", "a(0)"], null, null, "CASHBACK_RECEIVED", 0]

Explanation: Account a cannot inspect z's payment. Account z has no remaining funds for the second payment. Its original cashback is floor(49 * 2 / 100) = 0, but the status still changes at the due timestamp.
Constraints
  • At most 100,000 public method calls and 10,000 accounts; calls are sequential, with no concurrency or persistence requirement.

  • Timestamps are strictly increasing integers in [1, 10^15], measured in milliseconds. No background thread is required: process due events when a method is called.

  • Account IDs contain 1–32 lowercase ASCII letters, digits, or underscores. Amounts are integer cents: deposits are in [0, 10^9]; transfers and payments are in [1, 10^9]. Ranking requests satisfy 0 <= n <= 10,000.

  • Inputs satisfy the stated type and range constraints. Use integer arithmetic capable of representing accumulated balances and totals.

Start practicing CodeSignal OAs questions

Sign up for free to access walkthroughs, AI-generated questions, and more.

Get Started Free