Array Basics: 16 MCQs

All 16 multiple-choice questions from this kit, free and with no sign-up.

Warm-up · 10 questions

Q1. What is an array?

Beginner
A A dynamic list that can grow or shrink in size
B A collection of elements of different data types
C A collection of elements of the same data type stored in contiguous memory locations
D A key-value pair data structure

Answers and explanations are in the Veda app.

Q2. How is an element accessed in an array?

Beginner
A By its index
B By its key
C By its value
D By its memory address

Answers and explanations are in the Veda app.

Q3. Which of the following is a disadvantage of arrays?

Beginner
A They allow random access
B They use contiguous memory
C They have a fixed size
D They store elements of the same type

Answers and explanations are in the Veda app.

Q4. What is a multidimensional array?

Beginner
A An array with only one dimension
B An array that can store multiple data types
C An array that can grow dynamically
D An array of arrays

Answers and explanations are in the Veda app.

Q5. What is the space complexity of an array of size $n$?

Beginner
A $O(\log n)$
B $O(1)$
C $O(n^2)$
D $O(n)$

Answers and explanations are in the Veda app.

Q6. What is the index of the first element in most programming languages?

Beginner
A 1
B Depends on the language
C -1
D 0

Answers and explanations are in the Veda app.

Q7. What happens if you try to access an array element with an index out of bounds?

Beginner
A The array automatically resizes
B The element is set to null
C The index is wrapped around
D The program may crash or produce undefined behavior

Answers and explanations are in the Veda app.

Q8. Which of the following is true about arrays?

Beginner
A Arrays cannot be used to implement other data structures
B Arrays are always dynamically sized
C Arrays can store elements of different data types
D Arrays provide constant-time access to elements by index

Answers and explanations are in the Veda app.

Q9. Arrays can store elements of different data types.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q10. The size of an array can be changed after it is created.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Building up · 6 questions

Q11. What is the time complexity to access an element in an array by index?

Intermediate
A $O(n)$
B $O(1)$
C $O(\log n)$
D $O(n^2)$

Answers and explanations are in the Veda app.

Q12. What is the time complexity to insert an element at the beginning of an array of size $n$?

Intermediate
A $O(n)$
B $O(n^2)$
C $O(1)$
D $O(\log n)$

Answers and explanations are in the Veda app.

Q13. What is the time complexity to delete an element from the end of an array of size $n$?

Intermediate
A $O(n)$
B $O(1)$
C $O(\log n)$
D $O(n^2)$

Answers and explanations are in the Veda app.

Q14. What is the time complexity to search for an element in an unsorted array of size $n$?

Intermediate
A $O(1)$
B $O(n)$
C $O(n^2)$
D $O(\log n)$

Answers and explanations are in the Veda app.

Q15. What is the time complexity to search for an element in a sorted array using binary search?

Intermediate
A $O(n^2)$
B $O(\log n)$
C $O(n)$
D $O(1)$

Answers and explanations are in the Veda app.

Q16. Which operation is NOT typically supported efficiently by a static array?

Intermediate
A Accessing an element by index
B Updating an element by index
C Inserting an element at an arbitrary position
D Traversing all elements

Answers and explanations are in the Veda app.

Make your own

Your notes can be a kit like these

Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free to start, in more than 40 languages.

  • Chapter notes
  • Flashcards
  • Practice MCQs
  • Scored tests
  • Paper Solver

Get Veda free See what students get

Free to start · Android app and web · More than 40 languages