Arrays & Memory Layout MCQs

6 MCQs  — Data Types MCQs

Practice Arrays & Memory Layout MCQs with correct answers and explanations. These questions are from the Data Types MCQs section.

In which order does C/C++ store multidimensional arrays?
Row-major order
Random order
Column-major order
Implementation-defined
Is int n; cin >> n; int a[n]; standard C++?
Only when n is less than 100
Yes, since C++11
Yes, always
No; variable-length arrays are not part of standard C++ (some compilers accept them as an extension)
How is a Python list implemented in CPython?
As a hash table
As a singly linked list
As a dynamic array of references, with amortized O(1) append
As a balanced tree