C++ Online Assessment Questions & Answers
40 questions for the online assessment stage — 21 easy, 19 medium.
About the online assessment round
Most companies start with an online test: aptitude and reasoning, a few MCQs on core C++ concepts, and one or two short hands-on tasks. It filters a large number of applicants, so speed and accuracy both count.
Tips for the online assessment round
- Practise under a timer: about one minute per MCQ and 15-20 minutes per hands-on task.
- Read every option before answering; tests often include two nearly correct choices.
- Use a stable internet connection, keep your camera on and avoid switching tabs in proctored tests.
- Attempt the questions you are sure about first, then return to the harder ones.
Explain the stages of compiling and running a C++ program.
Show answer
What are C++20 concepts?
Show answer
Group a list of words into anagram groups.
Show answer
Write a thread-safe counter using std::atomic.
Show answer
What are structured bindings and how do they work with range-based for loops?
Show answer
What is std::string_view and what are its pitfalls?
Show answer
What are the fundamental data types in C++ and their typical sizes?
Show answer
Write a program where two threads print odd and even numbers alternately up to 10.
Show answer
What are lvalues and rvalues?
Show answer
Write a Shape hierarchy with a virtual area function and use it polymorphically.
Show answer
What is CMake and why is it used for C++ projects?
Show answer
What do auto and decltype do?
Show answer
What are type traits and how does if constexpr use them?
Show answer
Write a GoogleTest unit test for a function, including an edge case.
Show answer
What is the difference between struct and class in C++?
Show answer
Find the middle node of a linked list in a single pass.
Show answer
Two objects hold shared_ptr references to each other and their memory is never released. Why, and how do you fix it?
Show answer
Write an efficient function to check whether a number is prime.
Show answer
What do compiler optimisation levels like -O0, -O2, -O3 and -Os mean?
Show answer
Four threads each increment a shared int one million times, but the final total is less than four million. Why?
Show answer
What is the difference between a process and a thread?
Show answer
Write a generic function template that returns the larger of two values.
Show answer
What is pointer arithmetic?
Show answer
Explain std::async, std::future and std::promise.
Show answer
After calling std::move on a string, a teammate prints it and sees an empty value. Is this a bug?
Show answer
Write a function to reverse a string in place without using std::reverse.
Show answer
What are default arguments and what rules apply to them?
Show answer
When are std::vector iterators invalidated?
Show answer
What is the difference between push_back and emplace_back?
Show answer
Write a lookup function that uses std::optional instead of returning -1 or a null pointer.
Show answer
What is the difference between a static library and a dynamic library?
Show answer
What is the difference between an inline function and a macro?
Show answer
How do virtual functions work internally?
Show answer
What is function overloading and how does the compiler choose an overload?
Show answer
What are header guards and #pragma once?
Show answer
Design a class structure for UPI, card and net banking payments in a checkout system.
Show answer
What is the difference between stack and heap memory?
Show answer
How do you create a thread in C++ and what is the difference between join and detach?
Show answer
Compare std::vector, std::list and std::deque.
Show answer
Frequently asked questions
What happens in the C++ online assessment round?
Most companies start with an online test: aptitude and reasoning, a few MCQs on core C++ concepts, and one or two short hands-on tasks. It filters a large number of applicants, so speed and accuracy both count.
How do I clear the online assessment round?
Practise under a timer: about one minute per MCQ and 15-20 minutes per hands-on task. Read every option before answering; tests often include two nearly correct choices. Use a stable internet connection, keep your camera on and avoid switching tabs in proctored tests.
Which round comes next?
A typical order is online assessment, telephonic screening, one or two technical rounds, a managerial round and HR. Use the other round pages to practise each stage.