- This is an entry test for our ZaloPay candidates
- He/she must write solutions in English to answer following problems
- Code must be written in Java
- What is thread safety? Why do we need it?
HashMap<Int, String>
by default is NOT thread safe.- How can you make it thread-safe ?
- Show your code & identify any bottle neck may have impact on your code performance
- Suggest your improvement (if any)
- Design & implement your own
Map<Int, String>
(onlyput
andget
operations) . Hints:- You have to design appropriate data structures using only primitives such as: array, string, number.
- Implement
- Evaluate your implementation complexities for
put
andget
2 days