The below C++ function returns the string clinic when given an input of string yes.
Accenture technical mcq question, verified with a worked answer. Free to practise - no sign-up.
The below C++ function returns the string clinic when given an input of string yes.
#include <iostream>
using namespace std;
int main(void) {
while (1) {
string s;
cin >> s;
if (s == "yes") {
cout << "clinic" << endl;
} else {
break;
}
}
return 0;
}
(Q11)
Choose the description that is incorrect regarding the differences between in-memory databases and traditional databases like MySQL or PostgreSQL.
Show answer & explanation
Option B is factually incorrect. In-memory databases store data in RAM, which is volatile—if power is lost or hardware fails, data is immediately lost unless explicitly persisted to disk. They are actually MORE vulnerable to physical failures than disk-based databases like MySQL/PostgreSQL, which provide durability guarantees. Options A, C, and D are all correct: in-memory DBs are faster (no disk I/O), capacity management relies primarily on RAM sizing (though eviction policies like LRU exist), and Redis/Memcached are standard examples.
Step-by-step Derivation:
Evaluate each statement:
- A: TRUE. In-memory databases eliminate disk I/O latency, making them significantly faster.
- B: FALSE. In-memory data exists only in volatile RAM. Hardware failure or power loss causes immediate data loss. Disk databases persist data redundantly.
- C: TRUE. In-memory DBs primarily rely on RAM provisioning; eviction policies are secondary mechanisms.
- D: TRUE. Redis and Memcached are well-known in-memory cache systems.
The question asks for the INCORRECT statement, so the answer is B.