C++ track

C++ interview questions and answers

Panel-ready C++ interview set questions for freshers and experienced developers. Practice at Coding Cadre in Faridabad, or Online from Delhi NCR.

208 Qs
23 Moderate Concurrency C++

What does std::mutex protect?

Short take

Simple meaning

Mutual exclusion around a critical section sharing state.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
24 Moderate Concurrency C++

What is std::condition_variable for?

Short take

Simple meaning

Threads wait until a predicate becomes true and get notified.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
27 Moderate Memory C++

What is placement new?

Short take

Simple meaning

Constructing an object in pre-allocated storage.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
32 Moderate Modern C++

What is structured bindings?

Short take

Simple meaning

Auto unpacking of pairs, tuples, and aggregates into named variables.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
33 Moderate Performance C++

Why can small string optimization matter?

Short take

Simple meaning

Many std::string implementations store short strings inside the object without heap.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
35 Moderate Modern C++

What is if constexpr used for?

Short take

Simple meaning

Compile-time branching in templates so discarded branches need not be instantiable.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
38 Moderate Errors C++

How do you use RAII for file handles?

Short take

Simple meaning

Wrap fopen or OS handles in a class or unique_ptr with a custom deleter.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
40 Moderate Templates C++

What is CRTP used for?

Short take

Simple meaning

Curiously Recurring Template Pattern gives static polymorphism without virtual calls.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
Prev Page 2 of 5 Next
Chat with us