Memory, RAII, templates, move semantics, and the STL — the C++ interview core.
Preview — first 3 of 114 cards
What are the basic built-in types in C++?
bool, char, short, int, long, long long, float, double, long double, plus unsigned variants. Fixed-width types (int32_t, uint64_t) live in <cstdint>. sizeof and alignof describe layout.
#include <cstdint>
int32_t a = 42;
size_t n = sizeof(a); // 4
alignof(double); // typically 8
Pointer vs reference
Pointer: nullable, rebindable, supports arithmetic. Reference: alias to existing object, must be initialized, cannot be null/reseated. Use references for parameters; pointers for optional/nullable.
int x = 5;
int* p = &x; // pointer
int& r = x; // reference
r = 10; // x becomes 10
p = nullptr; // ok
// int& r2; // error: must init
const correctness
const T: the object can't be modified. const T* (same as T const*): pointer to const data. T* const: const pointer whose pointee is mutable. const T* const: const pointer to const data. A const member function promises not to modify *this, so it can be called on const objects.
int x = 0;
const int* p1 = &x; // pointer to const int (T const*)
int* const p2 = &x; // const pointer, pointee mutable
const int* const p3 = &x; // const pointer to const int
struct S {
int get() const { return 1; } // const member fn
};
111 more cards in this sheet
Unlock the Languages bundle — ₹399
One-time payment. Unlocks this sheet and 7 other sheets in the bundle, plus a typeset PDF of each.
Unlock the bundle
See all bundles
Or get all 76 sheets for ₹999 — one payment, every future sheet included.