Professional Documents
Culture Documents
Object Oriented Programming
Object Oriented Programming
Interview Preparation
Ankush Singla
Doubts?
Test3
Objective Questions
C++ Classes
1.
2.
3.
Access Modifiers
1.
2.
3.
Public
Protected
Private
10
1.
2.
3.
4.
Constructor
Copy Constructor
Copy Assignment Operator
Destructor
11
12
Initializer List
13
14
Operator Overloading
class pair
{
public:
int x,y;
bool operator < ( const pair& p ) const
{
if(x==p.x) return y<p.y;
return x<p.x;
}
};
15
Components of OOP
1.
2.
3.
Encapsulation
Inheritance
Polymorphism
16
Encapsulation
1.
2.
3.
17
Inheritance
1.
2.
3.
18
19
Polymorphism
1.
2.
3.
4.
20
Virtual Function?
21
22
Abstract functions
(Pure Virtual)
23
Abstract Classes(Interfaces)
24
1.
2.
3.
4.
5.
Public
Protected
Private
Const
Static
25
Function Modifiers
1.
2.
3.
4.
5.
6.
7.
Public?
Protected?
Private?
Virtual
Pure Virtual?
Const
Static
26
Multiple Inheritance
27
Multiple Inheritance
Teacher
Student
TA
28
Multiple Inheritance
class Teacher: public Person, public Employee
{
private:
int m_nTeachesGrade;
public:
Teacher(std::string strName, std::string strEmployer,
double dWage, int nTeachesGrade)
: Person(strName), Employee(strEmployer,
dWage), m_nTeachesGrade(nTeachesGrade)
{
}
};
29
Diamond Problem
30
Templates
31
32
Template Methods
33
34
Exceptions
35
36
Type of Exceptions
1.
2.
Std::exception
Any type you want to throw
38
SQL
SQL Queries
1.
2.
3.
4.
5.
6.
7.
8.
9.
Create Database
Create Table
Alter Table
Insert data
Select Data
Delete data
Like Queries
Order By
Group By
41
SQL Joins
1.
2.
3.
4.
Inner Join
Left Join
Right Join
Outer Join
42
1.
2.
3.
4.
5.
Primary Key
Not Null
Default Value
Auto Increment
Create Index
43
1.
2.
3.
4.
Count
Sum
Avg
Now
44
45
Thank you
Ankush
Singla
ankush@codingninjas.in