Interview Questions (3-6 Years)
Interview Questions (3-6 Years)
Core Java
1. What is the difference between `==` and `.equals()` in Java?
2. Explain the concept of immutability. How do you create an immutable class?
3. What is the difference between `ArrayList` and `LinkedList`?
4. How does `HashMap` work internally?
5. Explain method overloading vs method overriding with examples.
6. What is the use of `synchronized` keyword? How does it work?
7. What is a deadlock? How can you prevent it in Java?
8. What are `Callable` and `Future` in Java concurrency?
9. Explain the Executor framework. How is it better than creating threads manually?
10. What is the difference between `wait()`, `notify()`, and `notifyAll()`?
11. How does Garbage Collection work in Java?
12. What are memory leaks in Java? How can you detect and avoid them?
13. What are strong, weak, soft, and phantom references?
14. How do you profile and monitor Java applications in production?
15. Explain the difference between `List`, `Set`, and `Map`.
16. What is the use of Generics in Java? Give a practical example.
17. What are Concurrent Collections in Java?
18. What is a functional interface? How is it used with lambdas?
19. Explain Stream API. How is it useful for collection processing?
20. What is `Optional` in Java 8? How do you use it to avoid
`NullPointerException`?
Core Python
1. What are mutable and immutable data types in Python?
2. How does Python manage memory? What is reference counting?
3. Explain list comprehension with examples.
4. What are Python decorators? How are they implemented?
5. What's the difference between `is` and `==`?
6. What is the Global Interpreter Lock (GIL)? How does it affect threading?
7. When should you use `multiprocessing` over `threading`?
8. What is `asyncio` in Python? How is it different from threading?
9. How do you handle memory leaks or performance bottlenecks in Python?
10. Explain multiple inheritance in Python with an example.
11. What are metaclasses in Python?
12. What are magic methods (`__init__`, `__str__`, `__repr__`, etc.)?
13. Difference between shallow copy and deep copy.
14. How do you manage dependencies in Python projects?
15. What is the difference between `pip` and `conda`?
16. How do you handle exceptions and log them effectively?
17. What are Python's built-in testing frameworks? How do you use `unittest` or
`pytest`?
18. Explain how Flask or Django handles HTTP requests.
19. How do you secure a Django/Flask app (e.g., against SQL Injection, CSRF)?
20. Have you worked with any Python-based APIs or automation frameworks? Describe a
project where you did.