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