Following are frequently asked Interview Questions for freshers as well as an experienced .net/ Java/Python Software Developers.
1) What is OOPS?
2) Write basic concepts of OOPS?
3) What is a class?
4) What is an Object?
5) What is Encapsulation?
Levels are Public, Protected, Private, Internal, and Protected Internal.
6) What is Polymorphism?
7) What is Inheritance?
8) What are manipulators?
9) Explain the term constructor
- Constructor Name should be the same as a class name.
- A constructor must have no return type.
10) Define Destructor?
11) What is an Inline function?
12) What is a virtual function?
A virtual function can be declared using a token(virtual) in C++. It can be achieved in C/Python Language by using function pointers or pointers to function.
13) What is a friend function?
A friend can be declared anywhere in the class declaration, and it cannot be affected by access control keywords like private, public, or protected.
14) What is function overloading?
void add(int& a, int& b);
void add(double& a, double& b);
void add(struct bob& a, struct bob& b);
15) What is operator overloading?
16) What is an abstract class?
17) What is a ternary operator?
18) What is the use of finalize method?
19) What are the different types of arguments?
- Call by Value – Value passed will get modified only inside the function, and it returns the same value whatever it is passed into the function.
- Call by Reference – Value passed will get modified in both inside and outside the functions and it returns the same or different value.
20) What is the super keyword?
It also forwards a call from a constructor, to a constructor in the superclass.
21) What is method overriding?
22) What is an interface?
Java uses Interface to implement multiple inheritances.
23) What is exception handling?
24) What are tokens?
Even punctuation characters are also considered as tokens. Example: Brackets, Commas, Braces, and Parentheses.
25) What is the main difference between overloading and overriding?
Overriding is the same method names with the same arguments and return types associated with the class and its child class.
26) What is the main difference between a class and an object?
A class can have sub-classes, while an object doesn’t have sub-objects.
27) What is an abstraction?
28) What are the access modifiers?
- Protected Friend
29) What are sealed modifiers?
30) How can we call the base method without creating an instance?
Doing Inheritance from that class.-Use Base Keyword from a derived class.
31) What is the difference between new and override?
32) What are the various types of constructors?
– Default Constructor – With no parameters.
– Parametric Constructor – With Parameters. Create a new instance of a class and also passing arguments simultaneously.
– Copy Constructor – Which creates a new object as a copy of an existing object.
33) What is early and late Binding?
34) What is ‘this’ pointer?
35) What is the difference between structure and a class?
36) What is the default access modifier in a class?
37) What is a pure virtual function?
Virtual void function1() // Virtual, Not pure
Virtual void function2() = 0 //Pure virtual
38) What are all the operators that cannot be overloaded?
- Scope Resolution (::)
- Member Selection (.)
- Member selection through a pointer to function (.*)
39) What is dynamic or run time polymorphism?
40) Do we require a parameter for constructors?
41) What is a copy constructor?
42) What does the keyword virtual represented in the method definition?
43) Whether static method can use nonstatic members?
44) What are a base class, subclass, and superclass?
A Subclass is a class that inherits from one or more base classes.
The superclass is the parent class from which another class inherits.
45) What is static and dynamic Binding?
Dynamic Binding is a binding in which name can be associated with the class during execution time, and it is also called as Late Binding.