1. Data Structures & Algorithms Implement a custom hash map (dictionary) from scratch, including collision resolution. Design and implement a thread-safe queue. Write a function to find the $k$-th largest element in an unsorted array efficiently (e.g., using a min-heap or Quickselect). Implement a graph traversal algorithm (BFS or DFS) to find the shortest path between two nodes in an unweighted graph. Create a data structure that supports adding, deleting, and finding the median element in $O(\log N)$ time. Reverse a linked list iteratively and recursively. 2. Object-Oriented Programming (OOP) Design a class hierarchy for a "Shape" system (e.g., Circle, Rectangle, Triangle) with methods for calculating area and perimeter. Emphasize polymorphism. Implement a context manager using `__enter__` and `__exit__` for safely handling file operations or database connections. Create a custom iterator and generator for a sequence (e.g., Fibonacci numbers). Discuss and demonstrate the use of abstract base classes (`abc` module) for enforcing interface contracts. Implement the Singleton design pattern in Python. Explain its pros and cons. 3. Concurrency & Parallelism Write a Python script that uses `threading` to download multiple URLs concurrently. Implement a multiprocessing pool to perform a CPU-bound task on a large dataset. Compare and contrast `threading` and `multiprocessing` in Python, including the GIL's impact. Use `asyncio` to build a simple non-blocking web server or a client that fetches data from multiple APIs concurrently. Demonstrate how to use `Lock` or `Semaphore` for resource synchronization in a multi-threaded application. 4. Networking & Web Build a simple RESTful API using Flask or Django REST Framework that performs CRUD operations on a resource (e.g., "books"). Write a client that consumes a public API (e.g., GitHub, OpenWeatherMap) and parses the JSON response. Implement a basic TCP server and client that can send and receive messages. Discuss common web security vulnerabilities (XSS, CSRF, SQL Injection) and how Python web frameworks mitigate them. Create a web scraper using `requests` and `BeautifulSoup` to extract specific data from a website. 5. Testing & Debugging Write unit tests for a given Python module using `unittest` or `pytest`, including mocking external dependencies. Demonstrate how to use `pdb` for interactive debugging of a Python script. Explain the concept of Test-Driven Development (TDD) and provide a small example. Discuss different types of tests (unit, integration, end-to-end) and their importance. Implement a continuous integration (CI) pipeline for a Python project (conceptual discussion or example using a tool like GitHub Actions). 6. Performance & Optimization Profile a Python script using `cProfile` and identify performance bottlenecks. Demonstrate how to use `collections.deque` for efficient appends and pops compared to `list`. Explain Python's garbage collection mechanism. Discuss techniques for optimizing Python code (e.g., using built-in functions, `numpy` for numerical operations, `Cython`). Compare different ways to concatenate strings efficiently in Python. 7. Advanced Python Concepts Explain decorators in Python, including how to create them and common use cases (e.g., logging, authentication). Demonstrate metaclasses with a practical example. Discuss descriptors and their use cases (e.g., `property`). Explain how Python's import system works, including `sys.path` and package initialization. Implement a custom context manager using the `contextlib` module and a generator. Write a function that uses `functools.lru_cache` to memoize expensive computations. 8. System & DevOps Write a script to automate file system operations (e.g., moving, copying, compressing files) using `os` and `shutil`. Create a command-line interface (CLI) tool using `argparse` or `Click`. Interact with environment variables in Python. Explain how to containerize a Python application using Docker. Write a script that monitors a log file for specific patterns and triggers an alert.