Python Algorithms & Security Scripting Quiz

8 questions · 70% to pass

1. What is the worst-case time complexity of linear search on a list of n items?

2. Binary search requires the list to be sorted. Why?

3. Python's sorted() function implements Bubble Sort under the hood.

4. You need to sort a list of 10,000 security alerts by CVSS score and you need stable sort (equal scores keep their original order). Which approach should you use?

5. In Python, what does subprocess.run(['sysctl', '-n', 'kernel.randomize_va_space'], capture_output=True, text=True) do?

6. What does oct(Path('/etc/shadow').stat().st_mode)[-3:] return?

7. In the arc-sec-audit OOP structure, what is the role of the base Auditor class?

8. Merge Sort uses O(n) extra memory. Which algorithm is O(1) space (in-place) and still runs in O(n log n)?

Back to Chapter