Java Developer Object Oriented programming Interview Question.
Real interview questions asked to me and my friends
I will cover interview question for Object Oriented Programming
(A bit of context: I’ve conducted numerous interviews for software engineering positions in most of the MNCs. Additionally, there have been instances where I faced challenges during coding interviews due to lack of preparation.)
Are you preparing for a job interview as a Java developer?
Find my book Guide To Clear Java Developer Interview here Gumroad (PDF Format) and Amazon (Kindle eBook).
Guide To Clear Spring-Boot Microservice Interview here Gumroad (PDF Format) and Amazon (Kindle eBook).
Guide To Clear Front-End Developer Interview here Gumroad (PDF Format) and Amazon (Kindle eBook).
Download the sample copy here: Guide To Clear Java Developer Interview[Free Sample Copy]
Guide To Clear Spring-Boot Microservice Interview[Free Sample Copy]
Object Oriented Programming:
1. What is polymorphism and how can we achieve it?
2. What is Method overriding, what is access specifiers with example.
3. How to use methods overriding with exception handling with example?
4. Abstract class with constructor and what is the use of constructor if we don’t instantiate abstract class?
5. Four principles of oops?
6.What exactly is abstraction? What are the advantages of it, tried to confuse me with concrete class doing the same, what is the advantage over concrete class?
7. Can interface have no method in it?
8. How will I use encapsulation to design my code?
9. Five tricks to encapsulate the code?
10. Can we have overloaded methods with different return type?
11. What is abstraction and ways to achieve it.
12. Abstract class vs interface?
13. Inheritance vs composition ?
14. What is abstraction now how it is different from encapsulation?
15. What are the solid principles in java
16. What’s the difference between abstract class and interface?
Scenario Based Question:
17. Create a parent P and child C class, in child class I am creating a list, and can we add the object of parent in that list, or can parent class add object of child class in that list?
18. Inheritance related question like
e.g., Parent p and child c is there, and child extends parent, in that case consider following statements
Will it work following statements?
parent p = new parent();
child c = new child();
parent p1=new child();
child c1 = new parent();
which one of the above will compile…
19. If Parent class have some methods like m1,m2,m3 and child have method m1,m2,m3,m4,m5
can parent call 4,5 method of child ?
can child class can call 123 of parent class ?
20. What’s the difference between abstract class and interface?
21. Access modifiers in java ?
a. Different types of access modifiers?
b. What is the use of protected members?
c. Difference between private and protected?
22. What is SOLID principles?
Above OOP question is more beneficial to 0–5 years java developers, coz they might be getting question.
Thanks for reading
- 👏 Please clap for the story and follow me 👉
- 📰 Read more content on my Medium (21 stories on Java Developer interview)
Find my books here:
- Guide To Clear Java Developer Interview here Amazon (Kindle Book) and Gumroad(PDF Format).
- Guide To Clear Spring-Boot Microservice Interview here Gumroad (PDF Format) and Amazon (Kindle eBook).
- Guide To Clear Front-End Developer Interview here Gumroad (PDF Format) and Amazon (Kindle eBook).
- 🔔 Follow me: LinkedIn | Twitter | Youtube