Category: Binary tree coding problemA 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
codingHardVerified Question#2
2. Dual Extremes Queue
Category: Queue-based coding problemDesign a StreamBuffer class that buffers a stream of integer latency samples in FIFO order and supports O(1) access to both the minimum and maximum...Input: Integer(s) Output: Integer
codingHardVerified Question#3
3. Spread Avoidance Escape
Category: Grid/matrix coding problemYou are navigating a facility grid to escape from spreading contamination. The grid contains: - 'S' - your starting position - 'C' - the...Input: 2D grid Output: Integer
codingHardVerified Question#4
4. Tiered Order Pricing
Category: String coding problemA warehouse fulfillment system batches orders to minimize shipping costs. Orders for the same SKU that are placed within 5 minutes (300,000 ms) of...Input: String Output: Integer
codingHardgraph#1
1. Graph — Finding Influencer Networks
Background: With the growth of user-generated content, TikTok needs to identify and analyze influencer groups to improve marketing strategies. Understanding how users are connected through likes and follows can help in targeted advertising and trend forecasting. Problem statement: Given a directed graph represented by an adjacency list, where each node represents a user and a directed edge from user A to user B means that user A follows user B, write a function to find all strongly connected components (SCCs) in the graph. An SCC is a subgraph where every vertex can be reached from every other vertex. Implement the function find_scc(graph: List[List[int]]) -> List[List[int]] that returns a list of lists, where each inner list is a component. Function/class signature: