MathWorks Interview Question

I chose Java. 1. Difference between Arraylist and Vector, which is more memory efficient? 2. Suppose two threads are trying to access a resource, how are you going to make that possible without calling using semaphores? 3.Desing a restaurant class? Which design you used like Singleton or Factory Pattern etc? 4.Gave me code snippet and asked about the output. Python was easier. Gave me a code snippet. S="Joyce" S[0] ="K" print S