Domanda di colloquio di MongoDB

How does ExecutorService limit concurrency? How would you make the visited set thread-safe?