********************************** I. Study Guide: December, 2004 ************************************ A. General Guideline: 1. Study the summary in each chapter. 2. Study the lecture notes. 3. Study the textbook. 4. Study the homework assignments and sample qustions. 5. Study the old exams. 6. Study those sample codes shown in the class. 7. Do the exercises in the textbook. *********************************** II. Sample Questions ************************************ CS 540 Final - Sample Questions Fall 2004 (Chap 6, 9.1 - 9.3) Part I: Multiple-Choice Questions. (Circle only ONE choice) (c) 1. Which is not a file attribute? a. Name b. Size c. Shape d. Type (d) 2. Which is not the operation to be performed on directories? a. Search for a file b. create a file c. list a directory d. None of above (D) 3. Which is not a security goal of a system? A. Data confidentiality B. Data integrity C. System availability D. None of above (D) 4. Which is not a threat to a system? A. Exposure of data B. Tempering with data C. Denial of service D. None of above (D) 5. Which cannot cause accidental data loss? A. Acts of God B. Hardware or software errors C. Human errors D. None of above (C) 6. Which is public-key cryptography? A. Caesar cipher B. Transposition cipher C. RSA D. DES (D) 7. Which cannot be used for authentication? A. Password B. Smart Card C. Biometrics D. None of above (A) 8. Which is not a possible form of virus? A. plain text B. Microsoft PowerPoint file C. Microsoft Word file D. an MP3 file Part II: Questions and Answers 1. What is a sequential file? What is a random (direct) access file? Ans: A file that is read one record or block or parameter at a time in order, based on a tape model of a file. A file in which any record or block can be read next. Usually the blocks are fixed length. 2. What problems might arise on deletion if a file is shared? How can we solve this problem? Ans: Copier of file might delete the original shared file, depriving rest of users. They have a pointer to a deleted directory entry pointing to the original file or one overwritten by other users of the system, or a new entry pointing to a new file created by the original user. Keep a count of the number of links to a file in original directory. As each person deletes a file, the count decreases by 1. 3. Name one advantage of hard links over symbolic links and one advantage of symbolic links over hard links. Ans: Hard links do not require any extra disk space, just a counter in the i-node to keep track of how many there are. Symbolic links need space to store the name of the file pointed to. Symbolic links can point to files on other machines, even over the Internet. Hard links are restricted to pointing to files within their own partition. 4. The performance of a file system depends upon the cache hit rate (fraction of blocks found in the cache). If it takes 1 msec to satisfy a request from the cache, but 31 msec to satisfy a request if a disk read is needed, give a formula for the mean time required to satisfy a request if the hit rate is h. Ans: The mean time required to satisfy a request is h * 1 + (1 - h) * 31 = h + 31 - 31h = 31 - 30h 5. Consider a disk with a mean seek time of 8 msec, a rotational rate of 15,000 rpm, and 262,144 bytes per track. What are the data rates for block sizes of 1 KB, 2 KB, and 4 KB, respectively? Ans: At 15,000 rpm, the disk takes 4 msec to go around once. The average access time (in msec) to read k bytes is then 8 + 2 + (k/262144) x 4. For blocks of 1 KB, 2 KB, and 4 KB, the access times are 10.015625 msec, 10.03125 msec, and 10.0625 msec, respectively (hardly any different). These give rates of about 102,240 Bytes/sec, 204,162 Bytes/sec, and 407,056 Bytes/sec, respectively. 6. A file system checker has constructed the counters shown below: Block number: 0 1 2 3 4 5 6 7 8 9 In use: 1 0 0 1 0 2 0 0 1 1 Free: 0 1 0 0 2 0 1 1 0 0 Are there any errors? If so, how serious are they (can they be fixed)? Explain. Ans: The block 2 has an error. It is neither in use nor free. It will be reported as a missing block. The error can be fixed. The file system checker just set the in use bit to 0 and add it into the free list. The block number 4 has an error. It occurs twice in the free list. The error can be fixed. The file system checker just set the free bit to 0 and rebuild the free list. The block number 5 has an error. The block has been used by 2 files. This error might not be able to fixed and need to be reported. The file system checker can copy the content of this block into a free block list such as the block 6. The file system states are then in consistency but the file problems might not solved. So this error needs to be reported. 7. A file system checker can also be used to check files and directories. Suppose that the following table is constructed: I-node number: 0 1 2 3 4 5 6 7 8 9 File count: 1 0 2 1 0 0 1 0 1 0 I-node count: 1 0 1 1 0 1 1 0 1 0 The file count is obtained by traversing from the root directory and computing the number of times an i-node is used by a file. The i-node count is just the link counts stored in each i-node. Are there any errors? If so, how serious are they, and how can they be fixed? Ans: I-node 2 has an error. The file count is larger than the I-node count. This means a link to the file is not counted. This could be serious. If any file is erased, the file is lost. Set the i-node count to 2 to fix it. I-node 5 has an error. The I-node count is larger than the file count. That means I-node points to some file that no longer exists. This is not serious. Set the i-node count to 1 to fix it. 8. Describe goals and threats of computer systems from a security perspective. Ans: Data confidentiality: Exposure of data Data integrity: Tampering with data System availability: Denial of service 9. Encrypt the following plaintext using a transposition cipher based on the key "SUNDAY". plaintext = H A V E A N I C E D A Y Ans: S U N D A Y 4 5 3 2 1 6 H A V E A N I C E D A Y ciphertext = A A E D V E H I A C N Y 10. Using the RSA public key cryptography algorithm. Given p = 5, q = 11, find a possible d and e. Ans: n = p * q = 55 z = (p - 1) * (q - 1) = 4 * 10 = 40 Choose d = 7 which is relatively prime to 40. 7 e % 40 = 1, 41, 81, 121, 161 7 e = 161 e = 23 11. What is a hacker? What is a cracker? Ans: In the computer world, a hacker is a term of honor reserved for great programmers. Crackers are those who try to break into computer systems where they do not belong. 12. What is a virus? What is a worm? Ans: Virus is a program can reproduce itself by attaching its code to another program and additionally do harm. Worms are programs which can self replicate without attaching to other program and do harm