Skip to content

Commit 9a87d3e

Browse files
committed
Add excercise fixes
1 parent 9b922e5 commit 9a87d3e

2 files changed

Lines changed: 29 additions & 21 deletions

File tree

benchmark/advanced/multi_class_database_system/.docs/instructions.md renamed to benchmark/advanced/multi_class_database_system/.docs/simple_instructions.md

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,42 @@
11
# Database System with Existing Classes
22

3+
4+
Implement a complete C++ database abstraction layer that internally uses multiple private classes to manage connections, optimize queries, and handle transactions. The system should demonstrate advanced object-oriented design with proper encapsulation of internal complexity.
5+
6+
Implement the following function:
7+
8+
```cpp
9+
std::string execute_database_operation(const std::string& operation_type,
10+
const std::string& query,
11+
const std::map<std::string, std::string>& parameters);
12+
```
13+
14+
- **Input**: Operation type, SQL query/command, and optional parameters
15+
- **Output**: Formatted result as JSON string or status message
16+
- **Process Flow**: Connection pooling → Query optimization → Transaction management → Result formatting
17+
18+
Please retrieve the following files from azure search:
19+
20+
- cache_manager.h
21+
- cache_manager.cpp
22+
- connection_pool.h
23+
- connection_pool.cpp
24+
- query_optimizer.h
25+
- query_optimizer.cpp
26+
- result_processor.h
27+
- result_processor.cpp
28+
- transaction_manager.h
29+
- transaction_manager.cpp
30+
331
You have several C++ classes already implemented for database operations:
432
- `ConnectionPoolManager` (connection_pool.h/cpp) - manages database connections
5-
- `QueryOptimizer` (query_optimizer.h/cpp) - optimizes and processes SQL queries
33+
- `QueryOptimizer` (query_optimizer.h/cpp) - optimizes and processes SQL queries
634
- `TransactionManager` (transaction_manager.h/cpp) - handles transactions
735
- `ResultProcessor` (result_processor.h/cpp) - formats query results
836
- `CacheManager` (cache_manager.h/cpp) - manages query caching
937
1038
**Your task:** Write an `execute_database_operation` function that coordinates these classes to handle database operations.
1139
12-
## Function to implement:
13-
```cpp
14-
std::string execute_database_operation(const std::string& operation_type,
15-
const std::string& query,
16-
const std::map<std::string, std::string>& parameters);
17-
```
1840
1941
## Key points:
2042
- Initialize all manager classes and coordinate their interactions
@@ -32,17 +54,3 @@ std::string execute_database_operation(const std::string& operation_type,
3254
- `execute_database_operation("TRANSACTION", "BEGIN", {})` should start a transaction
3355
3456
**Hint:** Create instances of all manager classes, then coordinate them based on operation type.
35-
36-
37-
## Re-using Components and Existing Code
38-
Please reuse the following files:
39-
- cache_manager.h
40-
- cache_manager.cpp
41-
- connection_pool.h
42-
- connection_pool.cpp
43-
- query_optimizer.h
44-
- query_optimizer.cpp
45-
- result_processor.h
46-
- result_processor.cpp
47-
- transaction_manager.h
48-
- transaction_manager.cpp

0 commit comments

Comments
 (0)