NumPy Advanced Quiz
Master vectorization, memory optimization, structured arrays, advanced techniques, and performance
Start the quizSample questions from this quiz
A preview of the style and depth. Try each one, then reveal the answer — or skip straight to the timed quiz.
1. What is vectorization?
- Optimization technique
- Replacing loops with array operations
- Parallel processing
- Fast computation
Show answer
Answer: Replacing loops with array operations. Vectorization replaces explicit loops with array operations. Leverages optimized C code. Much faster than Python loops. Core NumPy optimization strategy.
2. What is memory layout (C vs F order)?
- C-contiguous (row-major) vs F-contiguous (column-major)
- Layout format
- Memory ordering
- Storage pattern
Show answer
Answer: C-contiguous (row-major) vs F-contiguous (column-major). C-order (row-major): last axis changes fastest. F-order (column-major, Fortran): first axis changes fastest. Affects performance. Check with arr.flags.
3. What is np.stride_tricks?
- Manipulates array strides for custom views
- Stride manipulation
- View creator
- Memory tricks
Show answer
Answer: Manipulates array strides for custom views. np.lib.stride_tricks allows custom stride manipulation. Create views without copying data. Powerful but dangerous - easy to create invalid memory access.
Frequently asked questions
How many questions are in this NumPy quiz?+
30 questions, with a 75-minute time limit. Every question includes a written explanation of the correct answer.
Is this NumPy quiz free?+
Yes. Every quiz on CodexQuizz is free and needs no account. You only enter a name if you choose to post your score to the leaderboard.
What level is the advanced quiz aimed at?+
Master vectorization, memory optimization, structured arrays, advanced techniques, and performance
Can I use this to prepare for a NumPy interview?+
Yes. The questions cover the topics that come up in NumPy technical screens, and the explanations are written so that a wrong answer still teaches you the underlying concept.
Ready to test your NumPy?
30 questions, 75 minutes. Free, no sign-up.
Start now