Engineering C++ - Quiz
  • 1. When is buffer overflow possible to have in your C++ code?
A) When the program generates the wrong output
B) When the programs does not return a value
C) When the program doesn’t compile
D) When the length of some input data is not correctly checked
  • 2. An attacker enters a long string into the date field. The input overwrites parts of the running program and executes commands on the server. What type of attack just took place?
A) Buffer Overflow Attack
B) SQL Injection Attack
C) Cross Site Scripting Attack
D) Phishing Attack
  • 3. In a buffer overflow attack…
A) The program generates the wrong input
B) The program doesn’t compile
C) The program doesn’t return a value
D) The input takes more space than allocated
  • 4. How do you avoid a buffer Overflow?
A) Use SQL script
B) Use functions that take a maximal length
C) Use PHP script
D) Use functions that take a lesser length
  • 5. If you don’t secure your code what can happen?
A) Someone can inject code directly into your system
B) Someone can fix your code
C) Someone can leave helpful comments
D) Someone can add code to your program
  • 6. In a buffer overflow attack, the input takes _____ ______ than allocated for the variable.
A) real numbers
B) more space
C) double numbers
D) int and strings
  • 7. Which of the following is the correct operator to compare two variables?
A) :=
B) =
C) equal
D) ==
  • 8. What is an undeclared variable?
A) Source Code
B) Programs do not return a value
C) A variable that ends with a semicolon
D) A variable that you didn’t declare
  • 9. What is PC-Lint?
A) A Static Analysis Tool for C/C++
B) A C/C++ Compiler
C) An Source Code Tool
D) An IDE
  • 10. When an input is carefully crafted, it lets the attacker do what?
A) Run new codes of his or her choice
B) Run new choices of his or her choice
C) Run commands of his or her choice
D) Run comments of his or her choice
  • 11. Which is another name for buffer overflow?
A) Buffer Overkill
B) Buffer Overrun
C) Buffer Overdraft
D) Buffer Over the Top
  • 12. Buffer overflow can be triggered by what?
A) Outputs
B) Inputs
C) Memory
D) Tags
  • 13. Which is not a type of Loop?
A) For
B) While
C) Do-While
D) If-Else
  • 14. PC-Lint is for what language?
A) .Net
B) C++
C) C#
D) Java
  • 15. A Do While loop is useful for…
A) to loop once
B) 1 choice
C) multiple choices
D) reversed
  • 16. What accounts for most security breaches?
A) SQL Injections
B) Buffer Overflow
C) Inheritance
D) Virus
  • 17. To avoid buffer overflow you should avoid what?
A) stmcpy() and smcatt()
B) strcpy() and strcat()
C) spinf() and typdef()
D) vscanf() and stmcat()
  • 18. Which of these are not types of Buffer Overflow?
A) Buffer Overturn
B) Heap Overflow
C) Format String
D) Stack Overflow
  • 19. What is the only function all C++ programs must contain?
A) main()
B) system()
C) program()
D) start()
  • 20. What punctuation ends most lines of C++ code?
A) ;(semi-colon)
B) .(dot)
C) :(colon)
D) ‘(single quote)
Created with That Quiz — the site for test creation and grading in math and other subjects.