Monday, February 23, 2015

Sapient Global Market Java Interview Questions

  1. How do we synchronize a static method to prevent data corruption in concurrent update ?
  2. How will you introduce multi-tasking in your java application ?
  3. Design a program to search files inside a directory using multi-threadig?
  4. How will you implement a LRU timed cache in Java ?
  5. There is a folder containing multiple SQL files. Each file's name contain a sequence number which determines the execution order of that particular SQL script file. Design an API that will take such folder and execute the SQL in correct order.
  6. Difference between wait() and sleep() method ?
  7. What is a deadlock situation ? How will you handle deadlock in development and production environment ?
  8. What is mechanism for inter-thread communication ?
  9. Would adding multi-threading to sorting algorithm improve its performance ?
  10. In what practical scenario's multi-threading actually improves the performance of Java application ?
  11. Do we need to synchronize getter and setter both to prevent concurrency related issues on a collection ?
  12. Explain the key classes in java.util.concurrent package ?
  13. What is purpose of ConcurrentHashMap ?
  14. What is purpose of a Future ? How will you use it ?
  15. How will you create your own custom Thread Pool ?
  16. What is a BlockingQueue ?
  17. There is three file contains flight data. File data has in csv format.
    1)Write a standalone program to search flight detail from all files depend on criteria
    2)Criteria would be departure location,arrival location, flight date.
    3)Program should follow\Oops principle. And right unit test case also.
    4)Result should be in Ascending or descending order.
    5)Data separated with pipe | .

    File A has data like below:

    File B has data like below:

    File C has data like below:
Most of these questions has been answered in my eBook "Cracking the Core Java Interview"

No comments:

Post a Comment

Your comment will be published after review from moderator