This quiz aims at testing your basic knowledge of values and variables. Don’t forget to push your answers to your remote repository by the end of quiz time. Push all your answers to quiz/2/ folder in your Github project.
-
Name three different levels of the computer memory.
Answer: Register (L1 Cache), L2 Cache, L3 Cache, RAM (Random-Access Memory), HDD (Hard Drive Disk).
-
Suppose that you have a matrix of rank 2 to store in the computer memory. How would each one of the following languages store this matrix (column-wise vs. row-wise):
b) C
a) Fortran
c) MATLAB
d) PythonAnswer:
a) row-wise
b) column-wise
c) column-wise
d) row-wise -
What are the three fundamental components of a Turing-complete language?
Answer:
- a way for accessing the memory
- a way for iteration
- a way for branching
-
What are the three common types of errors in computer programs?
Answer:
- syntax errors
- runtime errors
- semantic errors
-
Suppose you write a program that has memory leak. What type of programming error you dealing with?
Answer: runtime error
-
What is the biggest integer (in base 10) that you could store in an
int32
type?Answer: 2,147,483,647
-
What is the difference between
int16
anduint64
types (two major differences is enough)?Answer:
1)int16
is only 16 bits storage, whereasuint64
is 64 bits storage.
2)int16
is a signed integer storage meaning that one bit is reserved for the integer’s sign representation, whereasuint64
can only represent positive integers.