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 programs does not return a value
B) When the program generates the wrong output
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) Phishing Attack
B) Buffer Overflow Attack
C) Cross Site Scripting Attack
D) SQL Injection Attack
  • 3. In a buffer overflow attack…
A) The program doesn’t return a value
B) The input takes more space than allocated
C) The program doesn’t compile
D) The program generates the wrong input
  • 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 leave helpful comments
B) Someone can inject code directly into your system
C) Someone can add code to your program
D) Someone can fix your code
  • 6. In a buffer overflow attack, the input takes _____ ______ than allocated for the variable.
A) int and strings
B) real numbers
C) double numbers
D) more space
  • 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) Source Code
B) A variable that you didn’t declare
C) Programs do not return a value
D) A variable that ends with a semicolon
  • 9. What is PC-Lint?
A) An IDE
B) An Source Code Tool
C) A Static Analysis Tool for C/C++
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 commands 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 Overrun
B) Buffer Overkill
C) Buffer Overdraft
D) Buffer Over the Top
  • 12. Buffer overflow can be triggered by what?
A) Memory
B) Outputs
C) Inputs
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) C#
B) Java
C) .Net
D) C++
  • 15. A Do While loop is useful for…
A) 1 choice
B) to loop once
C) reversed
D) multiple choices
  • 16. What accounts for most security breaches?
A) Buffer Overflow
B) Virus
C) SQL Injections
D) Inheritance
  • 17. To avoid buffer overflow you should avoid what?
A) spinf() and typdef()
B) strcpy() and strcat()
C) stmcpy() and smcatt()
D) vscanf() and stmcat()
  • 18. Which of these are not types of Buffer Overflow?
A) Format String
B) Stack Overflow
C) Buffer Overturn
D) Heap Overflow
  • 19. What is the only function all C++ programs must contain?
A) start()
B) program()
C) system()
D) main()
  • 20. What punctuation ends most lines of C++ code?
A) :(colon)
B) ‘(single quote)
C) ;(semi-colon)
D) .(dot)
Created with That Quiz — the site for test creation and grading in math and other subjects.