Implement Resource pool pattern in JavaScript | Thoughtspot MTS-3 Interview Question