Bank Balance

Easy
8 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
9 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
8 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
10 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
7 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
7 views 24 Jan 2026
We have {x}. Create Item class with total() method. Output grand total cost....

Sort Circles By Area (OOP)

Medium
7 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
7 views 24 Jan 2026
Given {x}, Create Employee class yearly() to return yearly salary with bonus included. Output as integer....

Fraction Add

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

Matrix Sum

Medium
8 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
8 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
9 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
8 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
8 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
8 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
7 views 24 Jan 2026
Given {x}, Create Polynomial class eval(x). Output value....

Min Stack Class

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

Calendar Conflicts

Hard
9 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
7 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
9 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
9 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
8 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
7 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
8 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
8 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
8 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
9 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....

Person Greeting

Easy
8 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....