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
81 High Modern C++

What is std::expected used for?

Short take

Simple meaning

It returns a value or an error without exceptions for expected failures.

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

Read full answer Example · Mistake · Say this
83 Easy Basics C++

What does sizeof return?

Short take

Simple meaning

The size in bytes of an object or type including padding.

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

Read full answer Example · Mistake · Say this
85 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
91 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
96 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
97 Easy Basics C++

What is RAII in C++?

Short take

Simple meaning

Resource Acquisition Is Initialization ties resource lifetime to object lifetime.

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

Read full answer Example · Mistake · Say this
98 Easy Basics C++

What does nullptr represent?

Short take

Simple meaning

A typed null pointer constant safer than 0 or NULL.

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

Read full answer Example · Mistake · Say this
100 Easy STL C++

What is std::pair?

Short take

Simple meaning

A simple two-value aggregate used by maps and algorithms.

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

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