coding interview preparation coursera week 2 quiz answers
Knowledge check: Basic data structures
1. What does it mean to say a Data Structure is a first-class object?
- This means that a data structure can be passed to a function, returned as a result and generally treated like any other variable.
- They are not memory intensive.
- It is very quick at retrieving and storing data.
2. What does it mean to parse a string?
- To pass it to the compiler to execute instructions.
- To remove symbols and uppercases from a string of text.
- To remove items from a string not based on a given format.
5. Is it possible to copy an array?
- No.
- Yes, but only through making a deep-copy.
- Yes, but only through making a shallow-copy.
Knowledge check: Collection data structures
6. You wish to store a list of grades for a class. Given the choice between a set and a list, which is the more appropriate data structure?
- List
- Set
- Either would do
7. In relation to data structures what does mutability mean?
- It means that it can be changed after it has been created.
- It means that once an object is created it cannot be changed.
- It relates to dynamic programming languages, and it can be passed as a variable to a function.
Shuffle Q/A 1
9. Creating a class through the use of a capital T as below:
Stack, is an example of what?
- Generics
- Immutability
- Encapsulation