cswork / core skillsPractice Core Skills

CORE SKILLS · 36 PROBLEMS · 4 LANGUAGES

Write the everyday data structures and algorithms yourself.

No libraries: implement a dynamic array, linked list, hash map, heap, LRU cache, quicksort, merge sort, KMP, BFS, Dijkstra, minimum spanning trees, union-find, a trie, a segment tree and a Fenwick tree yourself, then use locks, condition variables and semaphores for multithreaded problems such as run in order, dining philosophers, a bounded blocking queue and a read-write lock, and finally write object-oriented design (LLD) classes for a parking lot, an elevator, an ATM, a vending machine, Splitwise, movie seat booking, a parcel locker and hotel booking, judged like the rest. Every problem has Python, C++, Java and Go starters with a fixed driver, judged online.

Linear structures3

  1. Dynamic ArrayGrowing and shrinking on fixed-size storage
  2. Singly Linked ListHead and tail pointers, insert, remove and reverse in place
  3. Double-Ended Queue (Ring Buffer)Both ends and random access on a ring buffer

Hashing & heaps3

  1. Hash Map (Separate Chaining)Separate chaining, load factor and rehashing
  2. Min-HeapSift up, sift down and Floyd heap construction
  3. LRU CacheO(1) eviction with a hash map and a doubly linked list
  1. Binary Search: lower_bound and upper_boundlower_bound and upper_bound on a half-open range
  2. QuicksortLomuto partition and random pivots
  3. Merge Sort and InversionsA stable merge that counts inversions on the way
  4. Counting SortCounts, prefix sums and a stable placement pass
  5. KMP String MatchingThe prefix function and linear matching that never backs up

Graphs6

  1. Grid BFS Shortest PathFewest steps by expanding layer by layer from a queue
  2. Topological Sort (Lexicographically Smallest)Kahn's algorithm, a min-heap and cycle detection
  3. Dijkstra's Shortest PathsSingle-source shortest paths with a heap and lazy deletion
  4. Bellman-Ford and Negative CyclesNegative weights, n - 1 relaxation rounds and negative cycles
  5. Kruskal's Minimum Spanning TreeA minimum spanning tree from sorted edges and union-find
  6. Prim's Minimum Spanning Tree (Dense Graphs)An O(n²) minimum spanning tree on an adjacency matrix

Advanced structures4

  1. Union-Find (Path Compression + Union by Rank)Path compression and union by rank
  2. TrieCounted insert, erase and prefix counts
  3. Segment Tree: Range Sums and Point UpdatesO(log n) range sums and point updates
  4. Fenwick Tree (Binary Indexed Tree)lowbit, prefix sums and k-th by binary lifting

Concurrency7

  1. Run in OrderTwo "done" signals put three jobs in order
  2. Take TurnsTwo threads taking strict turns
  3. Zero, Even, OddThree threads relaying 0 1 0 2 …
  4. Building WaterSemaphores and a barrier pair two hydrogens with an oxygen
  5. Dining PhilosophersNumbered forks break the circular wait
  6. Bounded Blocking QueueProducers and consumers on one lock and two conditions
  7. Read-Write LockShared readers and an exclusive writer from one lock and a condition

Object-oriented design (LLD)8

  1. Parking LotSpot allocation, tickets and hourly fees
  2. Elevator SchedulingLOOK scheduling with stops sorted by direction
  3. ATMThe State pattern, PIN lockout and note dispensing
  4. Vending MachineA three-state machine, escrow and greedy change
  5. Hotel BookingInventory counted per night, with weekend rates
  6. SplitwiseSplits that never lose a cent, and a fixed settlement rule
  7. Movie Seat BookingAll-or-nothing seat holds that expire
  8. Parcel LockerCompartments, pickup codes and a brute-force lockout