
GIAC Foundational Cybersecurity Technologies
Domain 4Objective 1
Logic & Programming GFACT Practice Questions (Page 7)
Part of the Programming and Logic domain, which makes up ~12% of our current practice bank. GIAC (SANS) does not publish an official question count, but from its 120-minute exam (~50–80 total, ~6–10 in this domain), expect 6–10 from this objective — we provide 40 practice questions to prepare you well beyond it. (estimate)
40questions here
8free pages
6concepts
Questions 31–35
- 31
A script has the following code: x = 1; def increment(): x = x + 1; increment(); print(x). The script prints 1 instead of 2. What is the most likely cause?
Select an answer first - 32
A C developer is writing a program that allocates memory for a structure, uses it, and then frees it. The program runs correctly most of the time but occasionally crashes. The code uses `malloc()` and `free()`. Which of the following is the most likely cause of the intermittent crash?
Select an answer first - 33
A developer is writing a Python script to validate user input. The script should accept a string if it is not empty and its length is less than 10. The developer writes: if len(user_input) < 10 and user_input != '':. This works, but the developer wants to avoid a potential error if user_input is None. Which condition is the safest?
Select an answer first - 34
A developer is writing a Python script that reads a CSV file and sums the values in the second column. The code is: `total = 0; with open('data.csv') as f: for line in f: parts = line.split(','); total += int(parts[1])`. The script raises a `ValueError` on the first line. What is the most likely cause?
Select an answer first - 35
Which type of error occurs when a program attempts to divide by zero during execution?
Select an answer first
Finished these 5 questions?
Review the revealed explanations, or continue through the curriculum.
Free Basic Practice is a study aid with revealable answers — not a scored exam. Examers.io is independent and not affiliated with or endorsed by GIAC (SANS). “GFACT” is a trademark of its owner, used for identification only.