troubleshooting and debugging techniques week 2
Practice Quiz: Understanding Slowness
1. Which of the following will an application spend the longest time retrieving data from?
- CPU L2 cache
- RAM
- Disk
- The network
2. Which tool can you use to verify reports of 'slowness' for web pages served by a web server you manage?
- The top tool
- The ab tool
- The nice tool
- The pidof tool
3. If our computer running Microsoft Windows is running slow, what performance monitoring tools can we use to analyze our system resource usage to identify the bottleneck? (Check all that apply)
- Performance Monitor
- Resource Monitor
- Activity Monitor
- top
4. Which of the following programs is likely to run faster and more efficiently, with the least slowdown?
- A program with a cache stored on a hard drive
- A program small enough to fit in RAM
- A program that reads files from an optical disc
- A program that retrieves most of its data from the Internet
5. What might cause a single application to slow down an entire system? (Check all that apply)
- A memory leak
- The application relies on a slow network connection
- Handling files that have grown too large
- Hardware faults
6. Which of the following is NOT considered an expensive operation?
- Parsing a file
- Downloading data over the network
- Going through a list
- Using a dictionary
7. Which of the following may be the most expensive to carry out in most automation tasks in a script?
- Loops
- Lists
- Vector
- Hash
8. Which of the following statements represents the most sound advice when writing scripts?
- Aim for every speed advantage you can get in your code
- Use expensive operations often
- Start by writing clear code, then speed it up only if necessary
- Use loops as often as possible
9. In Python, what is a data structure that stores multiple pieces of data, in order, which can be changed later?
- A hash
- Dictionaries
- Lists
- Tuples
10. What command, keyword, module, or tool can be used to measure the amount of time it takes for an operation or program to execute? (Check all that apply)
- time
- kcachegrind
- cProfile
- break
11. Which of the following can cache database queries in memory for faster processing of automated tasks?
- Threading
- Varnish
- Memcached
- SQLite
12. What module specifies parts of a code to run in separate asynchronous events?
- Threading
- Futures
- Asyncio
- Concurrent
13. Which of the following allows our program to run multiple instructions in parallel?
- Threading
- Swap space
- Memory addressing
- Dual SSD
14. What is the name of the field of study in computer science that concerns itself with writing programs and operations that run in parallel efficiently?
- Memory management
- Concurrency
- Threading
- Performance analysis
15. What would we call a program that often leaves our CPU with little to do as it waits on data from a local disk and the Internet?
- Memory-bound
- CPU-bound
- User-bound
- I/O bound