View Code? Open in Web Editor
NEW
๐ python practice | questions, concepts, system design, concurrent
practice-python's Introduction
Practice Python ๐ฉโ๐ป
- Python Concurrency and Parallelism Problems :
good for understanding the concept of concurrency and parallelism
- Concurrent Web Scraper link
- Parallel File Processing link
- Concurrent Producer-Consumer link
- Concurrent Programming ( Details ) :
basic concepts of concurrent programming
- Datastructures ( Details ) :
basic data structures and their implementations
- Algorithms ( Details ):
basic algorithms and their implementations
- FAQs :
frequently asked questions (not only Python)
Python Concurrency and Parallelism Problems
- Objective: Implement a concurrent web scraper that retrieves data from
multiple web pages simultaneously.
- Requirements:
- Use the requests library to fetch web pages.
- Utilize the asyncio module to achieve concurrency.
- Scrape data from a list of URLs concurrently.
- Process and store the scraped data.
- Extension: Implement rate limiting to avoid overloading the target website.
- Objective: Develop a program that processes a large set of files concurrently.
- Requirements:
- Accept a directory path as input.
- Use the multiprocessing module to process files concurrently.
- Apply a specific operation to each file (e.g., compression, encryption, or
analysis).
- Display the progress and status of the file processing.
- Extension: Implement error handling and logging for file processing failures.
- Objective: Implement a concurrent producer-consumer system using threads.
- Requirements:
- Create a shared queue to store data items.
- Implement producer threads that generate and add data items to the queue.
- Implement consumer threads that retrieve and process data items from the
queue.
- Use synchronization primitives (e.g., locks or semaphores) to ensure thread
safety.
- Display the production and consumption of data items.
- Extension: Implement a mechanism to gracefully terminate the producer and
consumer threads.
index |
concurrent programming |
link |
1 |
barriers |
link |
2 |
fizzbuzz |
link |
3 |
fizzbuzz_async |
link |
4 |
fizzbuzz_multithreading |
link |
5 |
future |
link |
6 |
helloworld |
link |
7 |
interface |
link |
8 |
locks |
link |
9 |
quickstart |
link |
10 |
semaphores |
link |
11 |
sharedresources |
link |
index |
algorithm |
link |
1 |
BFS |
link |
2 |
DFS |
link |
3 |
Binary Search |
link |
4 |
Quick Sort |
link |
practice-python's People
Contributors
Watchers