Interview Experience : Vonyage - Round 1

Motivation

just documenting my journey of the interview prepration and learning by doing and sharing it with others

Interview Questions

  1. Design a service for messages

  2. Lets say for each message we are going to charge .001

  3. This service will have two endpoints -> get Current balance and substract balance

  4. So what datastructure you will prefer to use for this and why

  5. If int why

  6. If long why

  7. If double why

  8. And why not big decimal

  9. If your peer is your int and you have to give code reviee comments

  10. What if there we are doing load testing -> and now the resutls are printed after 100 calls will be 1 or 2 or3

  11. Why this is happening

  12. How we can avaoi d

  13. How to add locks -> syncrnorixed locks what are other mechanism we can used for this

  14. Synchrnized and volatile keyword

  15. Does volatile keyword will make it thread safe

  16. What if there are other customers too such as 1,2,3

  17. Now how you will store this information

  18. And why you will use hashmap or you can use other datastrucutres such as hashtables why hashmap for this

  19. How you will create tables for this -> how u will maintain the state

  20. How you will test your changes for load testing and what are the parameters you will measure for the same

  21. Have you used multithreading in real world in java application explain with an examples