MongoDB Interview Question

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