OOP Mini Project: In-Memory Database

Medium Applied OOP Mini Projects
Solve in Playground →

Problem Statement

Implement an OOP in-memory table storage system with a `Table` class that supports `insert(row)` and `select(condition_fn)` returning matching rows. Read N rows as key-value pairs (key:int, val:str), insert them, filter by value prefix, and print the count.

Input Format

Line 1: integer N. Next N lines: key and val separated by space. Last line: prefix string.

Output Format

Print the number of matching records found.

Constraints

0 <= N <= 50

Sample Input

3
1 apple
2 banana
3 apricot
a

Sample Output

2

Explanation

Records with keys 1 and 3 match the prefix 'a'.

Starter Code

class Table:
    def __init__(self):
        pass
    def insert(self, row):
        pass
    def select(self, cond):
        pass

if __name__ == '__main__':
    # Implement I/O logic here
    pass

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used