Skip to content
IT glossary
BackendUpdated December 3, 2026

C++

Developers use C++ to build software such as database engines, servers, and games. C++ is usually compiled to machine code and gives programmers control over how data is stored and when resources are released.

Also known as: плюсы

What C++ is

C++ is a general-purpose language that lets you write high-level code while making decisions about memory and object lifetime. For example, you can use std::vector as a growable array without writing the resizing code yourself, yet still decide when to reserve space. C++ is statically typed: the compiler checks types before the program runs, even when you use auto and let it infer a type. The language supports ordinary functions, classes, and templates; not every design needs an inheritance hierarchy.

From source code to a program

In a typical build, each .cpp file is compiled separately along with the headers it includes. That produces object files, which the linker combines and connects to any required libraries. This distinction helps when diagnosing build failures: the compiler can accept a call after seeing a matching declaration, but the linker can still fail if it can't find the function's definition.

Resource ownership in practice

Modern C++ usually gives responsibility for a resource to an object. This technique is called RAII: the owner acquires the resource as part of initialization and releases it in its destructor. It works for memory, files, and locks. Here's a lock guard in a backend-style counter:

#include <mutex>

class RequestCounter {
    std::mutex mutex_;
    unsigned count_ = 0;

public:
    unsigned next() {
        std::lock_guard<std::mutex> lock(mutex_);
        return ++count_;
    }
};

The guard locks the mutex before the increment and unlocks it when the function returns. If later code in that scope throws and the exception unwinds the stack, the guard's destructor still unlocks the mutex. You don't have to remember a separate unlock() on each exit path.

Where it fits in backend work

C++ is used in database engines, storage systems, and network infrastructure. It can be a good fit when profiling shows that CPU work, memory layout, or allocation overhead is a bottleneck. It won't automatically make a service faster: if requests mostly wait for an external database, addressing that wait is likely to matter more than changing languages.

One common mistake is confusing access with ownership. Passing a reference lets another function use an object, but generally does not keep that object alive. Similarly, keeping a pointer to a vector element is unsafe if a later operation reallocates the vector's storage. The program may compile even though using the stale pointer has undefined behavior.

What interviewers look for

Expect a short snippet and questions about what gets copied, what gets moved, and what gets destroyed at the end of a scope. Start by identifying the owner of each resource. Then check what can happen to any references, pointers, or iterators when that owner is destroyed or modified.