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
Design a service for messages
Lets say for each message we are going to charge .001
This service will have two endpoints -> get Current balance and substract balance
So what datastructure you will prefer to use for this and why
If int why
If long why
If double why
And why not big decimal
If your peer is your int and you have to give code reviee comments
What if there we are doing load testing -> and now the resutls are printed after 100 calls will be 1 or 2 or3
Why this is happening
How we can avaoi d
How to add locks -> syncrnorixed locks what are other mechanism we can used for this
Synchrnized and volatile keyword
Does volatile keyword will make it thread safe
What if there are other customers too such as 1,2,3
Now how you will store this information
And why you will use hashmap or you can use other datastrucutres such as hashtables why hashmap for this
How you will create tables for this -> how u will maintain the state
How you will test your changes for load testing and what are the parameters you will measure for the same
Have you used multithreading in real world in java application explain with an examples