I decided to share with you some stuff which could be useful for the beginners.
Every time you go to the Java interview you almost always get the familiar set of questions. Here is the list of questions that in my opinion are commonly asked at the interviews.
I won't give answers in this post for now. Feel free to explore them on your own.
- Class Object in Java. Methods equals, hashCode, toString. Default implementation.
- StringBuilder and StringBuffer. What is the difference? Compare strings by == and equals. String pool.
- Collections. Basic interfaces and collections. ArrayList and LinkedList. HashMap default implementation. Difference between HashMap and LinkedHashMap and TreeMap.
- Threads. Thread class. Interface Runnable. Monitor object. Methods wait, notify, notifyAll. Interface Executor. Synchronized keyword. Volatile keyword. Thread-safe collections. Dining philosophers.
- Difference between interface and abstract class.
- Lambda expressions. Default methods in interfaces.
- Exceptions. Checked and unchecked. Difference.
- Keyword final on class, method, instance member variable, method argument.
- Try/catch/finally. Cases when finally block will not get executed.
- Basic principles of garbage collector.
- GoF templates. Examples. Do not mention Singleton. Visitor, Adapter, Builder, Template method, Strategy.
- Basic SOLID principles.
- What is TDD?
Answer: One thread can call synchronized method and another one can call non synchronized method. Synchronized keyword means that a thread needs to obtain object's monitor first. If there are no such word on a method then nothing stops the second thread to operate on an object.
That is all for now. Good luck!
Комментариев нет:
Отправить комментарий