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.

81 High Modern C++

What is std::expected used for?

Short take Full answer on next page

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 Full answer on next page

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 Full answer on next page

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
86 Moderate Concurrency C++

What is std::async with launch policies?

Short take Full answer on next page

Simple meaning

async may run deferred or on another thread depending on policy.

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 Full answer on next page

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
92 High Concurrency C++

What is thread sanitizer telling you?

Short take Full answer on next page

Simple meaning

It reports data races and some lock order issues.

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

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

What is std::string_view pitfall?

Short take Full answer on next page

Simple meaning

It does not own memory, so temporaries can dangle.

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

Read full answer Example · Mistake · Say this
94 High Performance C++

How do you write cache-friendly spatial data?

Short take Full answer on next page

Simple meaning

Keep hot fields together, avoid polymorphism in inner loops, and batch processing.

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

Read full answer Example · Mistake · Say this
95 Easy OOP C++

What is operator overloading caution?

Short take Full answer on next page

Simple meaning

Overload operators only when meaning is obvious like arithmetic types.

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 Full answer on next page

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 Full answer on next page

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 Full answer on next page

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
99 Easy STL C++

What does std::vector::reserve do?

Short take Full answer on next page

Simple meaning

It preallocates capacity without changing size.

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 Full answer on next page

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