Practice Quiz: Code that Crashes

6. Which of the following will let code run until a certain line of code is executed?

  • Breakpoints
  • Watchpoints
  • Backtrace
  • Pointers

7. Which of the following is NOT likely to cause a segmentation fault?

  • Wild pointers
  • Reading past the end of an array
  • Stack overflow
  • RAM replacement

8. A common error worth keeping in mind happens often when iterating through arrays or other collections, and is often fixed by changing the less than or equal sign in our for loop to be a strictly less than sign. What is this common error known as?

  • Segmentation fault
  • backtrace
  • The No such file or directory error
  • Off-by-one error

9. A very common method of debugging is to add print statements to our code that display information, such as contents of variables, custom error statements, or return values of functions. What is this type of debugging called?

  • Backtracking
  • Log review
  • Printf debugging
  • Assertion debugging

10. When a process crashes, the operating system may generate a file containing information about the state of the process in memory to help the developer debug the program later. What are these files called?

  • Log files
  • Core files
  • Metadata file
  • Cache file

Devendra Kumar

Project Management Apprentice at Google

Leave a Reply