CJCoding With Joseph
15per day
TitleAction
1
Output OperatorWhich operator is used for console output in C++?...
easy○ Not StartedPrintingSolve
3
Vector SizeWhat is the output of this code?...
easy○ Not StartedArraysSolve
5
Scope ResolutionWhat is the `::` operator called in C++?...
easy○ Not StartedFunctionsSolve
6
Pointer BasicsWhich operator is used to get the memory address of a variable in C++?...
easy○ Not StartedPointersSolve
9
For Loop CountWhat is the output of this code?...
easy○ Not StartedLoopsSolve
10
String LengthWhat is the output of this code?...
easy○ Not StartedStringsSolve
12
Ternary OperatorWhat is the output of this code?...
easy○ Not StartedConditionalsSolve
13
Array Index OutputWhat is the output of this code?...
easy○ Not StartedArraysSolve
14
While Loop ConditionWhat is the output of this code?...
easy○ Not StartedLoopsSolve
16
Null PointerWhat keyword is used in modern C++ (C++11 and later) to represent a null pointer...
easy○ Not StartedPointersSolve
19
String ConcatenationWhat is the output of this code?...
easy○ Not StartedStringsSolve
21
Unfreed Heap MemoryThis code compiles and runs, but it has a problem. What is the issue?...
easy○ Not StartedDynamic MemorySolve
22
Delete on Stack VariableThis code has a bug that causes undefined behavior. What is the issue?...
easy○ Not StartedDynamic MemorySolve
23
Dangling Pointer AccessThis code compiles but has a serious bug. What is the issue?...
easy○ Not StartedDynamic MemorySolve
24
Private Member in Base ClassThis code fails to compile. What is the issue?...
easy○ Not StartedInheritanceSolve
25
Default Private InheritanceThis code fails to compile at the indicated line. What is the issue?...
easy○ Not StartedInheritanceSolve
26
Missing Base Constructor CallThis code fails to compile. What is the issue?...
easy○ Not StartedInheritanceSolve
27
Non-Virtual Method CallThe programmer expects this code to print `"Dog speaks"`, but it prints `"Animal...
easy○ Not StartedPolymorphismSolve
28
Cannot Create Abstract ObjectThis code fails to compile. What is the issue?...
easy○ Not StartedPolymorphismSolve
29
Missing DestructorThis code compiles and runs, but it has a problem. What is the issue?...
easy○ Not StartedRule of ThreeSolve
30
Default Copy Double FreeThis code compiles but crashes at runtime. What is the issue?...
easy○ Not StartedRule of ThreeSolve
41
Exception Handling KeywordsWhich three keywords are used for exception handling in C++?...
easy○ Not StartedExceptionsSolve
42
Code After throw Is SkippedWhat is the output of this code?...
easy○ Not StartedExceptionsSolve
43
Exception Header FileWhich header must you include to use `std::runtime_error` and `std::invalid_argu...
easy○ Not StartedExceptionsSolve
44
Catch-All HandlerWhat does `catch (...)` do in a C++ exception handler?...
easy○ Not StartedExceptionsSolve
51
Template Type Parameter MeaningWhat does `T` represent in the following code? ```cpp template <typename T> voi...
easy○ Not StartedTemplatesSolve
52
Template Class InstantiationWhich line correctly creates a `Box<int>` object given this template class? ```...
easy○ Not StartedTemplatesSolve
53
Valid Template Function SignatureWhich of the following is a valid C++ template function that returns the larger ...
easy○ Not StartedTemplatesSolve
54
Template Function OutputWhat is the output of the following program? ```cpp #include <iostream> using n...
easy○ Not StartedTemplatesSolve
59
What Is a Stream?Which of the following best describes a "stream" in C++?...
easy○ Not StartedStreamsSolve
60
Input Stream ClassesWhich class should you use to read input from a file in C++?...
easy○ Not StartedStreamsSolve
61
Output Stream ClassesWhich class is used to write output to a file in C++?...
easy○ Not StartedStreamsSolve
62
Extraction Operator vs getlineWhat is a key difference between the extraction operator `>>` and `getline()` wh...
easy○ Not StartedStreamsSolve
63
The get() FunctionWhat makes `cin.get()` different from the extraction operator `cin >>`?...
easy○ Not StartedStreamsSolve
64
setw ManipulatorWhat does `setw(10)` do when used with `cout`? ```cpp cout << setw(10) << 42; `...
easy○ Not StartedStreamsSolve
66
setprecision with fixedWhat is the output of the following code? ```cpp #include <iostream> #include <...
easy○ Not StartedStreamsSolve
67
The ws ManipulatorWhat does the `ws` manipulator do when used with an input stream? ```cpp getlin...
easy○ Not StartedStreamsSolve
68
Stream Condition State: eof()Which of the following stream condition functions returns `true` when the stream...
easy○ Not StartedStreamsSolve
71
peek() vs unget()What does `cin.peek()` do?...
easy○ Not StartedStreamsSolve
72
Testing If a File Opened SuccessfullyAfter opening a file, which code correctly checks whether the file stream opened...
easy○ Not StartedStreamsSolve
73
Function Declaration vs DefinitionWhat is a function declaration (prototype) in C++?...
easy○ Not StartedFunctionsSolve
76
What Is a C-String?Which of the following correctly describes a C-string in C++?...
easy○ Not StartedStringsSolve
77
Character Classification FunctionsWhich function from `<cctype>` returns true if a character is a letter of the al...
easy○ Not StartedStringsSolve
79
find Returns nposWhat does `s.find("xyz")` return when `"xyz"` is not found in the string `s`?...
easy○ Not StartedStringsSolve
81
What Is std::string?Which description best fits std::string in C++?...
easy○ Not StartedSTL ContainersSolve
82
String Iterator Type and AccessWhich statement about std::string iteration and element access is correct?...
easy○ Not StartedSTL ContainersSolve
83
What Type Does std::string Store?What element type does std::string store, and can it store arbitrary types like ...
easy○ Not StartedSTL ContainersSolve
84
What Is std::vector?Which description best fits std::vector<T>?...
easy○ Not StartedSTL ContainersSolve
86
Vector Iterator TypeWhat category of iterator does std::vector provide, and what operations does it ...
easy○ Not StartedSTL ContainersSolve
88
Deque vs Vector: Key AdvantageWhat does std::deque offer that std::vector does not?...
easy○ Not StartedSTL ContainersSolve
89
Deque Subscript and Random AccessDoes std::deque support the subscript operator [] and random access iterators?...
easy○ Not StartedSTL ContainersSolve
90
How std::list Stores ElementsHow does std::list<T> store its elements in memory?...
easy○ Not StartedSTL ContainersSolve
92
Does std::list Support []?Can you use the subscript operator [] to access elements in std::list? Why or wh...
easy○ Not StartedSTL ContainersSolve
94
What Makes std::set Unique?Which two properties always hold for std::set<T>?...
easy○ Not StartedSTL ContainersSolve
95
Accessing Elements in std::setHow do you check whether a value exists in a std::set, and why is the [] operato...
easy○ Not StartedSTL ContainersSolve
97
Does std::set Store Pairs?Does std::set store pair objects, or does each element hold a single value?...
easy○ Not StartedSTL ContainersSolve
98
What Is std::map?Which description best fits std::map<Key, Value>?...
easy○ Not StartedSTL ContainersSolve
101
Map Sorted by KeyIn what order does iterating over a std::map visit its entries?...
easy○ Not StartedSTL ContainersSolve
104
Which Containers Auto-Sort?Which STL containers automatically maintain their elements in sorted order at al...
easy○ Not StartedSTL ContainersSolve
106
Read-Only IteratorsWhich iterator type provides read-only access and prevents modification of conta...
easy○ Not StartedSTL ContainersSolve
107
Iterator Dereference OperatorWhich operator is used to access the element that an STL iterator currently poin...
easy○ Not StartedSTL ContainersSolve
108
Which Containers Store Unique Values?Which STL containers automatically reject duplicate values or keys?...
easy○ Not StartedSTL ContainersSolve
109
Do STL Containers Auto-Resize?Which statement about memory management in standard STL containers is correct?...
easy○ Not StartedSTL ContainersSolve
2
Reference vs CopyWhat is the output of this code?...
medium○ Not StartedVariablesSolve
4
Class ConstructorWhat is the output of this code?...
medium○ Not StartedClassesSolve
7
Pointer Dereference OutputWhat is the output of this code?...
medium○ Not StartedPointersSolve
8
Inheritance AccessWhich access specifier allows a derived class to access a member, but keeps it h...
medium○ Not StartedClassesSolve
11
Default Function ArgumentWhat is the output of this code?...
medium○ Not StartedFunctionsSolve
15
Function OverloadingWhat is the output of this code?...
medium○ Not StartedFunctionsSolve
17
Increment OperatorsWhat is the output of this code?...
medium○ Not StartedVariablesSolve
31
Wrong Delete on ArrayThis code has a subtle bug. What is the issue?...
medium○ Not StartedDynamic MemorySolve
32
Pointer to Local VariableThis code compiles with a warning but produces unpredictable output. What is the...
medium○ Not StartedDynamic MemorySolve
33
Missing Assignment OperatorThis class has a destructor and copy constructor, but the code still crashes. Wh...
medium○ Not StartedRule of ThreeSolve
34
Shallow Copy BugThis code crashes when the objects are destroyed. What is the bug in the copy co...
medium○ Not StartedRule of ThreeSolve
35
Rule of Three ViolationThis class manages dynamic memory. Which rule does it violate and what could go ...
medium○ Not StartedRule of ThreeSolve
36
Object SlicingThe programmer expects this to print `"Cat meows"`, but it prints `"Animal speak...
medium○ Not StartedPolymorphismSolve
37
Non-Virtual Destructor LeakThis code has a subtle bug when `delete base` runs. What is the issue?...
medium○ Not StartedPolymorphismSolve
38
Method Hiding in Derived ClassThis code fails to compile on the marked lines. What is the issue?...
medium○ Not StartedInheritanceSolve
39
Diamond Inheritance AmbiguityThis code fails to compile. What is the issue?...
medium○ Not StartedInheritanceSolve
40
Accidental Method Signature MismatchThe programmer expects this to print `"Derived: 42"`, but it prints `"Base: 42"`...
medium○ Not StartedPolymorphismSolve
45
The noexcept SpecifierWhat does the `noexcept` specifier do when added to a function declaration in C+...
medium○ Not StartedExceptionsSolve
46
Catch Block OrderingThis code has a problem related to the order of catch blocks. What is the issue?...
medium○ Not StartedExceptionsSolve
47
Catch by Value Causes SlicingWhat is the output of this code?...
medium○ Not StartedExceptionsSolve
48
Bare throw RethrowsWhat is the output of this code?...
medium○ Not StartedExceptionsSolve
49
Exception Thrown in ConstructorWhat is the output of this code?...
medium○ Not StartedExceptionsSolve
50
Unhandled Exception BehaviorWhat happens when a C++ program throws an exception that is never caught by any ...
medium○ Not StartedExceptionsSolve
55
Template Type DeductionWhat is the output of this code? ```cpp #include <iostream> using namespace std...
medium○ Not StartedTemplatesSolve
56
Two-Type Template Class OutputWhat is the output of this code? ```cpp #include <iostream> #include <string> u...
medium○ Not StartedTemplatesSolve
57
Template with Two Type ArgumentsWhat is the output of the following program? ```cpp #include <iostream> #includ...
medium○ Not StartedTemplatesSolve
58
Template Instantiation FailureThe following code fails to compile at the call site. Why? ```cpp #include <ios...
medium○ Not StartedTemplatesSolve
65
setfill OutputWhat is the output of the following code? ```cpp #include <iostream> #include <...
medium○ Not StartedStreamsSolve
69
seekg and tellgAn `ifstream` has an internal get position tracking the next character to read. ...
medium○ Not StartedStreamsSolve
70
Stream Go TestWhich loop is the correct idiomatic "go test" for reading integers from a stream...
medium○ Not StartedStreamsSolve
74
const Reference ParameterWhy would you declare a function parameter as `const string&` rather than just `...
medium○ Not StartedFunctionsSolve
75
Base Class as Function ParameterWhat is the advantage of writing a function with a base class reference paramete...
medium○ Not StartedFunctionsSolve
78
substr ParametersWhat does `s.substr(2, 4)` return when `s = "Hello World"`?...
medium○ Not StartedStringsSolve
80
stoi Stops at Non-DigitWhat does `stoi("42abc")` return in C++?...
medium○ Not StartedStringsSolve
85
Vector Insertion PerformanceWhich insertion operation on std::vector runs in O(1) amortized time, and why is...
medium○ Not StartedSTL ContainersSolve
87
How Deque Stores ElementsHow does std::deque store its elements internally, and how does this differ from...
medium○ Not StartedSTL ContainersSolve
91
List Iterator TypeWhat type of iterator does std::list provide, and what limitation does this crea...
medium○ Not StartedSTL ContainersSolve
93
List Insertion SpeedWhat is the time complexity of inserting an element into the middle of a std::li...
medium○ Not StartedSTL ContainersSolve
96
Set Iterator Type and Read-Only AccessWhat type of iterator does std::set provide, and can you modify elements through...
medium○ Not StartedSTL ContainersSolve
99
Map Subscript Operator BehaviorWhat does map[key] do if the key does not already exist in the map?...
medium○ Not StartedSTL ContainersSolve
100
Map Iterator Dereference TypeWhen you dereference a std::map<string, int> iterator, what type do you get?...
medium○ Not StartedSTL ContainersSolve
102
Inserting a Duplicate Key in std::mapWhat happens when you call map.insert({"age", 30}) and the key "age" already exi...
medium○ Not StartedSTL ContainersSolve
103
Which Containers Use Contiguous Memory?Which standard STL containers guarantee that all elements are stored in a single...
medium○ Not StartedSTL ContainersSolve
105
Which Containers Support Random Access Iterators?Which STL containers provide random access iterators that support +n and -n arit...
medium○ Not StartedSTL ContainersSolve
18
Virtual Function ConceptWhat is the purpose of the `virtual` keyword when used on a method in a base cla...
hard○ Not StartedClassesSolve
20
Static Class MemberWhat is the output of this code?...
hard○ Not StartedClassesSolve