July 22, 2019

UBS interview questions

  1. Explain concurrency utils i.e. Atomic package? (Answer)
  2. How AtomicInteger works internally? (Answer)
  3. What is a volatile keyword? (Answer)
  4. Why is AtomicInteger class better than a synchronized counter class? (Answer)
  5. What is CAS?(Answer)
  6. How does Executor work? (Answer)
  7. What is a future? How is it used in ExecutorService? (Answer)
  8. What is difference between ExecutorService and ForkJoinPool? (Answer)
  9. Design your own custom Threadpool executor with minimal functionality? (Answer)
  10. Explain Java Memory Model? (Answer)
  11. Explain Producer Consumer Problem using Blocking Queue in Java? (Answer)
  12. How will you implement your own thread-safe blocking queue in Java? (Answer)
  13. Write a code to create a thread-safe Singleton class. (Answer)
  14. Explain decorator design pattern? (Answer)
  15. What is Singleton Design Pattern, how will you make it thread-safe?(Answer)
  16. Explain static and dynamic loading in Java.
  17. What is the difference between a abstract class and an interface.
  18. What is difference between ExecutorService and ForkJoinPool?
  19. Write a program to calculate Factorial of a number using recursive function. To improve the performance, try to use HashMap, which will store the calculated factorials that can be reused. (solution)
  20. Best sort for already sorted array.(solution)

No comments:

Post a Comment