C++ Core Concepts Flashcards

(35 cards)

1
Q

Encapsulation

A

Bundling data and methods; controlling access to internal state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Inheritance

A

Deriving a class from another to reuse/extend functionality.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Polymorphism

A

Ability for objects to take many forms; typically via virtual functions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Abstraction

A

Hiding implementation details behind a defined interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Composition

A

Building classes by including instances of other classes rather than inheriting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

RAII
(Resource Acquisition Is Initialization)

A

resource lifetime is tied to object lifetime for deterministic cleanup

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

PIMPL
(Pointer to Implementation)

A

Hiding implementation details to reduce compile-time dependencies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

unique_ptr

A

exclusive ownership of a resource

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

shared_ptr

A

reference-counted shared ownership

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

weak_ptr

A

non-owning reference to a shared pointer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Value Semantics

A

Object copies own their data independently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Reference Semantics

A

Objects refer to shared data rather than copying.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Copy Semantics

A

Creates a new object as a duplicate of an existing object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Move Semantics

A

Transfers ownership of resources from one object to another without duplicating them

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Deep Copy

A

Copying all object data recursively.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Shallow Copy

A

Copying only references/pointers, not owned data.

17
Q

Constructor

A

function of a class that is automatically called when an object is created

18
Q

Destructor

A

function called automatically when an object goes out of scope or is deleted

19
Q

Overloading

A

Defining multiple functions/operators with the same name but different parameters.

20
Q

Explicit

A

Forces the conversion of one type to another to be done manually

21
Q

Implicit

A

compiler automatically converts one type to another when needed

22
Q

Immutable

A

Data that cannot be changed after creation

23
Q

Mutable

A

Data marked as this can be modified even inside const member functions

24
Q

Lambdas

A

Inline anonymous functions with optional captures.

25
Templates
Generic programming for type-agnostic code.
26
Constexpr
Compile-time constants and functions.
27
Scope
Lifetime and visibility of variables.
28
Namespace
Organizing symbols to avoid name collisions.
29
Public access
Members are accessible anywhere the object is visible
30
Private access
Members are accessible only inside the class (and friends)
31
Protected access
Members are accessible in the class and its derived classes
32
Static
makes one value or function exist once and be reused, rather than recreated each time
33
lvalue
expression with an identifiable memory location and persistent lifetime
34
rvalue
temporary value without a stable memory location, often eligible for moving
35
invariant
property/state that must remain true for the lifetime of an object.