Back to problems

Implement a DB Connection Pool

Object-Oriented Programming · Harvey · Medium

Problem Overview Your task is to build a database connection pool that distributes a fixed batch of connections to callers and reclaims them afterward. A mock database connection exposing a query method is supplied; you only need to implement the logic for acquiring and releasing connections. This exercise has a specific shape: A mock object db.query is given to you. Do not implement actual query processing, network calls, or real database connections. You must fill in the…

Checking your access…