A simple Calculator class that's wired up as a Spring bean in a web application:
public class Calculator {
int result;
public int addTwoNumbers(int first, int second) {
result = first + second;
return result;
}
}
What can potentially go wrong with this?
This is probably the most important topic for coding interviews and you should prepare it well. At a bare minimum, you should know about the array, linked list, binary trees, binary search tree, self-balanced trees like AVL tree, hash table(or map or dictionaries as known in Java and Python) stack, queue, and graph.
Multi threading problems. By default Spring beans are singletons.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With