Error Detection and Recovery

Basics of Error Detection What is the primary purpose of error detection? A) To detect and correct errors in programs B) To prevent bugs from occurring C) To detect errors in data transmission or storage D) To optimize program performance Answer: C) To detect errors in data transmission or storage Which of the following is a common error detection technique? A) Parity check B) Loop unrolling C) Pipeline scheduling D) Address mapping Answer: A) Parity check Which error detection method involves counting the number of 1s in a binary sequence? A) Parity check B) Checksum C) CRC (Cyclic Redundancy Check) D) Hamming code Answer: A) Parity check In a single parity bit error detection scheme, what happens when an odd number of errors occur? A) Errors are not detected B) Errors are corrected C) Errors are always detected D) Errors are ignored Answer: A) Errors are not detected Which type of error detection is commonly used in network communication protocols like Ethernet? A) Cyclic Redundancy Check (CRC) B) Parity bit C) Hamming code D) Gray code Answer: A) Cyclic Redundancy Check (CRC) Error Recovery Techniques What is the primary goal of error recovery? A) To restore a system to a correct state after an error B) To identify bugs in the system C) To stop a program after an error occurs D) To minimize the system performance overhead Answer: A) To restore a system to a correct state after an error Which of the following is an error recovery strategy used in parsers? A) Panic mode B) Deadlock avoidance C) Paging D) Pipelining Answer: A) Panic mode Which error recovery technique discards input symbols until a synchronizing token is found? A) Panic mode recovery B) Backtracking C) Forward recovery D) Checkpointing Answer: A) Panic mode recovery What is backtracking in error recovery? A) Reverting to a previous correct state to attempt recovery B) Randomly generating solutions C) Scanning the code for logical errors D) Moving forward without considering the error Answer: A) Reverting to a previous correct state to attempt recovery Which of the following is NOT an error recovery technique in parsers? A) Error correction B) Panic mode recovery C) Forward error correction D) Phrase-level recovery Answer: C) Forward error correction Parity, Checksums, and CRC How does a parity bit work in error detection? A) By checking the number of set bits (1s) in the data B) By correcting all single-bit errors C) By comparing two copies of data D) By counting the number of bytes Answer: A) By checking the number of set bits (1s) in the data Which type of parity is used when the number of 1s should be odd? A) Odd parity B) Even parity C) Dynamic parity D) Continuous parity Answer: A) Odd parity A Cyclic Redundancy Check (CRC) is used to detect errors in which type of system? A) Data communication B) Video processing C) Graphics rendering D) Audio playback Answer: A) Data communication Which of the following is true about checksums? A) They can detect burst errors B) They are primarily used for detecting hardware failures C) They ensure both error detection and correction D) They use cryptographic algorithms Answer: A) They can detect burst errors Which of the following best describes CRC (Cyclic Redundancy Check)? A) A polynomial-based error detection scheme B) A bitwise inversion technique C) An encryption algorithm D) A hardware optimization technique Answer: A) A polynomial-based error detection scheme Error Correction Which method is used to both detect and correct errors? A) Hamming code B) Parity bit C) CRC D) Checksum Answer: A) Hamming code What does the Hamming code correct? A) Single-bit errors B) Two-bit errors C) Burst errors D) All types of errors Answer: A) Single-bit errors In Hamming code, how many parity bits are needed to detect and correct a single error in 7 data bits? A) 4 B) 3 C) 2 D) 1 Answer: A) 4 Which error correction technique is commonly used in memory systems? A) ECC (Error Correction Code) B) CRC (Cyclic Redundancy Check) C) Parity check D) Checksum Answer: A) ECC (Error Correction Code) Hamming distance is used to measure what? A) The minimum number of changes required to correct an error B) The distance between two points in memory C) The execution speed of a program D) The size of data Answer: A) The minimum number of changes required to correct an error Error Detection in Compilers What is a common method for detecting syntax errors in a compiler? A) Using a parser B) Using a tokenizer C) Using a garbage collector D) Using a scheduler Answer: A) Using a parser Which phase of the compiler is responsible for error detection related to semantics? A) Semantic analysis phase B) Lexical analysis phase C) Code generation phase D) Syntax analysis phase Answer: A) Semantic analysis phase Which error detection strategy is used to check for undefined variables in a program? A) Static analysis B) Dynamic analysis C) Memory optimization D) Instruction scheduling Answer: A) Static analysis Which error recovery method skips tokens until a synchronizing token is found in parsing? A) Panic mode B) Backtracking C) Correction mode D) Recursive descent Answer: A) Panic mode What type of error does the lexical analysis phase of a compiler typically detect? A) Invalid tokens or symbols B) Memory allocation issues C) Logic errors D) Stack overflow errors Answer: A) Invalid tokens or symbols Error Recovery in Parsing Which parser error recovery method uses insertions, deletions, and replacements of symbols to fix errors? A) Phrase-level recovery B) Panic mode C) Predictive parsing D) Bottom-up parsing Answer: A) Phrase-level recovery In which method does the parser continue parsing even after detecting an error, attempting to fix the input? A) Error correction B) Backtracking C) Top-down parsing D) Forward correction Answer: A) Error correction Which method is the simplest form of error recovery in parsers? A) Panic mode recovery B) Backtracking C) Dynamic programming D) Look-ahead parsing Answer: A) Panic mode recovery In panic mode error recovery, what happens to the tokens after an error is detected? A) They are discarded until a synchronization token is found B) They are modified to fix the error C) They are stored in a buffer D) They are re-analyzed using different rules Answer: A) They are discarded until a synchronization token is found Which error recovery method involves retrying to parse the input after making certain modifications to correct the error? A) Error correction B) Predictive parsing C) Recursive descent parsing D) Look-ahead parsing Answer: A) Error correction Advanced Topics Which recovery technique uses checkpoints in systems to restore the state in case of errors? A) Checkpointing B) Memory mapping C) Backtracking D) Forward recovery Answer: A) Checkpointing Which error recovery strategy corrects errors as they occur rather than detecting them first? A) Forward error correction B) Backward recovery C) Panic mode D) Checkpointing Answer: A) Forward error correction What is the purpose of forward recovery in systems? A) To continue operation by handling errors as they occur B) To revert to a previous correct state C) To abort and restart the operation D) To stop the program immediately after an error Answer: A) To continue operation by handling errors as they occur In a distributed system, what technique is used to recover from a partial system failure? A) Distributed rollback B) Local rollback C) Forward error correction D) Panic mode Answer: A) Distributed rollback Which of the following can prevent error propagation in a system? A) Error isolation B) Stack allocation C) Loop unrolling D) Instruction pipelining Answer: A) Error isolation’ Miscellaneous What is the main goal of backward error recovery? A) To restore the system to a previous valid state B) To predict future errors C) To prevent errors from occurring D) To isolate hardware faults Answer: A) To restore the system to a previous valid state In backward error recovery, which of the following is used to revert to a previous correct state? A) Checkpointing B) Instruction pipelining C) Stack optimization D) Predictive parsing Answer: A) Checkpointing What is the primary difference between error detection and error correction? A) Error correction involves fixing errors after they are detected B) Error detection involves fixing errors as they occur C) Error correction prevents errors from occurring D) Error detection only applies to software, while error correction applies to hardware Answer: A) Error correction involves fixing errors after they are detected Which type of system can continue functioning in the presence of errors using error detection and recovery techniques? A) Fault-tolerant system B) Distributed system C) Time-sharing system D) Real-time system Answer: A) Fault-tolerant system In systems with error recovery, what is the role of redundancy? A) To provide alternative ways of storing or transmitting data B) To improve system performance C) To speed up processing D) To reduce memory usage Answer: A) To provide alternative ways of storing or transmitting data Additional Concepts What is the purpose of recovery blocks in error recovery systems? A) To provide an alternative sequence of instructions to be executed in case of failure B) To isolate different parts of the memory C) To improve the system’s performance D) To reduce the system’s memory footprint Answer: A) To provide an alternative sequence of instructions to be executed in case of failure Which of the following is a strategy for handling errors in distributed systems? A) Global checkpointing B) Stack unrolling C) Phrase-level recovery D) Bottom-up parsing Answer: A) Global checkpointing In a rollback-recovery protocol, which action is taken after detecting an error? A) The system is restored to a previous checkpoint B) The system continues without addressing the error C) The system generates a warning and continues D) The system pauses all processes Answer: A) The system is restored to a previous checkpoint What is a “shadow page” in database systems in the context of error recovery? A) A copy of the page used to restore data in case of a failure B) A backup server for processing data C) An alternative algorithm for error detection D) A page used to store metadata Answer: A) A copy of the page used to restore data in case of a failure What type of fault is often corrected using error detection and recovery techniques? A) Transient fault B) Permanent fault C) Logic fault D) Performance fault Answer: A) Transient fault Which of the following is a non-maskable error that cannot be corrected by recovery techniques? A) Hardware failure B) Transient fault C) Stack overflow D) Logic error Answer: A) Hardware failure Which system ensures minimal data loss and downtime using recovery techniques? A) Fault-tolerant system B) Multithreaded system C) Paging system D) Pipelined system Answer: A) Fault-tolerant system What is the primary goal of using redundant arrays in RAID systems for error recovery? A) To recover data in case of drive failure B) To improve access speed C) To reduce power consumption D) To optimize cache usage Answer: A) To recover data in case of drive failure In compiler error recovery, what does the “parse tree” represent? A) The hierarchical structure of the source code B) The list of all variables C) The sequence of executed commands D) The result of dynamic memory allocation Answer: A) The hierarchical structure of the source code What happens when an error is detected in a real-time system? A) The system attempts to recover while maintaining timing constraints B) The system halts all operations C) The system reboots automatically D) The system performs an immediate shutdown Answer: A) The system attempts to recover while maintaining timing constraints
All Copyrights Reserved 2025 Reserved by T4Tutorials