C & C++ questions and answers
Pointers, memory, templates and the standard library. Page 9 of 9.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Answers 481-516
- Where and why do I have to put the "template" and "typename" keywords?
- Where can I get a useful C binary search algorithm?
- which design considerations justify stdmake_heap to be apparently sub-optimal?
- Which io_context does stdboostasiopost / dispatch use?
- Which sorting algorithm is used by STL's listsort?
- Which x86 C compilers are multithreaded by itself?
- Why are heaps in c implemented as algorithms instead of containers?
- Why aren't stdalgorithms constexpr and which could be?
- Why C is not allowing non-member functions like C
- Why can't I remove a string from a stdset with stdremove_if?
- Why copy_n, fill_n and generate_n?
- Why do I have to always specify the range in STL''s algorithm functions explicitly, even if I want to work on the whole container?
- Why do we need to add a '0' null at the end of a character array in C?
- Why do we need virtual functions in C++?
- Why does boostequals require ranges to be copyable?
- Why does C++ code for testing the Collatz conjecture run faster than hand-written assembly?
- Why does stdcopy_n not increment the Input iterator n times?
- Why does stderase_if with a mutable predicate function have different behavior for older compilers?
- Why does stdnth_element return sorted vectors for input vectors with N 33 elements?
- Why does stdsleep_forstdchronohoursmax return immediately on linux?
- Why doesn't Boost.Range is_sorted require forward iterators?
- Why Eigen is 5x slower than ublas on following example?
- why homemade binary search algorithm is slower than stdbinary_search?
- Why increase pointer by two while finding loop in linked list, why not 3,4,5?
- Why is reading lines from stdin much slower in C than Python?
- Why is stdrotate so fast?
- Why is swap sometimes implemented by passing an array?
- Why is the operator not allowed with OpenMP?
- Why is volatile not considered useful in multithreaded C or C programming?
- Why should C++ programmers minimize use of 'new'?
- Why there is no stdcopy_if algorithm?
- Why use static_cast<T>(x) instead of (T)x?
- Why will stdsort crash if the comparison function is not as operator ?
- Windows threading _beginthread vs _beginthreadex vs CreateThread C
- Write applications in C or C for Android?
- WriteFile blocks writing from C client to C server via named pipe
.png&w=3840&q=75)
Free course
Beginner
7 lessons
2 hours
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free course