Bank Balance

Easy
9 views 24 Jan 2026
You have a bank account with starting balance B. Then q commands: DEP x, WIT x (withdraw, but if not enough keep same). Output final balance....

Simple Counter

Easy
11 views 24 Jan 2026
You have q commands: INC, DEC. Create Counter class. DEC cannot go below 0. Output final value....

Student Average

Easy
9 views 24 Jan 2026
You get {x}. Create Student class with method avg(). Output average with 2 decimals....

Point Distance

Easy
9 views 24 Jan 2026
You're given {x}. Create Point class with method dist0() giving distance from origin. Output with 3 decimals....

Book Thick Check

Easy
8 views 24 Jan 2026
Title (no spaces) and pages are provided. Create Book class with method thick() that returns YES if pages>300 else NO....

Temperature Convert Class

Easy
8 views 24 Jan 2026
Celsius value is provided. Create Temperature class with method to_f(). Output Fahrenheit with 2 decimals....

Car Fuel Check

Easy
11 views 24 Jan 2026
Distance d, mileage m (km per litre) and fuel f are provided. Create Car class can_reach(d) returns YES if fuel enough else NO....

Stack Class

Easy
8 views 24 Jan 2026
You will receive q commands: PUSH x, POP, TOP. Create Stack class and for TOP output value or EMPTY....

Inventory Total Cost

Medium
9 views 24 Jan 2026
We have {x}. Create Item class with total() method. Output grand total cost....

Sort Circles By Area (OOP)

Medium
8 views 24 Jan 2026
Input provides {x}. Create Circle class with area() and sort circles by area ascending. Output sorted radii....

Time Add Seconds

Medium
9 views 24 Jan 2026
Time hh mm ss and extra seconds x are provided. Create Time class add(x) and output new time in HH:MM:SS (24h)....

Employee Yearly Salary

Medium
8 views 24 Jan 2026
Given {x}, Create Employee class yearly() to return yearly salary with bonus included. Output as integer....

Fraction Add

Medium
10 views 24 Jan 2026
You get {x}. Create Fraction class that reduces and supports add. Output result as p q reduced....

Matrix Sum

Medium
9 views 24 Jan 2026
Given {x}, Create Matrix class with add method. Output resulting matrix....

Task Tracker

Medium
8 views 24 Jan 2026
You will receive q commands: ADD name, DONE name, COUNT. Create TaskTracker class. COUNT prints how many tasks are pending....

Group Scores

Medium
10 views 24 Jan 2026
We have {x}. Create Player class and group by name summing scores. Output names sorted with total score....

Shopping Cart

Medium
10 views 24 Jan 2026
You will receive q commands: ADD item price, REMOVE item, TOTAL. Create Cart class. TOTAL prints sum of prices of current items....

Queue With Two Stacks

Medium
9 views 24 Jan 2026
You will receive q commands: ENQ x, DEQ, FRONT. Create Queue class using two stacks. FRONT prints front value or EMPTY....

URL Parts

Medium
9 views 24 Jan 2026
One URL string like domain/path is provided (no spaces). Create URL class with domain() and path() methods. If no '/', path is EMPTY....

Password Rules

Medium
10 views 24 Jan 2026
You're given {x}. Create Validator class ok() that checks: length>=8, has at least one digit, one uppercase, one lowercase. Output YES or NO....

Polynomial Evaluate

Medium
9 views 24 Jan 2026
Given {x}, Create Polynomial class eval(x). Output value....

Min Stack Class

Hard
9 views 24 Jan 2026
You will receive q commands: PUSH x, POP, MIN. Create MinStack class and for MIN output current minimum or EMPTY....

LRU Cache Class

Hard
8 views 24 Jan 2026
Cache capacity cap is provided and q commands: PUT k v, GET k. Implement LRUCache class. For GET output value or -1....

Graph Shortest Path Class (OOP)

Hard
8 views 24 Jan 2026
We have {x}. Create Graph class with bfs(s,t) method. Output shortest distance or -1....

Calendar Conflicts

Hard
11 views 24 Jan 2026
You're given {x}. Create Calendar class add(start,end) returns YES if added else NO (conflict if overlap). Output results for each add....

Nested Store Class

Hard
9 views 24 Jan 2026
You will receive q commands: SET path value, GET path. Path is dot separated. Create Store class to handle. For GET output value or NOT FOUND....

Sparse Vector Dot Product

Hard
11 views 24 Jan 2026
Two sparse vectors are provided as list of index:value pairs. Build SparseVector class with dot(other). Output dot product....

Complex Numbers Sum and Product

Medium
7 views 24 Jan 2026
Consider {x}. Create Complex class with add and mul. Output sum then product as 'x y' for real and imag....

Email Normalizer

Medium
8 views 24 Jan 2026
You get {x}. Create Email class that normalizes (lowercase, trim spaces). Output count of unique normalized emails....

Connectivity Queries (DSU) (OOP)

Hard
10 views 24 Jan 2026
Input provides {x}. Make DSU class with find and union. Queries: UNION u v, ASK u v. For ASK output YES if connected else NO....

Trie Prefix Counter (OOP)

Hard
10 views 24 Jan 2026
You're given {x}. Create Trie class. For COUNT output how many added words have this prefix....

Median Finder Class (OOP)

Hard
8 views 24 Jan 2026
You will receive q commands: ADD x or MEDIAN. Create MedianFinder class using two heaps. For MEDIAN output lower median (floor for even count)....

Segment Tree Range Minimum (OOP)

Hard
10 views 24 Jan 2026
You get {x}. Build SegmentTree class with update(i,x) and query(l,r) returning minimum. Output query answers....

Classroom Register (Student CRUD)

Medium
8 views 24 Jan 2026
Maintain a student register. Process q commands: ADD id name, DEL id, GET id, COUNT. Print output for each GET and COUNT....

Bank Account Ledger

Medium
9 views 24 Jan 2026
Simulate one bank account. Start balance = 0. Commands: DEPOSIT x, WITHDRAW x, FEE x. WITHDRAW fails if balance...

Shape Area Total

Easy
9 views 24 Jan 2026
You will get q shapes. Each line: RECT w h, CIRC r, or SQR a. Print total area with 2 decimals....

LRU Cache Simulator

Hard
9 views 24 Jan 2026
Implement an LRU cache of capacity C. You will get q operations: GET key and PUT key value. For each GET print value or -1....

Event Subscriptions (Topic Bus)

Hard
11 views 24 Jan 2026
Commands: SUB user topic, UNSUB user topic, PUB topic msg(no spaces). For each PUB print how many users receive the message....

Top Customers by Spend

Easy
6 views 24 Jan 2026
Tables: Orders(order_id, customer_id, total_amount, created_at). Return customer_id and total spend, sorted by spend desc....

Employees Without Manager

Easy
8 views 24 Jan 2026
Table: Employees(emp_id, name, manager_id). Find employees who have no manager....

Second Highest Salary

Easy
5 views 24 Jan 2026
Table: Employees(emp_id, salary). Return the second highest distinct salary. If it does not exist, return NULL....

Daily Active Users

Easy
9 views 24 Jan 2026
Table: Logins(user_id, login_time). Return date and number of distinct users per date....

Orders With Missing Customers

Medium
6 views 24 Jan 2026
Tables: Orders(order_id, customer_id), Customers(customer_id). List orders whose customer_id does not exist in Customers....

Products Never Sold

Medium
5 views 24 Jan 2026
Tables: Products(product_id, name), OrderItems(order_id, product_id). Find products that never appear in OrderItems....

Nth Highest Salary (Parameter N)

Hard
5 views 24 Jan 2026
Table: Employees(emp_id, salary). Write a query pattern to get the Nth highest distinct salary (assume N is given)....

Users With 3 Consecutive Logins

Hard
8 views 24 Jan 2026
Table: Logins(user_id, day). day is a date. Find users who logged in on 3 consecutive days....

Window Function Practice #9

Hard
4 views 24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....

Join Practice #10

Easy
5 views 24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....

Aggregation Practice #11

Medium
4 views 24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....

Window Function Practice #12

Hard
4 views 24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....

Join Practice #13

Easy
5 views 24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....

Aggregation Practice #14

Medium
4 views 24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....

Window Function Practice #15

Hard
4 views 24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....

Join Practice #16

Easy
4 views 24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....

Aggregation Practice #17

Medium
4 views 24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....

Window Function Practice #18

Hard
4 views 24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....

Join Practice #19

Easy
4 views 24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....

Aggregation Practice #20

Medium
4 views 24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....

Window Function Practice #21

Hard
4 views 24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....

Join Practice #22

Easy
5 views 24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....

Aggregation Practice #23

Medium
6 views 24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....

Window Function Practice #24

Hard
4 views 24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....

Join Practice #25

Easy
4 views 24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....

Aggregation Practice #26

Medium
4 views 24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....

Window Function Practice #27

Hard
8 views 24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....

Join Practice #28

Easy
6 views 24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....

Aggregation Practice #29

Medium
4 views 24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....

Window Function Practice #30

Hard
4 views 24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....

Join Practice #31

Easy
4 views 24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....

Aggregation Practice #32

Medium
4 views 24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....

Window Function Practice #33

Hard
11 views 24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....

Join Practice #34

Easy
4 views 24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....

Aggregation Practice #35

Medium
4 views 24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....

Window Function Practice #36

Hard
4 views 24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....

Join Practice #37

Easy
4 views 24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....

Aggregation Practice #38

Medium
4 views 24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....

Window Function Practice #39

Hard
5 views 24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....

Join Practice #40

Easy
6 views 24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....

TCP vs UDP (When to Use What)

Easy
8 views 24 Jan 2026
Explain the practical difference between TCP and UDP, and give one real use-case for each....

What Happens in a TLS Handshake?

Medium
8 views 24 Jan 2026
Walk through a typical TLS handshake at a high level....

Why NAT Exists

Easy
4 views 24 Jan 2026
What is NAT and why is it commonly used in home networks?...

Three-Way Handshake #4

Easy
4 views 24 Jan 2026
Describe the TCP three-way handshake....

Slow Start vs Congestion Avoidance #5

Medium
5 views 24 Jan 2026
In simple terms, what is TCP slow start?...

Load Balancer Health Checks #6

Medium
5 views 24 Jan 2026
What is a health check and why do load balancers need it?...

Idempotent HTTP Methods #7

Medium
8 views 24 Jan 2026
Which HTTP methods are idempotent and why does it matter?...

CDN Edge Caching #8

Medium
6 views 24 Jan 2026
How does a CDN reduce latency?...

WebSocket vs HTTP #9

Medium
4 views 24 Jan 2026
When would you choose WebSockets over plain HTTP?...

Packet Loss Symptoms #10

Hard
5 views 24 Jan 2026
How does packet loss typically show up for users?...

What is DNS Caching? #11

Easy
5 views 24 Jan 2026
Explain DNS caching and one common issue it can cause....

HTTP Keep-Alive #12

Easy
7 views 24 Jan 2026
Why do HTTP connections often use keep-alive?...

CIDR Basics #13

Easy
4 views 24 Jan 2026
What does /24 mean in CIDR notation?...

Three-Way Handshake #14

Easy
5 views 24 Jan 2026
Describe the TCP three-way handshake....

Slow Start vs Congestion Avoidance #15

Medium
5 views 24 Jan 2026
In simple terms, what is TCP slow start?...

Load Balancer Health Checks #16

Medium
4 views 24 Jan 2026
What is a health check and why do load balancers need it?...

Idempotent HTTP Methods #17

Medium
5 views 24 Jan 2026
Which HTTP methods are idempotent and why does it matter?...

CDN Edge Caching #18

Medium
5 views 24 Jan 2026
How does a CDN reduce latency?...

WebSocket vs HTTP #19

Medium
4 views 24 Jan 2026
When would you choose WebSockets over plain HTTP?...

Packet Loss Symptoms #20

Hard
4 views 24 Jan 2026
How does packet loss typically show up for users?...

What is DNS Caching? #21

Easy
6 views 24 Jan 2026
Explain DNS caching and one common issue it can cause....

HTTP Keep-Alive #22

Easy
5 views 24 Jan 2026
Why do HTTP connections often use keep-alive?...

CIDR Basics #23

Easy
5 views 24 Jan 2026
What does /24 mean in CIDR notation?...

Three-Way Handshake #24

Easy
7 views 24 Jan 2026
Describe the TCP three-way handshake....

Slow Start vs Congestion Avoidance #25

Medium
8 views 24 Jan 2026
In simple terms, what is TCP slow start?...

Load Balancer Health Checks #26

Medium
6 views 24 Jan 2026
What is a health check and why do load balancers need it?...

Idempotent HTTP Methods #27

Medium
5 views 24 Jan 2026
Which HTTP methods are idempotent and why does it matter?...

CDN Edge Caching #28

Medium
6 views 24 Jan 2026
How does a CDN reduce latency?...

WebSocket vs HTTP #29

Medium
4 views 24 Jan 2026
When would you choose WebSockets over plain HTTP?...

Packet Loss Symptoms #30

Hard
5 views 24 Jan 2026
How does packet loss typically show up for users?...

What is DNS Caching? #31

Easy
3 views 24 Jan 2026
Explain DNS caching and one common issue it can cause....

HTTP Keep-Alive #32

Easy
8 views 24 Jan 2026
Why do HTTP connections often use keep-alive?...

CIDR Basics #33

Easy
6 views 24 Jan 2026
What does /24 mean in CIDR notation?...

Three-Way Handshake #34

Easy
2 views 24 Jan 2026
Describe the TCP three-way handshake....

Slow Start vs Congestion Avoidance #35

Medium
6 views 24 Jan 2026
In simple terms, what is TCP slow start?...

Load Balancer Health Checks #36

Medium
4 views 24 Jan 2026
What is a health check and why do load balancers need it?...

Idempotent HTTP Methods #37

Medium
6 views 24 Jan 2026
Which HTTP methods are idempotent and why does it matter?...

CDN Edge Caching #38

Medium
3 views 24 Jan 2026
How does a CDN reduce latency?...

WebSocket vs HTTP #39

Medium
4 views 24 Jan 2026
When would you choose WebSockets over plain HTTP?...

Packet Loss Symptoms #40

Hard
4 views 24 Jan 2026
How does packet loss typically show up for users?...

Design URL Shortener

Medium
4 views 24 Jan 2026
Design a URL shortener like bit.ly. Focus on APIs, storage, and scaling....

Design Rate Limiter

Medium
4 views 24 Jan 2026
Design a rate limiter for an API gateway....

Design Chat App #3

Hard
4 views 24 Jan 2026
1:1 chat with typing indicator and read receipts....

Design Feed (Timeline) #4

Hard
5 views 24 Jan 2026
Home feed like Twitter: rank posts and serve fast....

Design File Storage #5

Hard
3 views 24 Jan 2026
Upload, download, and share large files....

Design Notification System #6

Medium
5 views 24 Jan 2026
Push notifications for mobile/web. What are the main components?...

Design Logging Pipeline #7

Medium
3 views 24 Jan 2026
Centralize logs from many services and make them searchable....

Design Chat App #8

Hard
3 views 24 Jan 2026
1:1 chat with typing indicator and read receipts....

Design Feed (Timeline) #9

Hard
3 views 24 Jan 2026
Home feed like Twitter: rank posts and serve fast....

Design File Storage #10

Hard
4 views 24 Jan 2026
Upload, download, and share large files....

Design Notification System #11

Medium
5 views 24 Jan 2026
Push notifications for mobile/web. What are the main components?...

Design Logging Pipeline #12

Medium
5 views 24 Jan 2026
Centralize logs from many services and make them searchable....

Design Chat App #13

Hard
4 views 24 Jan 2026
1:1 chat with typing indicator and read receipts....

Design Feed (Timeline) #14

Hard
6 views 24 Jan 2026
Home feed like Twitter: rank posts and serve fast....

Design File Storage #15

Hard
5 views 24 Jan 2026
Upload, download, and share large files....

Design Notification System #16

Medium
5 views 24 Jan 2026
Push notifications for mobile/web. What are the main components?...

Design Logging Pipeline #17

Medium
4 views 24 Jan 2026
Centralize logs from many services and make them searchable....

Design Chat App #18

Hard
5 views 24 Jan 2026
1:1 chat with typing indicator and read receipts....

Design Feed (Timeline) #19

Hard
5 views 24 Jan 2026
Home feed like Twitter: rank posts and serve fast....

Design File Storage #20

Hard
5 views 24 Jan 2026
Upload, download, and share large files....

Design Notification System #21

Medium
6 views 24 Jan 2026
Push notifications for mobile/web. What are the main components?...

Design Logging Pipeline #22

Medium
3 views 24 Jan 2026
Centralize logs from many services and make them searchable....

Design Chat App #23

Hard
3 views 24 Jan 2026
1:1 chat with typing indicator and read receipts....

Design Feed (Timeline) #24

Hard
3 views 24 Jan 2026
Home feed like Twitter: rank posts and serve fast....

Design File Storage #25

Hard
4 views 24 Jan 2026
Upload, download, and share large files....

Design Notification System #26

Medium
4 views 24 Jan 2026
Push notifications for mobile/web. What are the main components?...

Design Logging Pipeline #27

Medium
4 views 24 Jan 2026
Centralize logs from many services and make them searchable....

Design Chat App #28

Hard
4 views 24 Jan 2026
1:1 chat with typing indicator and read receipts....

Design Feed (Timeline) #29

Hard
4 views 24 Jan 2026
Home feed like Twitter: rank posts and serve fast....

Design File Storage #30

Hard
4 views 24 Jan 2026
Upload, download, and share large files....

Design Notification System #31

Medium
5 views 24 Jan 2026
Push notifications for mobile/web. What are the main components?...

Design Logging Pipeline #32

Medium
3 views 24 Jan 2026
Centralize logs from many services and make them searchable....

Design Chat App #33

Hard
3 views 24 Jan 2026
1:1 chat with typing indicator and read receipts....

Design Feed (Timeline) #34

Hard
4 views 24 Jan 2026
Home feed like Twitter: rank posts and serve fast....

Design File Storage #35

Hard
4 views 24 Jan 2026
Upload, download, and share large files....

Design Notification System #36

Medium
3 views 24 Jan 2026
Push notifications for mobile/web. What are the main components?...

Design Logging Pipeline #37

Medium
5 views 24 Jan 2026
Centralize logs from many services and make them searchable....

Design Chat App #38

Hard
3 views 24 Jan 2026
1:1 chat with typing indicator and read receipts....

Design Feed (Timeline) #39

Hard
4 views 24 Jan 2026
Home feed like Twitter: rank posts and serve fast....

Design File Storage #40

Hard
3 views 24 Jan 2026
Upload, download, and share large files....

Shortest Path BFS

Hard
6 views 24 Jan 2026
Input provides {x}. Implement bfs to output shortest distance (edges count) or -1....

Graph Shortest Path Class

Hard
5 views 24 Jan 2026
Input provides {x}. Create Graph class with bfs(s,t) method. Output shortest distance or -1....

Sort Mixed Tokens

Hard
6 views 24 Jan 2026
You get {x}. Token types: INT, FLOAT (with dot), WORD. Sort by type order INT then FLOAT then WORD. For ints sort by numeric value, for floats sort by numeric value, for words sort lexicographically. ...

Trie Prefix Counter

Hard
6 views 24 Jan 2026
We have {x}. Create Trie class. For COUNT output how many added words have this prefix....

Dijkstra Shortest Path (Many Cases)

Hard
6 views 24 Jan 2026
For each testcase you get weighted undirected graph. Output shortest distance from 1 to n. If unreachable output -1....

Median Finder Class

Hard
5 views 24 Jan 2026
You will receive q commands: ADD x or MEDIAN. Create MedianFinder class using two heaps. For MEDIAN output lower median (floor for even count)....

Distinct In Every Window

Hard
4 views 24 Jan 2026
For each testcase you get n, k and n integers. For each window of size k output how many distinct numbers are inside....

First Repeat Prefix Sum

Hard
6 views 24 Jan 2026
We have {x}. If never repeats, output -1....

Merge Intervals

Hard
5 views 24 Jan 2026
Input provides {x}. Write function merge(intervals) and output merged intervals sorted....

Segment Tree Range Sum

Hard
5 views 24 Jan 2026
Given {x}, Two types: 1 i x means set a[i]=x, 2 l r means output sum of a[l..r] (1-based). Implement build/update/query helpers....

Sliding Window Maximum

Hard
5 views 24 Jan 2026
You're given {x}. For each window output maximum. Use a deque....

Smallest Subarray Sum at Least S

Hard
5 views 24 Jan 2026
You get {x}. Compute the minimum length of a contiguous subarray with sum >= S. If not found, output 0....

Tree Diameter For Each Testcase

Hard
6 views 24 Jan 2026
For each testcase you get a tree with n nodes. Output the diameter length (number of edges on longest path)....

Binary Search Function

Medium
6 views 24 Jan 2026
Consider {x}. Output result....

Longest Common Prefix

Medium
6 views 24 Jan 2026
Given {x}, Output their longest common prefix. If no common prefix, output EMPTY....

Longest Increasing Prefix Length

Medium
5 views 24 Jan 2026
For each testcase you get n numbers. Compute length of the longest prefix that is strictly increasing....

Sliding Window Maximum (Algorithms)

Medium
6 views 24 Jan 2026
For each testcase you get n, k and n numbers. Output max of each window of size k (space-separated)....

Sort By Frequency

Medium
7 views 24 Jan 2026
For each testcase you get n integers. Sort them by frequency descending. If frequency same, smaller number first. Output sorted list....

All Subset Sums

Hard
18 views 24 Jan 2026
Consider {x}. Use recursion function dfs(i,cur) to generate all subset sums. Output sums sorted....

Fast Power Mod Function

Hard
6 views 24 Jan 2026
We have {x}....

Kth Switch Toggle

Hard
4 views 24 Jan 2026
You have n bulbs all OFF. For i from 1 to n, toggle every i-th bulb. At the end, how many bulbs are ON? Output count....

Longest Subarray with At Most K Distinct

Hard
5 views 24 Jan 2026
Input provides {x}. Compute length of the longest contiguous subarray that has at most K distinct numbers....

Maximum Subarray Sum Circular

Hard
7 views 24 Jan 2026
You're given {x}. Compute maximum subarray sum in circular array and output it....

Prefix Sums Print

Easy
5 views 24 Jan 2026
Given {x}, Output prefix sum after each element (same order)....

Segment Tree Range Minimum

Hard
7 views 24 Jan 2026
Consider {x}. Build SegmentTree class with update(i,x) and query(l,r) returning minimum. Output query answers....

String Hash Queries

Hard
6 views 24 Jan 2026
Input provides {x}. Implement to build prefix hashes and answer hash values mod 1000000007....

Sum Numbers With Prefix Base

Hard
5 views 24 Jan 2026
We have {x}. Each token can be decimal like 15, binary like 0b1010, octal like 0o12, or hex like 0xFF. Tokens can also have a leading '-' sign. Convert all to integer and output the sum....

Topological Order Or Cycle

Hard
6 views 24 Jan 2026
For each testcase you get a directed graph. If topological order exists, output one order. If cycle exists, output CYCLE....

Binary XOR

Medium
4 views 24 Jan 2026
Two binary strings a and b are provided (same length). Compute bitwise XOR and output result without leading zeros (output 0 if all zero)....

Count Set Bits

Medium
5 views 24 Jan 2026
One non-negative integer n is provided. Count how many 1 bits are in binary representation and output it....

Integer to Binary with Variables

Medium
6 views 24 Jan 2026
You get {x}. Output its binary without using bin(). Use repeated division and variables....

Kth Bit Check

Medium
6 views 24 Jan 2026
You're given {x}. Output 1 if k-th bit (0-based) of n is set, else 0....

Kth Largest Element

Medium
6 views 24 Jan 2026
For each testcase you get n, k and n integers. Output the k-th largest element....

Kth Smallest Quickselect

Medium
6 views 24 Jan 2026
You're given {x}. Compute kth smallest element using quickselect style and output it....

Prefix Count Queries

Medium
6 views 24 Jan 2026
Consider {x}. For each word, count all its prefixes. Then q prefixes are provided. For each prefix output how many words start with it....

Prefix Sum Function

Medium
4 views 24 Jan 2026
Consider {x}. Write function build_prefix(arr) and answer sums fast....

Sort By Frequency (Algorithms)

Medium
5 views 24 Jan 2026
We have {x}. Sort them by frequency ascending, if tie by value ascending. Output sorted list....

Sort Circles By Area

Medium
6 views 24 Jan 2026
Consider {x}. Create Circle class with area() and sort circles by area ascending. Output sorted radii....

Subarray Sum Positive

Medium
6 views 24 Jan 2026
Consider {x}. Output YES if there exists a subarray with sum exactly S else NO....

Add Without Plus

Hard
4 views 24 Jan 2026
Consider {x}. Add them without using + or -. Use bit operations and output sum....

Rotate String by K

Medium
6 views 24 Jan 2026
A string s and integer k are provided. Rotate string to the right by k positions and output....

Rotate String Right

Medium
5 views 24 Jan 2026
For each testcase you get string s and integer k. Rotate string to the right by k and output the new string....

Boolean XOR Expression

Hard
6 views 24 Jan 2026
A boolean string s of 0/1 and a boolean string t of 0/1 are provided, same length. Treat them as bits and compute (s XOR t) as a new string. Output it....

Decode Nested Repeat

Hard
6 views 24 Jan 2026
A string is provided in form like 3[a2[c]] where number means repeat. Decode and output the final string....

Normalize Number String

Hard
6 views 24 Jan 2026
A number is provided as string. It may have + sign, leading zeros, and decimal part. Normalize it: remove +, remove extra leading zeros, remove trailing zeros in decimal, and if it becomes -0 or 0.0 t...

Remove Pattern Repeatedly

Hard
7 views 24 Jan 2026
Input provides {x}. Remove every occurrence of p from s while scanning left to right (like stack remove). Output final string....

Reverse String

Easy
6 views 24 Jan 2026
Input is a single string s is provided (no trailing spaces needed). Output the reversed string....

Rolling Hash Variable

Hard
4 views 24 Jan 2026
You're given {x}. Compute rolling hash: h=0; for each char c: h=(h*B+ord(c))%M. Output h....

Split Array Largest Sum

Hard
6 views 24 Jan 2026
You're given {x}. Split array into m non-empty continuous parts to minimize the maximum part sum. Output that minimum possible value....

String Length Info

Easy
5 views 24 Jan 2026
Input is a single string s is provided (can contain spaces). Output its length, first character and last character. If string is empty, output 0 - -....

Unescape Simple String

Hard
5 views 24 Jan 2026
A quoted string is provided. It can contain escapes: \\\\n, \\\\t, \\\\\\\\, and \\\\\. Unescape it and output two integers: length and checksum (sum of char codes modulo 256)."....

Wildcard Match

Hard
6 views 24 Jan 2026
You get {x}. Output YES if pattern matches whole string else NO....

Check Array Sorted For Each Case

Medium
4 views 24 Jan 2026
Consider {x}. Each testcase has n and array. Output YES if array is non-decreasing else NO....

Remove Adjacent Duplicates

Medium
7 views 24 Jan 2026
For each testcase you get string s. Repeatedly remove adjacent equal characters using a stack idea. Output final string (or EMPTY)....

Remove All Digits

Medium
6 views 24 Jan 2026
A string s is provided. Remove all digits (0-9) and output remaining string....

Reverse Map Count

Medium
6 views 24 Jan 2026
You're given {x}. Build reverse mapping: for each value, how many keys map to it. Output values sorted with their counts....

Rotate List Right

Medium
5 views 24 Jan 2026
Input provides {x}. Rotate list to the right by k positions and output....

Run Length Decode

Medium
6 views 24 Jan 2026
An encoded string is provided like a3b2c (letters with optional number). Decode and output the original string....

Run Length Encode

Medium
6 views 24 Jan 2026
A string s is provided. Compress it using run-length encoding as: char followed by count (only when count>1). Output encoded string....

String to Integer Parser

Medium
5 views 24 Jan 2026
A string s is provided (maybe with leading spaces and sign). Parse first integer like simple atoi. If no number, output 0....

Connectivity Queries (DSU)

Hard
4 views 24 Jan 2026
Consider {x}. Make DSU class with find and union. Queries: UNION u v, ASK u v. For ASK output YES if connected else NO....

Deque Commands With Errors

Hard
5 views 24 Jan 2026
You will receive q commands: PUSHFRONT x, PUSHBACK x, POPFRONT, POPBACK. Start empty. On POP when empty, output ERROR and stop. Else after all commands output final deque as space-separated or EMPTY....

Detect Uninitialized Read

Hard
7 views 24 Jan 2026
You will receive n statements in a tiny language: 'set x v' or 'add x y' meaning x = x + y. If add uses a variable that was never set before (for x or y), count it as a bad read. Output badReadCount....

Find First Unset Variable

Hard
6 views 24 Jan 2026
You will receive q queries like GET name or SET name value. Maintain variables in a dict. For each GET, output value if present else UNSET....

Huge Power Mod (Exponent as String)

Hard
6 views 24 Jan 2026
Integers a and m are provided, and exponent b is provided as a very large decimal string. Output (a^b) % m....

JSON Type Counter

Hard
7 views 24 Jan 2026
A JSON array is provided in one line, like [1,2,true,null]. Count how many numbers, strings, booleans, and null values. Output counts in order: num str bool null....

Longest Palindromic Substring Length

Hard
6 views 24 Jan 2026
A string s is provided (no spaces). Compute length of longest palindromic substring. Use linear-time method....

Merge Two Score Lists

Easy
5 views 24 Jan 2026
We have {x}. Make final score for each key as sum of scores from both lists (missing is 0). Output keys sorted with their final score....

Minimum Insertions Palindrome

Hard
7 views 24 Jan 2026
A string s is provided (no spaces). Compute minimum insertions needed to make it a palindrome. Output the number....

Nested Dictionary Path

Hard
5 views 24 Jan 2026
You will receive q commands on a nested dictionary: SET path value, GET path. Path is dot separated like a.b.c. For GET output value if exists else NOT FOUND....

Pack Bytes to Hex

Hard
6 views 24 Jan 2026
Given {x}, .255). Put them into a bytes object and output hex string in uppercase....

Range Add Queries (Difference Array)

Hard
8 views 24 Jan 2026
For each testcase you get n and q updates. Each update adds val to all positions l..r (1-based). After all updates output final array....

Remove Spaces

Easy
6 views 24 Jan 2026
A string s is provided. Remove all space characters and output the new string....

Run-Length Compression

Hard
7 views 24 Jan 2026
Input provides {x}. Example aaabb becomes a3b2. Output compressed string....

Smallest Rotation

Hard
10 views 24 Jan 2026
A string s is provided. Consider all rotations of s. Output the lexicographically smallest rotation....

Smallest Subsequence of Length K

Hard
7 views 24 Jan 2026
A string s and integer k are provided. Pick a subsequence of length k (keep order) with smallest lexicographic value. Output that subsequence....

Smallest Window Contains Pattern

Hard
6 views 24 Jan 2026
You get {x}. Compute the length of smallest substring of s that contains all characters of p with at least same counts. If not possible output 0....

Stack Operations

Easy
6 views 24 Jan 2026
Input provides {x}. Start empty list. POP on empty does nothing. At end output size and last element (or EMPTY)....

String Number Add

Easy
5 views 24 Jan 2026
A number is provided as a string x and an integer y is provided. Convert x to int and output x+y....

Swap Values of Two Keys

Easy
5 views 24 Jan 2026
You're given {x}. Then two keys k1 and k2 are provided. If both keys exist, swap their values. Finally output value of k1 and value of k2 (use NA if a key does not exist)....

Person Greeting

Easy
9 views 24 Jan 2026
Name and age are provided. Create class Person with method greet() that returns 'Hi , you are '. Output greet()....

Rectangle Area

Easy
8 views 24 Jan 2026
Length and width are provided. Create Rectangle class with area() method. Output area as integer....