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