Category: String coding problem# Question You are designing an NFT generation engine. You are given a set of Traits, where each trait has a name and a list of possible...Input: List Output: Array
codingMediumVerified Question#2
2. Blockchain Mining
Category: Dynamic programming coding problem# Question You are building a block construction module for a blockchain node. The goal is to select a subset of pending transactions to include in...Input: Graph (nodes and edges) Output: Computed result
codingMediumVerified Question#3
3. Crypto Trading System Stream
Category: String coding problem# Question Design a crypto trading system that manages a stream of orders. The system should support various operations like placing, pausing,...Input: Array of strings Output: Computed result
codingHardVerified Question#4
4. Design Iterators
Category: Array coding problem# Question For this problem, you will be designing a series of different iterator classes. This problem is split into multiple related parts that...Input: Array of integers Output: Computed result
codingMediumVerified Question#5
5. Food Delivery System
Category: Trie-based coding problem# Question For this problem, you will be designing a food delivery system. This problem is split into three related parts, evolving from basic data...Input: List Output: Computed result
codingHardVerified Question#6
6. Transaction System
Category: Tree coding problemFor this problem, you will be designing a system to handle financial transactions and account balances. This problem is split into three related...Input: List Output: Integer
codingHardVerified Question#7
7. 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
codingHardVerified Question#8
8. 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
codingHardVerified Question#9
9. Capital Gains Tax Calculator
Category: String coding problemYou are given a chronologically sorted list of stock transactions. Each transaction is a list of strings in the format `[<timestamp>, <type>,...Input: Array of strings Output: Computed result
codingMediumVerified Question#10
10. Service Log Aggregator
Category: Trie-based coding problemA distributed system emits log entries from multiple services and worker threads. Each log entry is a colon-separated string in the format...Input: Array Output: Computed result
codingHardVerified Question#11
11. OA [CodeSignal] Knowledge Base System
Category: Graph coding problemDesign 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
codingMediumVerified Question#12
12. OA [CodeSignal] Workspace Tracker
Category: Interval-based coding problemBuild a system to track desk workers at a shared office space. The system records when each worker enters and leaves and computes how long they have...Input: String Output: Array
codingHardVerified Question#13
13. Transaction Query Engine
Category: String coding problemDesign a system to filter and paginate a list of transaction records. Each record is a list of strings in the format `[timestamp, id, userId,...Input: Array of strings Output: Computed result
codingMediumVerified Question#14
14. Exchange Rate Finder
Category: String coding problemYou are given a set of currency exchange relationships. Each relationship specifies a direct exchange rate between two currencies. Rates are...Input: List Output: Computed result
codingHardVerified Question#15
15. Order Matching Engine
Category: String coding problemYou are managing a cryptocurrency order book. The book holds buy and sell orders placed by traders. - A buy order indicates the maximum price a...Input: String Output: Computed result
codingHardVerified Question#16
16. Account Transfer System
Category: String coding problemYou are given a list of fund transfer instructions and a set of accounts with initial balances. Each transfer moves a fixed percentage of the...Input: List Output: Computed result
codingHardVerified Question#17
17. Restaurant Delivery Network
Category: String coding problemYou are building a food discovery platform. Given a user's location, a list of restaurants with their coordinates, and a menu of items with prices,...Input: List Output: Computed result
system designSeniormessaging#1
1. [OA] Message Queue — Design a simple message queue system for the exchange
Coinbase needs a reliable way to queue messages between its services for processing operations asynchronously. Design a MessageQueue class that allows adding messages, retrieving the next message, and checking the size of the queue. Class signature: - class MessageQueue: - def enqueue(message: str) -> None – Adds a message to the queue. - def dequeue() -> str – Retrieves and removes the next message from the queue. - def size() -> int – Returns the current size of the queue. Example 1: Input: enqueue('msg1') Output: None Explanation: Message is queued.Example 2: Input: size() Output: 1 Explanation: Queue size is currently 1 message. Constraints: - 1 <= len(message) <= 100
system designSeniorapi design#2
2. [OA] Job Scheduler — Design a job scheduling system
Coinbase requires a robust job scheduler to execute tasks at specific intervals. The system must handle thousands of jobs simultaneously. Design a JobScheduler class that schedules jobs to run after a defined interval. It should allow for adding, removing, and checking job status. Class signature: - class JobScheduler: - def add_job(job_id: str, interval: int) -> None – Adds a job with a specified interval (in seconds). - def remove_job(job_id: str) -> None – Removes a job from the scheduler. - def get_status(job_id: str) -> str – Returns the current status of a job (e.g. 'running', 'pending', 'completed'). Example 1: Input: add_job('job1', 5) Output: None Explanation: Job is scheduled.Example 2: Input: get_status('job1') Output: 'pending' Explanation: Job is pending execution. Constraints: - 1 <= interval <= 3600 - 1 <= len(job_id) <= 20
codingHardcaching#3
3. [OA] Caching — Implement an in-memory Rate Limiter system
Coinbase requires a rate limiter to prevent excessive requests to its APIs, ensuring fair usage across users. Design a RateLimiter class that limits the number of calls to a specified maxRequests over a time period of timeWindow. If the limit is exceeded, new requests should receive an error response. Method signature: - def is_request_allowed(user_id: str, timestamp: int) -> bool: Returns True if the request is allowed, False if it exceeds the limit. Example 1: Input: user_id = 'user1', timestamp = 1 Output: True Explanation: 1 request is within limit.Example 2: Input: user_id = 'user1', timestamp = 6 Output: False Explanation: On timestamp 6, user has exceeded the max requests within the specified time window. Constraints: - 1 <= maxRequests <= 100 - 1 <= timeWindow <= 1000
codingHardgraph#4
4. [OA] Graph Traversal — Implement a transaction graph for fraud detection
Coinbase needs a system to detect fraudulent transactions by visualizing relationships in a transaction graph. Implement a method that returns all fraudulent transaction paths in a directed graph where nodes represent accounts and edges represent transactions. You must return all paths having a maximum depth of k. Method signature: - def find_fraudulent_paths(graph: Dict[str, List[str]], max_depth: int) -> List[List[str]]: Returns a list of lists containing all possible paths that are at most of length max_depth. Example 1: Input: graph = {'A': ['B', 'C'], 'B': ['D'], 'C': ['D'], 'D': []}, max_depth = 2 Output: [['A', 'B'], ['A', 'C'], ['A', 'B', 'D'], ['A', 'C', 'D']] Explanation: Transactions are depicted as paths based on the graph's depth constraints.Example 2: Input: graph = {'A': ['B'], 'B': ['C'], 'C': []}, max_depth = 1 Output: [['A', 'B'], ['A']] Explanation: Only paths staying within the given maximum depth are represented. Constraints: - 1 <= len(graph) <= 100 - 1 <= max_depth <= 10