1.The word modem is derived from what two words?

MODULATE - DEMODULATE or MODULATOR DEMODULATOR

2. What is the binary representation of 15.5 base 10? ANSWER: 1111.1. 3.What is the octal representation of 19 decimal? ANSWER: 23 BASE 8 or 23 4. What is the binary representation of 65 octal? ANSWER: 110101. 5. What is the octal representation of A5 hexadecimal? ANSWER: 245. 6. What is the octal sum of 064321 octal and 016477 octal? ANSWER: 103020. 7. Multiple Choice: Which of the following reads a source program one statement at a time and causes the execution of that statement? w) assembler, x) compiler y) lister z) interpreter ANSWER: Z -- INTERPRETER

8. Suppose that a byte is 8 bits. If one character is represented by one byte of storage, then how many different characters could be represented using one byte per character ANSWER: 28 or 256 9. If b=5, c=4, d=2, and e=3 and all are integer variables, what integer value is obtained for the following expression when programming in BASIC? b + c*d**e (read: B plus C star D star star E) ANSWER: 37. 10.Subtract in base 2: 1011 - 110 ANSWER: 101. 11. Place the following computer languages in order from the lowest level (i.e., most primitive and most hardware dependent) to the highest level(i.e.,least primitive and least hardware dependent): microcode, BASIC, assembler-language, machine language. ANSWER: MICROCODE, MACHINE-LANGUAGE, ASSEMBLERLANGUAGE, BASIC. 12. Place the following programming languages in chronological order with regard to their first introduction to the computing public: BASIC, ALGOL, Pascal, FORTRAN ANSWER: FORTRAN, ALGOL, BASIC, PASCAL

13.What is the largest positive decimal value which can be represented by six binary digits (bits)? ANSWER: 63. ‡ 14. Which of the following terms refers to the use of a computer to ‡ create, store, revise, and produce text: ‡ w) teleprocessing ‡ x) word-processing ‡ y) time-sharing ‡ z) voice-synthesis ‡ ANSWER: X -- WORD-PROCESSING.
‡

‡ ‡ ‡ ‡ ‡ ‡ ‡

computer program can be written to play tic-tac-toe in a manner such that the program never loses the same game situation more than one time. In which of the following areas of computer science would this program be of interest: w) operating systems x) computability y) artificial intelligence z) optimization ANSWER: Y -- ARTIFICIAL INTELLIGENCE

15. A

16. Which of the following computers would implement the method of processing in which one operation is completed before the next operation is initiated? w) analog x) digital y) asynchronous z) synchronous ANSWER: Y ± ASYNCHRONOUS. 17. Which of the following computers represents variables by physical analogies? w) analog x) digital y) asynchronous z) synchronous ANSWER: W ± ANALOG. 18. What is the process of filling internal storage of a computer with information from auxiliary or external storage? w) compile x) link y) load z) assemble ANSWER: Y -- LOAD

19. The algebra concerned with two-state variables was named for which of the following persons? w) George Boole x) Blaise Pascal y) Issac Newton z) Albert Einstein ANSWER: W -- GEORGE BOOLE. 20. Place the following in order from the smallest unit of memory to the largest: block, byte, bit, word ANSWER: BIT, BYTE, WORD, BLOCK. 21. Which of the following is characteristic of the first generation of digital computers? w) vacuum tubes x) transistors y) semi-conductors z) chips ANSWER: W -- VACUUM TUBES. 22. What are the 4 major divisions in a COBOL program? ANSWER: IDENTIFICATION, ENVIRONMENT, DATA, PROCEDURE. 23. What are graphs of mathematical sets called? ANSWER: VENN DIAGRAMS

24. Of the following men, who co-authored the first book on programming? w) Maurice V. Wilkes x) John von Neumann y) Thomas J. Watson z) J. Presper Eckert ANSWER: W -- MAURICE V. WILKES. 25The CPU consists of what two units: ANSWER: ARITHMETIC/LOGIC UNIT and CONTROL UNIT. 26. What is the material from which most micro-electronic chips are made? ANSWER: SILICON. 27. How many nibbles are in a byte? ANSWER: TWO. 28. What is the 10's complement of 45? ANSWER: 55

29.A COBOL source program has 4 divisions. Which of the following divisions contains the equipment configuration? w) Identification x) Environment y) Data z) Procedure ANSWER: X -- ENVIRONMENT 30.What is the radix of an octal number? ANSWER: 8 31. Which of the following is NOT characteristic of an operating system. An operating system: w) is a resource manager x) is a library of utility programs y) defines the "user interface" z) shares the hardware among users ANSWER: X -- IS A LIBRARY OF UTILITY PROGRAMS. 32. The offsetting of the tremendous variation in I/O speeds for various devices by the use of a device of intermediate speed is known as: w) unbundling x) channeling y) spooling z) loading ANSWER: Y -- SPOOLING

name given to a special-purpose computer devoted to handling I/O independently of the main processor of the computer system is: w) loader x) channel y) track z) bundler ANSWER: X ± CHANNEL. 34. Which of the following techniques is a hardware technique used in

33. The

high performance computer systems to exploit certain types of parallelism in instruction processing? w) pipelining x) networking y) multiprocessing z) multitasking ANSWER: W ± PIPELINING.
35.In the CPU, the "instruction register" holds the instruction which: w) was previously executed x) is CURRENTLY being executed y) is the next instruction to be executed z) contains no instruction information. ANSWER: X -- IS CURRENTLY BEING EXECUTED

36. Second generation computers replaced vacuum tubes with what electronic device? ANSWER: TRANSISTOR. 37. What is the ones complement of the following 4-bit string: 1101

ANSWER: 0010. 38. Determine the two's complement of the following 4 bit string: 0010 ANSWER: 1110. 39. What does the acronym LISP stand for? ANSWER: LIST PROCESSING. 40. What is the only data structure in the programming language LISP? ANSWER: A LIST. 41. The floppy diskette is used as an external storage device by most microcomputers. In a single-sided, double-density 5-and 1/4 inch diskette, storage locations consist of 40 narrow concentric ring-shaped areas. What is the standard term for the 40 ring-shaped areas? ANSWER: TRACKS

42.Identify the oldest known mechanical computing aid and the country in which it was used as early as the 6th century B.C. ANSWER: ABACUS and CHINA. 43. Give the value of the largest integer that can be written as an 8-bit binary number. ANSWER: 255 or 2 TO THE 8th POWER, MINUS 1. 44. The data-transfer rate through a modem is often described in terms of this four-letter name. Give me this name. ANSWER: BAUD. 45. The most common type of computer disk records its information by what type of process? w) electrical x) optical y) magnetic z) mechanical ANSWER: Y ± MAGNETIC. 46. You are transmitting information at 300 baud. This means you are sending approximately: w) 300 bytes per second x) 300 kilobytes per minute y) 300 bits per second z) 300 bits per minute (pron: the au in baud is pronounced like the a in raw, bytes is pronounced like bites) ANSWER: Y -- 300 BITS PER SECOND

47.Which of the following is not considered hardware? w) floppy disk x) RAM (pron: as a word "ram") y) linker z) modem ANSWER: Y ± LINKER. 48. MS-DOS, UNIX and OS/2 are: (pron: "M S dos" (rhymes with moss), "U nix", "O S two") w) types of computers x) graphics programs y) programming languages z) operating systems ANSWER: Z -- OPERATING SYSTEMS. 49. What are lines of computer code that are transmitted to your computer without your knowledge and are capable of such things as slowing down your operations, filling up memory space and distorting your programs called? ANSWER: VIRUSES (OR VIRUS) or WORMS or TROJAN HORSE. 50. You are programming in BASIC on your PC. What statement should be the last line of your program? ANSWER: END

51.A parity check can be used to check for: w) programming logic errors x) divisions by zero y) undefined variables z) internal computer errors ANSWER: Z -- INTERNAL COMPUTER ERRORS 52. In an EVEN parity system, what is the value of the parity bit associated with an 8 bit character if the number of 1 bits is 4? ANSWER: 0. 53. The primary electronic elements used in the first computers were vacuum tubes. What were the primary electronic elements in the next generation of computers? w) magnetic disks x) integrated circuits y) multiplexors z) transistors ANSWER: Z ± TRANSISTORS. 54. What decimal number does the hexadecimal number 1E represent? ANSWER: 30. 55. The inventor of the tabulating machine which read data from punched cards and was used in the 1890 census was w) Thomas Edison x) Herman Hollerith y) Blaise Pascal (pron: blez - pas - kal') z) John von Neumann ANSWER: X -- HERMAN HOLLERITH

56.A cache (pron: cash) is: w) a low speed buffer memory x) a high speed buffer memory y) ROM z) a register ANSWER: X -- A HIGH SPEED BUFFER MEMORY. 57. RS-232C (pron: R S two thirty two Y) refers to a type of: w) personal computer x) physical interface between a computer and peripheral equipment y) printer z) monitor ANSWER: X -- PHYSICAL INTERFACE BETWEEN A COMPUTER AND PERIPHERAL. 58. How much is 1A (Hex) plus 2B (Hex)? ANSWER: 45 (Hex) or 69 (Decimal. 59. What is the binary result when 0111 binary is subtracted from 1000 binary? ANSWER: 0001 (Base 2. 60. Which of the following would be used to find syntax errors in a Pascal program? w) assembler x) compiler y) error trap z) all of the above ANSWER: X -- COMPILER

61.What company created the 80X86 family of microprocessors? ANSWER: INTEL. 62. Ada Augusta, also known as the Countess of Lovelace, is generally considered to be the first programmer of a stored-program computer. Who was her famous father? w) John Smith x) Lord Byron y) John von Neumann z) Eli Whitney ANSWER: X -- LORD BYRON, THE POET. 63. How many memory locations can be accessed with a 5-bit address bus? ANSWER: (2 to the 5th power) or 32. 64. What type of graphics card offers the greatest resolution? w) VGA x) EGA y) SVGA z) CGA ANSWER: Y ± SVGA. 65. If A = 1011 (base 2) and B = 1101 (base 2), what is A bitwise or'd with B? ANSWER: 1111

66.Which of the following is a last-in, first-out (also called LIFO) data structure: w) tree x) stack y) queue z) list ANSWER: X ± STACK. 67. Complete the following analogy: LIFO is to stack as FIFO is to: ANSWER: QUEUE. 68. Which of the following operations is used on a stack: w) pop x) enqueue y) insert z) delete ANSWER: W ± POP. 69. Arrange the following THREE processes in their order of operation: load, compile, link ANSWER: COMPILE then LINK then LOAD. 70. A typical hard disk is divided into tracks and what? ANSWER: SECTORS. 71. What are the TWO wild card indicators in DOS? ANSWER: ASTERISK AND QUESTION MARK or STAR AND QUESTION MARK

72. What happens on a DOS machine when you simultaneously hold down the <Ctrl> <Alt> and <Del> (read: control, alternate and delete) keys? ANSWER: THE SYSTEM WILL REBOOT, RESET OR RESTART. 73. The ls (pron: L - S) command in Unix is similar to what command in DOS? ANSWER: DIR. 74. Which of the following does NOT belong? w) star x) ring y) address z) bus ANSWER: Y ± ADDRESS. 75. What batch file, if present in the root directory, is automatically executed by DOS after booting? ANSWER: AUTOEXEC.BAT. 76. The statement: C := A + B; is the correct syntax in all but one of the following languages: w) Pascal x) Cobol y) Ada z) Modula - 2 ANSWER: X -- COBOL

77.Assignment is performed with the equal sign in all but one of the following languages: w) Fortran x) Basic y) Pascal z) C ANSWER: Y ± PASCAL. 78. What is the value of the parity bit produced by an even parity check on an 8-byte word if the number of 1's is 7? ANSWER: 1. 79. What parity bit should be appended to 1011 to generate even parity? ANSWER: 1. 80. What is the value of the parity bit produced by an odd parity check if the number of 1's in an 8 bit machine word is 6? ANSWER: 1 81. An accumulator is a special type of: w) bit x) register y) byte z) page ANSWER: X -- REGISTER

82.What is the radix of a hexadecimal number? ANSWER: 16 83. Every Pascal program begins with what reserved word? ANSWER: PROGRAM. 84. The dir command in DOS is similar to what command in Unix? ANSWER: 1s 85. The CAT (read: C - A - T) command in Unix is similar to what command in DOS? ANSWER: TYPE 86. What three colors are used to generate all of the colors on a color monitor? ANSWER: RED, BLUE, GREEN 87. The hexidecimal equivalent of the decimal number 23 is: w) 18 x) 19 y) 32 z) 17 ANSWER: Z ± 17 88. Which of the following is NOT a legitimate data structure? w) List x) Queue y) Register z) Graph ANSWER: Y -- REGISTER

89.Seven is a prime number. Express seven as a three-bit binary number. ANSWER: 111 90. The person who conceived and designed a "difference engine" but was not able to build it was: w) Herman Hollerith x) Charles Babbage y) Blaise Pascal z) Thomas Edison ANSWER: X -- CHARLES BABBAGE 91. Which of the following is NOT a sorting algorithm. w) Heap x) Bubble y) Binary z) Insertion ANSWER: Y ± BINARY 92. Which of the following was the first digital computer? w) Univac x) Illiac y) VAX II/780 z) Eniac ANSWER: W -- UNIVAC

93.Which of the following is NOT a looping construct? w) Do...While x) If...Then...Else y) For...Do z) Repeat...Until ANSWER: X -- IF...THEN...ELSE. 94. Herman Hollerith w) was the father of the computer x) developed a coding system for punching cards which is still in use today y) invented a mechanical calculator that worked like an odometer z) built the first electronic computer ANSWER: X -- DEVELOPED A CODING SYSTEM FOR PUNCHING CARDS 95. The code that uses only "1"s and "0"s to represent numbers is the: w) decimal x) binary y) alphanumeric z) floating point ANSWER: X ± BINARY 96. How many bytes is 1 kilobyte? ANSWER: 1,024 BYTES 97. If a Manchester encoded transmission system requires a data rate of 100 Mbps, what minimum channel bandwidth is required? ANSWER: 200 MEGAHERTZ

98.If you needed an Analog to Digital converter that would adequately encode in the range of -5 to +5 volts with a resolution of 500 microvolt, what minimum number of bits resolution would be required: w) 13 bits x) 14 bits y) 15 bits z) 16 bits ANSWER: Y -- 15 BITS 99. When programming in C, ++A is symbolic for what operation? w) A = A + 1 x) A = A + B y) A = 1 z) A = 0 ANSWER: W -- A = A + 1 100. When programming in C, for what values of "A" will if(W) evaluate to false? ANSWER: A = 0 101. What type of memory is used to hold application programs while they are being executed and may be cleared when the computer is turned off? w) ROM x) EPROM y) RAM z) DISK ANSWER: Y -- RAM

102.What command would you type to return to DOS from BASIC? w) exit x) quit y) end z) system ANSWER: Z ± SYSTEM 103. In which language is this a valid statement: A + B++ w) FORTRAN x) COBOL y) BASIC z) C ANSWER: Z -- C 104. Which of the following is NOT an operating system? w) XENIX x) SQL y) PC DOS z) CP/M ANSWER: X -- SQL 105. The process of loading an operating system is called: w) booting x) formatting y) compiling z) debugging ANSWER: W -- BOOTING

106.The process of preparing a floppy diskette for use is called: w) assembling x) translating y) parsing z) formatting ANSWER: Z ± FORMATTING 107. A program that converts a high-level language source file into a machine-language file is called a: w) translator x) assembler y) compiler z) linker ANSWER: Y -- COMPILER 108. The binary number 1011 is expressed in hexadecimal notation as: w) 11 x) 13 y) A z) B ANSWER: Z -- B 109. When using COBOL, a serial search of a table begins with the first entry in the table, while a binary search of a table begins with what entry? Is it the: w) First x) middle y) last z) none of the above ANSWER: X -- MIDDLE

110.What is the most common method used to erase EPROM chips before re-programming them? w) magnetic field x) ultraviolet light y) program all null values in memory z) high-pitched sound ANSWER: X -- ULTRAVIOLET LIGHT 111. Rules that govern how computers communicate are called: w) system standards x) topology y) protocols z) baud rate ANSWER: Y -- PROTOCOLS 112. Which database modeling technique is well known for its use of high level data manipulation languages, such as SQL, QUEL and QBE? w) relational model x) network model y) herarchical model z) entity-relationship model ANSWER: W -- RELATIONAL MODEL

113.Programs written in the C programming language consist of one or more functions. Which function is always the first to be executed? w) open x) exit y) menu z) main ANSWER: Z ² MAIN

114. EXE (read: E - X - E), COM (read: C - O - M) and BAT (read: B - A - T) files are all executable under MS-DOS. In which order will DOS look for these files? ANSWER: COM first; EXE second; BAT last

115. One K of COMPUTER MEMORY is equivalent to: w) 1,000 bytes x) 2 to the eighth power bytes y) 2 to the tenth power bytes z) 640 thousand bytes ANSWER: Y -- 2 TO THE TENTH POWER BYTES

116.What DOS command gives you the total disk space, amount of available disk space, and the amount of free memory? w) MEM (read: M - E - M) x) CHKDSK (read: C - H - K - D - S - K) y) SPACE (read: S - P - A - C - E) z) MEMORY (read: M - E - M - O - R - Y) ANSWER: X ² CHKDSK 117. A logical variable contains what type of data? w) numeric x) true/false y) alphanumeric z) memory address ANSWER: X -- TRUE/FALSE

118. Which of the following will NOT decrease the processing time of a computer? w) increasing the processor speed x) increasing the size of the data bus y) increasing the resolution of the monitor z) decreasing the access time of a hard disk ANSWER: Y -- INCREASING THE RESOLUTION OF THE MONITOR

119.What does the acronym G-I-G-O mean? ANSWER: GARBAGE IN, GARBAGE OUT 120. What three letter word is commonly used to refer to an error in a computer program? ANSWER: BUG 121. What is the name of the marker that indicates where the next typed character will appear on the screen? ANSWER: CURSOR 122. You are laying out the logic of your computer program before you begin writing it. The graphical representation that you create is called a w) file x) simulation y) listing z) flowchart ANSWER: Z -- FLOWCHART

123.Which of the following does NOT belong? w) printer x) plotter y) monitor z) keyboard ANSWER: Z -- KEYBOARD (Keyboard is input, others are output devices) 124. Computers are playing a major role in today's communication revolution. What is the technological field involved in the control and intercommunication of information handling machines, the nervous systems of animals and man in order to improve communication? ANSWER: CYBERNETICS 125. What reserved word in Pascal is used to define constants? ANSWER: CONST 126. Which of the following is NOT characteristic of the second generation of operating systems of the early 1960's: w) real time computing x) multiprogramming y) multiprocessing z) networking ANSWER: Z -- NETWORKING

127.What does the acronym C-A-M refer to? ANSWER: COMPUTER AIDED (OR ASSISTEZ) MANUFACTURING 128. At what company or research organization was the first transistor developed? ANSWER: BELL LABORATORIES 129. Which of the following is NOT characteristic of the first generation of computers? w) vacuum tubes x) integrated circuits y) magnetic drums z) punched cards ANSWER: X -- INTEGRATED CIRCUITS 130. Which of the following is NOT one of the internal components of a CPU? w) control - sequencer x) M-D-R y) M-A-R z) floppy disk ANSWER: Z -- FLOPPY DISK

131.The smallest unit of information is w) a byte (Pronounced: bite) x) a bit y) a nibble z) a block ANSWER: X -- A BIT 132. Which computer pioneer was also a Rear Admiral of the U.S. Navy? w) Steve Jobs x) John Backus y) John von Neumann z) Grace Hopper ANSWER: Z -- GRACE HOPPER

133. The ability of a computer to learn from experience by storing information and applying it to new situations is referred to as w) artificial intelligence x) automated data processing y) asynchronous transmission z) encryption ANSWER: W -- ARTIFICIAL INTELLIGENCE

134.When you boot a computer you are w) submitting a batch job x) debugging a program y) loading the operating system z) kicking it in frustration ANSWER: Y -- LOADING THE OPERATING SYSTEM 135. Where do you find a write protect notch? w) on a computer chip x) on a punched card y) in a read only memory z) on a floppy disk ANSWER: Z -- ON A FLOPPY DISK

136. Some programs allow the computer's video display to be divided into separate areas in order to look at more than one item or portions of an item simultaneously. These are called? w) disks x) windows y) fonts z) directories ANSWER: X -- WINDOWS

137.A prescribed set of well-defined instructions for solving mathematical problems is called w) a compiler x) a code y) a description z) an algorithm ANSWER: Z ² ALGORITHM 138. In order to write on a floppy disk with your IBM PC, (Pronounced I B M P Y) you must first w) digitize it x) format it y) compile it z) hardware it ANSWER: X -- FORMAT IT 139. An electrical pathway within a computer is called: w) buffer x) sector y) bus z) track ANSWER: Y -- BUS

140.The letters UPC stand for: w) United Parcel Corporation x) Universal Product Code y) Universal Price Code z) Universal Personal Computer ANSWER: X -- UNIVERSAL PRODUCT CODE 141. In computer science what does the acronym JCL stand for? w) Justified Computer Language x) Justified Complete Language y) Job Computerized Language z) Job Control Language ANSWER: Z -- JOB CONTROL LANGUAGE

142. A Field is a related group of w) Records x) Files y) Characters z) Cables ANSWER: Y -- CHARACTERS

143.In DOS, what command allows a ASCII file to be viewed? w) TYPE x) SHOW y) DISPLAY z) VIEW ANSWER: W ² TYPE 144. The type of data storage that is considered to be nonvolatile is? w) R-O-M x) R-A-M y) TAPE z) DISK ANSWER: W -- R-O-M

145. The first general-purpose commercially available computer system was called? w) HAL x) UNIVAC I y) ENIAC z) MARK I ANSWER: X -- UNIVAC I

146.Electronic wire connector cables can be of two types, Serial and ? w) Duplexed x) Parallel y) Linking z) Expanded ANSWER: X ² PARALLEL 147. One of the things that separates a "Terminal" from a "PC" is that the terminal does not have a what? w) Keyboard x) Monitor y) Power cord z) CPU ANSWER: Z ² CPU 148. The "First Generation" of computers used? w) Gears x) Vacuum Tubes y) Transistors z) No Electricity, Mechanical ANSWER: X -- VACUUM TUBES

149.In communications an extra bit is added to each byte to aid in checking data for accuracy. This bit is known as what? ANSWER: PARITY 150. What does the acronym GIGO mean? ANSWER: GARBAGE IN, GARBAGE OUT 151. Substances in the read heads of computer disk drives use a property known as magnetoresistance to access a floppy disk. A new class of magnetoresistant substances has been made from w) uranium and lead x) aluminum and iron y) copper and barium z) silver and cobalt ANSWER: Z -- SILVER AND COBALT 152. OS/2 is w) single-user, single tasking x) multi-user, single tasking y) multi-user, multitasking z) single-user, multitasking ANSWER: Z -- SINGLE-USER, MULTITASKING

153.How many color dots make up one color pixel on a screen? w) 256 x) 16 y) 3 z) 1 ANSWER: Y ² 3 154. Which inherent intrinsic property is common to both C++ and C? w) polymorphism x) inheritance y) classes z) structures ANSWER: Z -- STRUCTURES 155. The term used to indicate, in bits per second, the transmission speed of a modem is? ANSWER: BAUD 156. An eight bit byte is capable of representing how many different characters? w) 64 x) 128 y) 256 z) 512 ANSWER: Y -- 256

157.The language that is the lowest level is: w) assembly x) high-level y) machine z) application generator ANSWER: Y ² MACHINE 158. Choice: The person credited with designing the Harvard Mark I Computer is: w) Aiken x) Atanasoff y) Eckert z) Mauchly ANSWER: W -- AIKEN 159. Which type of network is best suited for businesses which must carefully control and coordinate the operations of distributed branch outlets? w) hierarchical x) local area y) ring z) star ANSWER: Z -- STAR

160.The language that has become the most widely used microcomputer high level language is: w) PASCAL x) COBOL y) BASIC z) Small talk ANSWER: Y ² BASIC 161. Modular programming relates to the use of which of the following: w) Data files x) Subroutines y) Conditional IF statements z) Do loops ANSWER: X -- SUBROUTINES 162. What computer programming language was developed in the 1970's for the purpose of creating the UNIX operating system? w) FORTRAN x) COBOL y) ADA z) C ANSWER: Z -- "C"

163.How many characters are there in the official standard ASCII character set? (pronounced ask-ee) ANSWER: 128 164. Who invented the computer architecture that put program memory and data memory in the same memory unit? ANSWER: VON NEUMANN (Pronounced noy-man) 165. A virtual memory system (VMS) means: w) data are copied from slower R-O-M to faster R-A-M x) the hard drive is accessed as if it were R-A-M y) R-A-M is accessed as if it were a hard drive z) there is no upper limit on the amount of R-A-M addressed ANSWER: X -- THE HARD DRIVE IS ACCESSED AS IF IT WERE R-A-M 166. In a microcomputer, what benefit does a coprocessor provide? w) Supports both color and monochrome monitors x) Allows multi-user operations y) Increases the speed of floating point mathematical computations z) Handles network communication protocols ANSWER: Y -- INCREASES THE SPEED OF FLOATING POINT MATHEMATICAL COMPUTATIONS

167.Which of these is a standard interface for serial data transmission? w) ASCII x) RS232C y) LU6.2 z) Centronics ANSWER: X -- RS232C 168. What is the process that uses hardware and software to "imitate" a computer system in order to run programs that would otherwise be incompatible? w) Mapping x) Cloning y) Migration z) Emulation ANSWER: Z -- EMULATION 169. What is the term for a temporary storage area that compensates for differences in data rate and data flow between devices? w) Buffer x) Bus y) Channel z) Modem ANSWER: W -- BUFFER

170.Consider the following algorithm: x is initialized to 2; x is then replaced by its double four times in sequence; x is then decremented by 2 three times in sequence. What is the final value of x. ANSWER: 26. 171. Which of the following types of computer software is least likely to translate the commands of a computer program written in a language like BASIC into executable computer machine instructions? w) interpreter x) word processor y) compiler z) debugger ANSWER: X -- WORD PROCESSOR 172. Numbers ranging from -16,000 to +16,000 might be stored in a computer readable file as 16-bit integers, or in an ASCII (pronounced ask-ee) representation, which could be viewed with a text-editor or word processor. For a large file, how many times bigger would the ASCII file be than the binary version? w) no bigger x) twice as big y) four times as big z) eight times as big ANSWER: Y -- FOUR TIMES AS BIG

173.What is the decimal equivalent of the binary number 10111? w) 21 x) 23 y) 39 z) 42 ANSWER: X ² 23 174. What term is used to describe a function that calls itself? w) Iterative x) Assimilative y) Recursive z) Cooperative ANSWER: Y -- RECURSIVE 175. What is the name of the computer technology that is expected to provide the most powerful supercomputers within the next 10 years? w) Fiber optics x) Laser doping y) Parallel computing z) Very large integrated circuits ANSWER: Y -- PARALLEL COMPUTING

176.A record is related to a file, as a statement is related to a w) procedure x) file y) program z) data ANSWER: Y ² PROGRAM 177. The life-cycle of most large software development projects, such as those for NASA and DOD, goes through several welldefined phases sometimes referred to as the water-fall method. A simple version of the water-fall method consists of 4 phases. Which of the following would be the second phase? w) software design x) coding y) requirements analysis z) testing ANSWER: W -- SOFTWARE DESIGN 178. In the late 1970's, Pascal inventor Niklaus Wirth designed the language specifically for: w) high speed computers x) teaching programming to students y) helping market IBM personal computers z) use on any type of operating system ANSWER: X -- TEACHING PROGRAMMING TO STUDENTS

179.On IBM-PC based microcomputer systems, the 'boot section' stores: w) information on file sizes x) a copy of the operating system y) code needed to load the operating system z) all of the above ANSWER: Y -- CODE NEEDED TO LOAD THE OPERATING SYSTEM 180. The terms FIFO and LIFO would most likely arise during a discussion of: w) storage media x) binary trees y) compiler design z) queues ANSWER: Z -- QUEUES 181.

181.Which of the following is a computer program that appears to be legitimate but performs an illicit activity when it is run? a. Redundant verification. b. Parallel count. c. Web crawler. d. Trojan horse. ANSWER: Choice "d" is correct. A Trojan horse (like the wooden horse in Helen of Troy) is a program that appears to have a useful function but that contains a hidden and unintended function that presents a security risk (appears to be legitimate but performs an illicit activity when it is run).Choice "a" is incorrect. It is unclear what redundant verification is. One possibility if that it means verifying something twice to make sure that it is done once. This term is probably just made up. Choice "b" is incorrect. A parallel count appears to be the counting of bits in a parallel fashion. It appearsto have something to do with digital circuits in digital clocks, watches, microwave ovens, VCRs, and the like. It is not a computer program. Choice "c" is incorrect. A web crawler (also known as a web spider or web robot) is a program which browses the web in a methodical, automated manner. Web crawlers are mainly used to create a copy of visited web pages for later processing by a search engine. Web crawlers can also be used for automating maintenance tasks on a web site. Web crawlers can also be used to gather specific types of information from web pages. There is nothing illicit about a web crawler.

182. Consider the following functions. void Myst(int a, int & b) { a *= b; b = 2 + a; } void Test() { int u = 2; int v = 3; Myst(u, v); cout << u << " " << v << endl; } What is printed as a result of the call Test() ? (A) 2 3 (B) 2 8 (C) 6 3 (D) 6 8 (E) 8 3

183. Assume that the following definitions have been made. int num = 10; int sum; Which of the following code segments correctly computes the sum of the first 10 multiples of 5 (i.e., 5, 10, . . ., 50)? (A) sum = 5; while (num > 1) { sum += sum; num--; } (B) sum = 5; while (num > 0) { sum += sum; num--; } (C) sum = 0; while (num > 0) { num--; sum += 5 * num; } (D) sum = 0; while (num >= 0) { num--; sum += 5 * num; } (E) sum = 0; while (num > 0) { sum += 5 * num; num--; }

184. Consider the following functions. int F1(int len) int F2(int len) {{ int tot = 0; int tot = 0; int k = 0; int k; while (k < len) for (k = 0; k < len; k++) {{ tot += k; tot += k; k++; } } return tot; return tot; }} For which values of len do F1(len) and F2(len) return the same result? I. Any value less than zero II. The value zero III. Any value greater than zero (A) I only (B) II only (C) III only (D) I and II only (E) I, II, and III

185. Consider the following function. void Mystery(int n) { if (n >= 2) { Mystery(n / 3); } cout << n << " "; } Which of the following is output as a result of the call Mystery(27) ? (A) 0 27 (B) 1 3 9 27 (C) 3 9 27 (D) 27 0 (E) 27 9 3

186. The expression !((x > y) && (y <= 3)) is equivalent to which of the following? (A) (x > y) && (y <= 3) (B) (x > y) || (y <= 3) (C) (x < y) || (y >= 3) (D) (x <= y) || (y > 3) (E) (x <= y) && (y > 3) 187. Consider the following code segment. apmatrix<int> M(10, 10, 1); int k; for (k = 0; k < 10; k++) { M[k][k] = 0; } Which of the following best describes what happens when the loop is executed? (A) All entries of matrix M are set to zero. (B) One entry of matrix M is set to zero. (C) One column of matrix M is set to zero. (D) One row of matrix M is set to zero. (E) One diagonal of matrix M is set to zero.

188. Consider the following functions. apstring Laugh(const apstring & word, int num) { int k; apstring result = ""; for (k = 0; k < num; k++) { result += word; result += " "; } return result; } void Test() { apstring str("ha"); cout << Laugh(Laugh(str, 2), 3) << endl; } Which of the following is output as a result of the call Test() ? (A) ha (B) ha ha (C) ha ha ha (D) ha ha ha ha ha ha (E) Nothing will be output because a runtime error will occur.

1. Give two reasons why it important for the design team to keep a meticulous record of the design decisions that are made? Soln. Question 1: The reasons for meticulous recording of the design decisions are: a) It is possible that while the product is being designed, a dead end would be reached. Thus the design team would then have to backtrack and redesign certain sections. Written records of why specific decisions were made will serve as to assist the team in this process. b) By having this documentation handy it will facilitate easier post delivery maintenance (i.e. enhancements).

2. You are given the responsibility to market your employer·s software development firm to potential customers. You are rewarded with a 5% commission on the sale for each customer gained. Your first appointment is with Mrs. Gratitude who requires software to help manage her business. However, she is leaning towards taking her problem to a rival company, as she is very concerned about the time taken to develop the product. To arrest her fears you promise her that you would use the latest CASE tools to help manage all aspects of the development process, including analysis modelling and maintaining data dictionaries. A starry-eyed Mrs. Gratitude, now bemused by the jargon, asks you to explain the following: i) What does a case of tools (CASE tools) have to do with software engineering? ii) What is analysis modelling? iii) Define data dictionary giving an example of what one may contain? iv) How could the use of these tools minimise the duration of the software development process?

Soln. Question 2: Essential components to the answers are listed below: (i) . ‡ First indicate that it is not a case of tools but CASE tools. ‡ Special software termed ´Computer Aided Software Engineeringµ (CASE) can be used to assist the introduction of software engineering techniques. (ii) Analysis modelling refers to the technical representation of a system using one or more of the following diagrammatic and textual techniques: entity relationship diagrams, data flow diagrams, data dictionaries, and state transitions diagrams. (iii) Data Dictionary - ``An organized listing of all data elements that are pertinent to the system, with precise, definitions so that both user and system analyst will have a common understanding of inputs, outputs, components of stores and [even] intermediate calculations.µ

3. Give two advantages and two disadvantages of the following specification techniques: i) Questionnaires ii) Client Documents iii) Observations
soln. Question 3: Two advantages of questionnaires are: a) Overcomes the burden of multiple interviews b) Can be filled out by large numbers of people Two disadvantages of questionnaires are: a) Lacks interactivity b) Must be carefully designed Two advantages of client documents are: a) Detailed information regarding the operating of the client organisation can be captured and the types of data used by the organisation can be traced b) Less invasive/disruptive than interviews. Two disadvantages of client documents are: a) May have legal issues is the document contain sensitive information. b) Documents may not necessarily outline how the process is actually carried out. They may be inaccurate or out of date.

Two advantages of observations are: a) Use of video cameras can capture what happens in the office, making this technique less intrusive. b) One can directly observe what actually happens wrt a given process as oppose to how it is documented. Two disadvantages of observations are: a) May have privacy issues b) May have legal issues

4. List and describe three (3) important user design principles

Soln. Question 4: ......... 1. process should not suffer from tunnel vision 2. should be traceable to the analysis model 3. should not reinvent the wheel 4. should minimize intellectual distance between the software and the problem as it exists in 5. the real world 6. should exhibit uniformity and integration 7. should be structured to accommodate change 8. should be structured to degrade gently, even with bad data, events, or operating 9. conditions are encountered 10.should be assessed for quality as it is being created 11.should be reviewed to minimize conceptual (semantic) errors 12.Any three could be used and their descriptions are given online.

5. Elegant Software Solutions has been employing the Build-AndFix approach tosoftware development for the past 3 years. This has resulted several lawsuits for latedelivery and poor quality software. To address this issue senior management has hired you as a quality assessment consultant to: a. Explain the source of the problem and b. document an alternative software development strategies. The proposed strategy must be fully explained, giving any inherent advantages and disadvantages. Solution Question 5 The source of the problem lies in the fact that ESS is using the Build-And-Fix approach. This approach should never be used to produce software as its adhoc development approach has no clearly defined phases. Moreover with the lack of project management (incl. Risk management) and quality assessment monitoring this approach is doomed to fail. In essence, the product is built and modified as many times as possible until it satisfies the client. The cost of using this approach is greater than if specifications are drawn up and a design is carefully developed.

1. Which of the foll is not a protocol. HTTP PIM PSI Ans: PSI (check) 2 Which of the following does not help with security? Good Password Update Antivirus VLAN Ans: VLAN 3> What was the prob with Intel Processor Cache FPU NONE Ans: FIND OUT AND LET ME KNOW 4 What does MIME stand for Ans: Multipurpose Mail Exchange Protocol 5 What does XP stand for in WIN-Xp Ans: Experience 6 Who is associated with C Ans: Dennis Ritchie

7 Which of the foll is not a IM client AOL MSN JABBER XINGC Ans: XINGC 8 What does ERP stand for? Ans: Enterprise resource planning. 9 Who is associated with HOTMAIL SABEER Bhatia and Jack Smith SABEER Bhatia and Bill Gates Ans: SABEER Bhatia and Jack Smith 10 What does UNIX stand 4? UNiplexed Information Computing System. UNICS later known as UNIX.

Which of the following is not an app server? UESTONE BSPHERE MCAT OSS swer: BLUESTONE is not an app server. GENERAL CSE (Computer science and engineering branch B.tech BE) quest What do u call software embedded in ROM S MWARE AREWARE EEWARE s: BIOS (Verify and plz let me know) What is semaphore used 4???? Integral Constraint helps in??? s: Solving Inconsistent Data prob. PING uses s: ICMP IP ADDRESS occupies ytes ytes bytes ytes s: I wrote 8. correct ans 4

17 Which Data Structure helps Searching STACK LINKED LIST HASH Ans: HASH 18 Q on Binary tree Depth? 2^n 2^n ² 1 log n 19 Database should have Ans: ACID properties. 20 VPN stands 4 Ans: virtual private n/w 21 what does fork() return 2 parent child pid 0 Ans: 0 22> What do u call the relationship b/e a table and its columns Ans: Schema HP 12 Questions on c & c++

23 What is true about c++ Ans: It can have virtual constructors 24 result of i=6; printf(µ%dµ,i++*i++) 36 54 cant say Ans: Can·t say (compiler dependent) 25 output of char str[20] = ´PANKAJµ printf(µ%d%dµ,sizeof(str),strlen(str)) Answer 20,6 the following cant be used across 26 Which of files? extern volatile static const Ans: static. (i wrote volatile) 27 union u{ int i; char c;}; sizeof(u); Ans: 4 28 Identify the error below: 5[[a] 5["abc"] Ans: 5["abc"]

26 Which of the following cant be used across files? extern volatile static const Ans: static. (i wrote volatile) 27 union u{ int i; char c;}; sizeof(u); Ans: 4 28 Identify the error below: 5[[a] 5["abc"] Ans: 5["abc"]

8.1.1 An entity is (a) a collection of items in an application (b) a distinct real world item in an application (c) an inanimate object in an application (d) a data structure 8.1.2 Pick entities from the following: (i) vendor (ii) student (iii) attends (iv) km/hour (a) i, ii, iii (b) i, ii, iv (c) i and ii (d) iii and iv 8.1.3 A relationship is (a) an item in an application (b) a meaningful dependency between entities (c) a collection of related entities (d) related data 8.1.4 Pick the relationship from the following: (a) a classroom (b) teacher (c) attends (d) cost per dozen

8.1.5 Pick the meaningful relationship between entities (a) vendor supplies goods (b) vendor talks with customers (c) vendor complains to vendor (d) vendor asks prices 8.1.6 The entity set is a (a) set of entities (b) collection of different entities (c) collection of related entities (d) collection of similar entities 8.1.7 Pick entity set from the following (a) all vendors supplying to an organization (b) vendors and organizations they supply (c) vendors and transporters (d) a vendor supplying to many organizations

8.1.8 Attributes are (i) properties of relationship (ii) attributed to entities (iii) properties of members of an entity set (a) i (b) i and ii (c) i and iii (d) iii 8.1.9 The attributes of relationship teaches in teacher teaches course should be (a) teacher code, teacher name, dept, phone no (b) course no, course name, semester offered, credits (c) teacher code, course no, semester no (d) teacher code, course no, teacher name, dept, phone no 8.1.10 The expansion of E-R diagram is (a) Entity-Relationship diagram (b) Entity-Relative diagram (c) Entity-Relation diagram (d) Entity-Rationalized diagram 8.1.11 In an E-R diagram entities are represented by (a) circles (b) rectangles (c) diamond shaped box (d) ellipse

8.1.12 In an E-R diagram relationship is represented by (a) circles (b) rectangles (c) diamond shaped box (d) ellipse 8.1.13 Entities are identified from the word statement of a problem by (a) picking words which are adjectives (b) picking words which are nouns (c) picking words which are verbs (d) picking words which are pronouns 8.1.14 Relationships are identified from the word statement of a problem by (a) picking words which are adjectives (b) picking words which are nouns (c) picking words which are verbs (d) picking words which are pronouns 8.1.15 One entity may be (a) related to only one other entity (b) related to itself (c) related to only two other entities (d) related to many other entities

8.1.1 8.1.2 8.1.3 8.1.4 8.1.5 8.1.6 8.1.7 8.1.8 8.1.9 8.1.10 8.1.11 8.1.12 8.1.13 8.1.14 8.1.15

b c b c a d a c c a b c b c d

8.2.1 By relation cardinality we mean (a) number of items in a relationship (b) number of relationships in which an entity can appear (c) number of items in an entity (d) number of entity sets which may be related to a given entity 8.2.2 If an entity appears in only one relationship then it is (a) a 1:1 relationship (b) a 1:N relationship (c) a N:1 relationship (d) a N:M relationship 8.2.3 If an entity appears in N relationships then it is (a) a 1:1 relationship (b) a 1:N relationship (c) a N:1 relationship (d) a N:M relationship

8.2.4 If an entity appears in not more than 5 relationships then it is a (a) 1:1 relationship (b) 1:5 relationship (c) 5:1 relationship (d) 5:5 relationship 8.2.5 A pilot can fly three types of planes and a plane can be piloted by any qualified pilot. The pilot-plane type relationship is (a) N:3 (b) 3:N (c) 1:3 (d) 3:1 8.2.6 A student can take not more than 5 subjects in a semester. The number of students allowed in a subject in a semester is not more than 40. The student ± subject relationship is: (a) 5:40 (b) 40:5 (c) N:5 (d) 40:M

8.2.7 The following E-R diagram is interpreted as follows: (a) A doctor treats upto N patients (b) A doctor treats exactly N patients (c) A doctor may treat upto N patients; Some doctors may not treat any patients (d) A doctor will treat patients based on some conditions

8.2.8 A relation is (a) an entity (b) a relationship (c) members of a relationship set (d) members of an entity set or a relationship set 8.2.9 Rows of a relation are called (a) tuples (b) a relation row (c) a data structure (d) an entity 8.2.10 The rows of a relation (a) must be in specified order (b) may be in any order (c) in ascending order of key (d) in descending order of key 8.2.11 The columns of a relation (a) must be in specified order (b) may be in any order (c) with key field in first column (d) with largest width column last

8.2.12 Relations are used in logical database design because (i) sound theory of relations facilitates systematic design of relational databases (ii) they are very popular (iii) they are flat files and easy to store and retrieve from computer¶s memory (iv) E-R diagrams allow design of relations (a) i and ii (b) i and iii (c) ii and iii (d) iii and iv 8.2.1 b 8.2.4 b 8.2.2 a 8.2.5 a 8.2.3 b 8.2.6 b

8.2.7 c

8.2.8 d

8.2.9 a

8.2.10 b

8.2.11 b

8.2.12 b

8.3.1 Normalization is a process of restructuring a relation to (a) minimize duplication of data in a database (b) maximize duplication of data to ensure reliability (c) make it of uniform size (d) allow addition of data 8.3.2 Normalization of database is essential to (i) avoid accidental deletion of required data when some data is deleted (ii) eliminate inconsistencies when a data item is modified in the database (iii) allows storage of data in a computer¶s disk (iv) use a database management system (a) i and iii (b) i and ii (c) ii and iii (d) ii and iv 8.3.3 The process of normalization (a) is automatic using a computer program (b) requires one to understand dependency between attributes (c) is manual and requires semantic information (d) is finding the key of a relation

8.3.4 The following relation is not normalized because

(a) It is difficult to store due to non±uniform size of the attributes (b) Roll no. 4568 have 3 course line whereas Roll no. 4954 has only one course line (c) The composite attribute (CS 101, C.S., 1) is repeated (d) Some item lines have composite attributes 8.3.5 The relation given in Exercise 10.4.4 may be converted to 1 NF relation by (a) eliminating composite attributes (b) eliminating common attributes (c) duplicating common attributes as many times as lines in corresponding attributes (d) putting composite attributes in a separate table

8.3.6 A relation is said to be in 1NF if (a) there is no duplication of data (b) there are no composite attributes in the relation (c) there are only a few composite attributes (d) all attributes are of uniform type 8.3.7 The number of normal forms which has been proposed and discussed in the book are (a) 3 (b) 4 (c) 5 (d) 6 8.3.8 A relation which is in a higher normal form (a) implies that it also qualifies to be in lower normal form (b) does not necessarily satisfy the conditions of lower normal form (c) is included in the lower normal form (d) is independent of lower normal forms 8.3.9 Given an attribute x, another attribute y is dependent on it, if for a given x (a) there are many y values (b) there is only one value of y (c) there is one or more y values (d) there is none or one y value

8.3.10 An attribute y may be functionally dependent on (i) a composite attribute x,y (ii) a single attribute x (iii) no attribute (a) i and ii (b) i and iii (c) ii and iii (d) iii 8.3.11 A second Normal Form (2 NF) relation should (a) be in 1 NF (b) not have a composite key (c) not have attributes dependent on key attribute (d) not have attributes dependent on one another 8.3.12 A relation is said to be in 2 NF if (i) it is in 1 NF (ii) non-key attributes dependent on key attribute (iii) non-key attributes are independent of one another (iv) if it has a composite key, no non-key attribute should be dependent on part of the composite key (a) i, ii, iii (b) i and ii (c) i, ii, iv (d) i, iv

8.3.13 Given the following relation vendor order (vendor no, order no, vendor name, qty supplied, price/unit) it is not in 2 NF because (a) it is not in 1 NF (b) it has a composite key (c) non-key attribute vendor name is dependent on vendor no. which is one part of the composite key (d) Qty supplied and price/unit are dependent 8.3.14 Given the following relation vendor order (vendor no, order no, vendor name, qty supplied , price/unit) the second normal form relations are (a) vendor (vendor no, vendor name) qty (qty supplied, price/unit) order (order no, qty supplied) (b) vendor (vendor no, vendor name) order (order no, qty supplied, price/unit) (c) vendor (vendor no, vendor name) order (order no, qty supplied, price/unit) vendor order (vendor no, order no) (d) vendor (vendor no, vendor name, qty supplied, price/unit) vendor order (order no, vendor no) 8.3.15 A third Normal Form (3 NF) relation should (a) be in 2 NF (b) not have complete key (c) not be 1 NF (d) should not have non-key attributes depend on key attribute

8.3.16 A relation is said to be in 3 NF if (i) it is in 2 NF (ii) non-key attributes are independent of one another (iii) key attribute is not dependent on part of a composite key (iv) has no multi-valued dependency (a) i and iii (b) i and iv (c) i and ii (d) ii and iv

8.3.17 Given the following relation it is not 3 NF because Student (roll no, name, course no, course max. marks, year of study, address) (a) it is not in 2 NF (b) it does not have composite key (c) non-key attributes course no and course max. marks are functionally dependent (d) it has more than 3 non-key attributes

8.3.18 Given the following relation Student (roll no, name, course no, course max. marks, year of study, address) The corresponding 3 NF relations are (a) student (roll no, name, year of study, address) course (course no, course max. marks) (b) student ( roll no, name, year of study, address) student (roll no, course no) course (course no, course max. marks) (c) student (roll no , name, address) year (roll no, year of study) course (course no, course max. marks) (d) student (roll no, name, address) course (course no, course max. marks, year of study) 8.3.19 Boye Codd Normal Form (BCNF) is needed when (a) two non-key attributes are dependent (b) there is more then one possible composite key (c) there are two or more possible composite overlapping keys and one attribute of a composite key is dependent on an attribute of another composite key (d) there are two possible keys and they are dependent on one another 8.3.20 A relation is said to be in BCNF when (a) it has overlapping composite keys (b) it has no composite keys (c) it has no multivalued dependencies (d) it has no overlapping composite keys which have related attributes

8.3.21 A 3 NF relation is converted to BCNF by (a) removing composite keys (b) removing multivalued dependencies (c) dependent attributes of overlapping composite keys are put in a separate relation (d) dependent non-key attributes are put in a separate table 8.3.22 BCNF is needed because (a) otherwise tuples may be duplicated (b) when a data is deleted tuples may be lost (c) updating is otherwise difficult (d) when there is dependent attributes in two possible composite keys one of the attributes is unnecessarily duplicated in the tuples 8.3.23 Given the relation Supplier(s_id, p_order, s_name, qty) Given that there is a unique s_name for each s_id and that s_id, p_order is a composite key, find the correct statement among the following: (i) this relation is a BCNF (ii) this is 3 NF relation (iii) this is a 2 NF relation (iv) this is a 1 NF relation (a) i and ii (b) ii and iii (c) i and iv (d) i and iii

8.3.24 Given the relation of Exercise 10.7.5 it is reduced to the following BCNF relation (a) Supplier (s_ids, s_name) Purchase (s_id, p_order, qty) (b) Supplier (s_id, s_name) Purchase (p_order, qty) (c) Purchase (s_id, p_order) Supplier (s_name, qty) (d) Supplier (s_id, s_name, qty) Purchase (s_id, p_order) 8.3.25 Fourth normal form (4 NF) relations are needed when (a) there are multivalued dependencies between attributes in composite key (b) there are more than one composite key (c) there are two or more overlapping composite keys (d) there are multivalued dependency between non-key attributes 8.3.26 A 3 NF relation is split into 4 NF (a) by removing overlapping composite keys (b) by splitting into relations which do not have more than one independent multivalued dependency (c) removing multivalued dependency (d) by putting dependent non-key attribute in a separate table

8.3.27 A relation project guidance Project Guidance(professor, project, student no. st-name, dept) A professor can give many projects to many students A project will have many students A project may be guided by many professors The 4 NF relation corresponding to this are (a) Prof_Project (professor, st_name, dept) Proj_stud (project, student no.) (b) Prof_stud (professor, student no) Proj_stud (project, student no) Student (student no, st_name, dept) (c) Student (student no, st_name, dept) Professor(professor, project) (d) Professor( professor, project, dept) Student (student no, st_name, dept) 8.3.28 The project guidance relation of Exercise 10.8.3 needs further normalization to 5 NF because (a) There are too many multivalued dependencies (b) Multivalued dependency and simple dependency are mixed in the 4 NF relation (c) Spurious tuples got introduced when the 4 NF relations are combined due to the fact that a professor can guide only specified projects (d) 4 NF relations have composite keys

8.3.29 5 NF relations equivalent to the relation of Exercise 10.8.3 are (a) Prof_stud (professor, student_no) Proj_stud ( project, student_no) Prof_proj (professor, project) Student (student_no, st_name, dept) (b) Professor (professor, professor details) Student (student_no, st_name, dept) Project (project no, project details) (c) Prof_stud (professor, student_no ) Prof_proj (professor, project) (d) Prof_stud (professor, student_no) Stud_proj (student_no, project) Student (student_no, st_name, dept) 8.3.1 a 8.3.5 c 8.3.9 b 8.3.13 c 8.3.17 c 8.3.21 c 8.3.25 a 8.3.2 b 8.3.6 b 8.3.10 a 8.3.14 c 8.3.18 b 8.3.22 d 8.3.26 b 8.3.29 a 8.3.3 b 8.3.7 d 8.3.11 a 8.3.15 a 8.3.19 c 8.3.23 d 8.3.27 b 8.3.4 d 8.3.8 a 8.3.12 c 8.3.16 c 8.3.20 d 8.3.24 a 8.3.28 c

8.4.1 The ORDER PLACED FOR relation in Mini-case example 1 has the composite key order no, item code because (a) item code has a multivalued dependency with order no. (b) the non-key attributes are dependent on the composite key order no, item code (c) if order no is the only key we cannot find qty. ordered, price/unit, delivery time (d) if item code is the only key we cannot find order no. uniquely 8.4.2 The relation SUPPLIES in Mini-case example 1 of Section 10.10 requires normalization because (a) it has a composite key with three attributes (b) the non-key attributes are dependent on part of composite key (c) the attributes item code and order no of the composite key have multivalued dependency (d) vendor code and order no have a multivalued dependency

8.4.3 TEACHES-COURSES relation in Mini-case example 2 is in (a) 3 NF. Does not need any further normalization (b) BCNF (c) 4 NF (d) unnormalized form 8.4.4 TEACHER-STUDENT relation in Mini-case example 2 is required because (a) it is in 3 NF (b) it has a multivalued key (c) it has a composite key with multivalued dependency relation (d) Without this relation database is incomplete and some queries cannot be answered 8.4.1 8.4.2 8.4.3 8.4.4 a c a d

8.5.1 By redundancy in a file based system we mean that (a) unnecessary data is stored (b) same data is duplicated in many files (c) data is unavailable (d) files have redundant data 8.5.2 Data integrity in a file based system may be lost because (a) the same variable may have different values in different files (b) files are duplicated (c) unnecessary data is stored in files (d) redundant data is stored in files 8.5.3 Data availability is often difficult in file based system (a) as files are duplicated (b) as unnecessary data are stored in files (c) as one has to search different files and these files may be in different update states (d) redundant data are stored in files

8.5.4 Management policy changes are difficult to implement in a file based system because (a) relating data in different files is difficult (b) files are duplicated (c) redundant data are stored (d) unnecessary data is stored 8.5.5 Some of the objectives of a database management system are to (i) minimize duplication of data (ii) ensure centralized management control of data (iii) ease retrieval of data (iv) maintain a data dictionary (a) i and ii (b) i, ii and iv (c) i and iii (d) i, ii and iii 8.5.6 A database is a (a) collection of files (b) collection of inputs and outputs of application (c) collection of related data necessary to manage an organization (d) data resource of an organization 8.5.7 A database models data so that it is (a) appropriate for application (b) independent of application program (c) optimized for most frequent applications (d) optimized for all applications

8.5.8 A database should be designed to allow providing (a) different views of portions of data requested by an application (b) data only to selected applications as decided by an organization (c) a uniform view of data to all applications (d) data to all applications 8.5.9 The abbreviation DBMS stands for (a) Data Base Manipulation System (b) Data Bank Manipulating System (c) Data Base Management System (d) Data Bank Management System 8.5.10 A DBMS is (a) another name for database system (b) independent of a database (c) dependent on application programs (d) is a set of procedures which manage a database 8.5.11 A DBMS (a) is a set of procedures (b) manages a database (c) is a set of procedures to manage a database to provide data as required by applications (d) provides data to applications

8.5.12 One of the main objectives of a DBMS is to (a) Create a database for an organization (b) Facilitate sharing of a database by current and future applications (c) Allow sharing application programs (d) Replace file based systems 8.5.13 Database is (a) an important resource of an organization (b) not relevant to existing programs (c) not relevant for future programs (d) not as good as files as there is redundancy 8.5.14 By data independence we mean application programs (a) do not need data (b) may be developed independent of data (c) may be developed without knowing the organization of data (d) may be developed with independent data 8.5.15 Data independence allows (i) no changes in application programs (ii) change in database without affecting application programs (iii) hardware to be changed without affecting application programs (iv) system software to be changed without affecting application programs (a) i, ii (b) ii, iii (c) ii, iii, iv (d) i, ii, iv

8.5.16 Data independence allows (a) sharing the same database by several applications (b) extensive modification of applications (c) no data sharing between applications (d) elimination of several application programs 8.5.17 Among objectives of DBMS are ensuring (i) data integrity (ii) data redundancy (iii) data security (iv) easy data retrieval (a) i, ii (b) i, iii (c) i, iii, iv (d) i, ii, iii 8.5.18 DBMS (a) does not allow replication of data (b) allows controlled replication of data if it improves performance (c) does not allow common data to be duplicated (d) does not allow replication as it adversely affects reliability 8.5.19 By data integrity we mean (a) maintaining consistent data values (b) integrated data values (c) banning improper access to data (d) not leaking data values

8.5.20 Data integrity is ensured by (a) good data editing (b) propagating data changes to all data items (c) preventing unauthorized access (d) preventing data duplication 8.5.21 By data security in DBMS we mean (a) preventing access to data (b) allowing access to data only to authorized users (c) preventing changing data (d) introducing integrity constraints 8.5.22 DBMS must implement management controls to (i) control access rights to users (ii) implement audit trail when changes are made (iii) allow data to be used extensively in the organization (iv) duplicate databases (a) i, ii (b) ii, iii (c) iii, iv (d) i, iv 8.5.1 b 8.5.2 a 8.5.3 c 8.5.4 a 8.5.6 c 8.5.7 b 8.5.8 a 8.5.9 c 8.5.11 c 8.5.12 b 8.5.13 a 8.5.14 c 8.5.16 a 8.5.17 c 8.5.18 b 8.5.19 a 8.5.21 b 8.5.22 a

8.5.5 d 8.5.10 d 8.5.15 c 8.5.20 b

8.6.1 An E-R modelling for given application leads to (a) conceptual data model (b) logical data model (c) external data model (d) internal data model 8.6.2 A conceptual data model is converted using a Relational Data Base Management System to a (a) logical data model (b) external data model (c) internal data model (d) an entity-relation data model 8.6.3 A subset of logical data model accessed by programmers is called a (a) conceptual data model (b) external data model (c) internal data model (d) an entity-relation data model

8.6.4 When a logical model is mapped into a physical storage such as a disk store the resultant data model is known as (a) conceptual data model (b) external data model (c) internal data model (d) disk data model 8.6.5 A DBMS has the following components (i) a data definition language (ii) a query language (iii) a security system (iv) audit trail (a) i, ii (b) i, ii, iii (c) i, ii, iii, iv (d) i, ii, iv 8.6.6 A check pointing system is needed (a) to ensure system security (b) to recover from transient faults (c) to ensure system privacy (d) to ensure system integrity

8.6.7 A database administrator (a) administers data in an organization (b) controls all inputs and all outputs of programs (c) is controller of data resources of an organization (d) controls all data entry operators 8.6.8 The responsibilities of a database administrator includes (i) maintenance of data dictionary (ii) ensuring security of database (iii) ensuring privacy and integrity of data (iv) obtain an E-R model (a) i, ii (b) i, ii, iii (c) i, ii, iii, iv (d) ii, iii, iv 8.6.9 Access right to a database is controlled by (a) top management (b) system designer (c) system analyst (d) database administrator 8.6.10 The sequence followed in designing a DBMS are (a) physical model conceptual model logical model (b) logical model physical model conceptual model (c) conceptual model logical model physical model (d) conceptual model physical model logical model

8.6.11 Designing physical model of DBMS requires information on (i) data volume (ii) frequency of access to data (iii) programming language used (iv) secondary memory characteristics (a) i, ii (b) i, ii, iii (c) i, ii, iii, iv (d) i, ii, iv 8.6.12A good database design (i) caters primarily to current needs (ii) caters to current and future needs as organizations grow (iii) has to be modified when hardware is upgraded (iv) ensures data security (a) i, ii (b) i, ii, iii (c) ii, iv (d) iii, iv 8.6.13 A good database design (i) is expandable with growth and changes in organization (ii) easy to change when software changes (iii) ensures data integrity (iv) allows access to only authorized users (a) i, ii (b) ii, iii (c) i, ii, iii, iv (d) i, ii, iii

8.6.1 a 8.6.2 a 8.6.3 b 8.6.4 c 8.6.5 c 8.6.6 b 8.6.7 c 8.6.8 b 8.6.9 d 8.6.10 c 8.6.11 d 8.6.12 c 8.6.13 c

1.List the system calls used for process management:

Answer: System calls Description fork() To create a new process exec() To execute a new program in a process wait() To wait until a created process completes its execution exit() To exit from a process execution getpid() To get a process identifier of the current process getppid() To get parent process identifier nice() To bias the existing priority of a process brk() To increase/decrease the data segment size of a process

How can you get/set an environment variable from a program? Answer: Getting the value of an environment variable is done by using 'getenv()'. Setting the value of an environment variable is done by using 'putenv()'. How can a parent and child process communicate? Answer:

A parent and child can communicate through any of the normal inter-process communication schemes (pipes, sockets, message queues, shared memory), but also have some special ways to communicate that take advantage of their relationship as a parent and child. One of the most obvious is that the parent can get the exit status of the child.
What is a zombie? Answer:

When a program forks and the child finishes before the parent, the kernel still keeps some of its information about the child in case the parent might need it for example, the parent may need to check the child's exit status. To be able to get this information, the parent calls 'wait()'; In the interval between the child terminating and the parent calling 'wait()', the child is said to be a 'zombie' (If you do 'ps', the child will have a 'Z' in its status field to indicate this.)

What are the process states in Unix? Answer: As a process executes it changes state according to its circumstances. Unix processes have the following states: Running : The process is either running or it is ready to run . Waiting : The process is waiting for an event or for a resource. Stopped : The process has been stopped, usually by receiving a signal. Zombie : The process is dead but have not been removed from the process table. What Happens when you execute a program? Answer:
When you execute a program on your UNIX system, the system creates a special environment for that program. This environment contains everything needed for the system to run the program as if no other program were running on the system. Each process has process context, which is everything that is unique about the state of the program you are currently running. Every time you execute a program the UNIX system does a fork, which performs a series of operations to create a process context and then execute your program in that context. The steps include the following: Allocate a slot in the process table, a list of currently running programs kept by UNIX. Assign a unique process identifier (PID) to the process. iCopy the context of the parent, the process that requested the spawning of the new process. Return the new PID to the parent process. This enables the parent process to examine or control the process directly. After the fork is complete, UNIX runs your program.

What Happens when you execute a command? Answer: When you enter 'ls' command to look at the contents of your current working directory, UNIX does a series of things to create an environment for ls and the run it: The shell has UNIX perform a fork. This creates a new process that the shell will use to run the ls program. The shell has UNIX perform an exec of the ls program. This replaces the shell program and data with the program and data for ls and then starts running that new program. The ls program is loaded into the new process context, replacing the text and data of the shell. The ls program performs its task, listing the contents of the current directory. What is a Daemon? Answer: A daemon is a process that detaches itself from the terminal and runs, disconnected, in the background, waiting for requests and responding to them. It can also be defined as the background process that does not belong to a terminal session. Many system functions are commonly performed by daemons, including the sendmail daemon, which handles mail, and the NNTP daemon, which handles USENET news. Many other daemons may exist. Some of the most common daemons are: init: Takes over the basic running of the system when the kernel has finished the boot process. inetd: Responsible for starting network services that do not have their own stand-alone daemons. For example, inetd usually takes care of incoming rlogin, telnet, and ftp connections. cron: Responsible for running repetitive tasks on a regular schedule.

What is 'ps' command for? Answer: The ps command prints the process status for some or all of the running processes. The information given are the process identification number (PID),the amount of time that the process has taken to execute so far etc. How would you kill a process? Answer: The kill command takes the PID as one argument; this identifies which process to terminate. The PID of a process can be got using 'ps' command. What is an advantage of executing a process in background? Answer:
The most common reason to put a process in the background is to allow you to do something else interactively without waiting for the process to complete. At the end of the command you add the special background symbol, &. This symbol tells your shell to execute the given command in the background. Example: cp *.* ../backup& (cp is for copy)

How do you execute one program from within another? Answer: The system calls used for low-level process creation are execlp() and execvp(). The execlp call overlays the existing program with the new one , runs that and exits. The original program gets back control only when an error occurs. execlp(path,file_name,arguments..); //last argument must be NULL A variant of execlp called execvp is used when the number of arguments is not known in advance. execvp(path,argument_array); //argument array should be terminated by NULL What is IPC? What are the various schemes available? Answer: The term IPC (Inter-Process Communication) describes various ways by which different process running on some operating system communicate between each other. Various schemes available are as follows: Pipes: One-way communication scheme through which different process can communicate. The problem is that the two processes should have a common ancestor (parent-child relationship). However this problem was fixed with the introduction of named-pipes (FIFO). Message Queues : Message queues can be used between related and unrelated processes running on a machine. Shared Memory: This is the fastest of all IPC schemes. The memory to be shared is mapped into the address space of the processes (that are sharing). The speed achieved is attributed to the fact that there is no kernel involvement. But this scheme needs synchronization. Various forms of synchronisation are mutexes, condition-variables, read-write locks, recordlocks, and semaphores.

What is the difference between Swapping and Paging? Answer: Swapping: whole process is moved from the swap device to the main memory for execution. Process size must be less than or equal to the available main memory. It is easier to implementation and overhead to the system. Swapping systems does not handle the memory more flexibly as compared to the paging systems. Paging: Only the required memory pages are moved to main memory from the swap device for execution. Process size does not matter. Gives the concept of the virtual memory. It provides greater flexibility in mapping the virtual address space into the physical memory of the machine. Allows more number of processes to fit in the main memory simultaneously. Allows the greater process size than the available physical memory. Demand paging systems handle the memory more flexibly. What is major difference between the Historic Unix and the new BSD release of Unix System V in terms of Memory Management? Answer: Historic Unix uses Swapping â½´ entire process is transferred to the main memory from the swap device, whereas the Unix System V uses Demand Paging â½´ only the part of the process is moved to the main memory. Historic Unix uses one Swap Device and Unix System V allow multiple Swap Devices.

What is the main goal of the Memory Management? Answer: It decides which process should reside in the main memory, Manages the parts of the virtual address space of a process which is non-core resident, Monitors the available main memory and periodically write the processes into the swap device to provide more processes fit in the main memory simultaneously. What is a Map? Answer: A Map is an Array, which contains the addresses of the free space in the swap device that are allocatable resources, and the number of the resource units available there. This allows First-Fit allocation of contiguous blocks of a resource. Initially the Map contains one entry â¼³ address (block offset from the starting of the swap area) and the total number of resources. Kernel treats each unit of Map as a group of disk blocks. On the allocation and freeing of the resources Kernel updates the Map for accurate information. What scheme does the Kernel in Unix System V follow while choosing a swap device among the multiple swap devices? Answer: Kernel follows Round Robin scheme choosing a swap device among the multiple swap devices in Unix System V. What is a Region? Answer: A Region is a continuous area of a process's address space (such as text, data and stack). The kernel in a 'Region Table' that is local to the process maintains region. Regions are sharable among the process.

What are the events done by the Kernel after a process is being swapped out from the main memory? Answer: When Kernel swaps the process out of the primary memory, it performs the following: Kernel decrements the Reference Count of each region of the process. If the reference count becomes zero, swaps the region out of the main memory, Kernel allocates the space for the swapping process in the swap device, Kernel locks the other swapping process while the current swapping operation is going on, The Kernel saves the swap address of the region in the region table.
Is the Process before and after the swap are the same? Give reason. Answer: Process before swapping is residing in the primary memory in its original form. The regions (text, data and stack) may not be occupied fully by the process, there may be few empty slots in any of the regions and while swapping Kernel do not bother about the empty slots while swapping the process out. After swapping the process resides in the swap (secondary memory) device. The regions swapped out will be present but only the occupied region slots but not the empty slots that were present before assigning. While swapping the process once again into the main memory, the Kernel referring to the Process Memory Map, it assigns the main memory accordingly taking care of the empty slots in the regions. What do you mean by u-area (user area) or u-block? Answer: This contains the private data that is manipulated only by the Kernel. This is local to the Process, i.e. each process is allocated a u-area.

What are the entities that are swapped out of the main memory while swapping the process out of the main memory? Answer: All memory space occupied by the process, process's u-area, and Kernel stack are swapped out, theoretically. Practically, if the process's u-area contains the Address Translation Tables for the process then Kernel implementations do not swap the u-area. What is Fork swap? Answer: fork() is a system call to create a child process. When the parent process calls fork() system call, the child process is created and if there is short of memory then the child process is sent to the read-to-run state in the swap device, and return to the user state without swapping the parent process. When the memory will be available the child process will be swapped into the main memory.

What is Expansion swap? Answer: At the time when any process requires more memory than it is currently allocated, the Kernel performs Expansion swap. To do this Kernel reserves enough space in the swap device. Then the address translation mapping is adjusted for the new virtual address space but the physical memory is not allocated. At last Kernel swaps the process into the assigned space in the swap device. Later when the Kernel swaps the process into the main memory this assigns memory according to the new address translation mapping. Questions on memory management in uinx How the Swapper works? Answer: The swapper is the only process that swaps the processes. The Swapper operates only in the Kernel mode and it does not uses System calls instead it uses internal Kernel functions for swapping. It is the archetype of all kernel process. What are the processes that are not bothered by the swapper? Give Reason. Answer: Zombie process: They do not take any up physical memory. Processes locked in memories that are updating the region of the process. Kernel swaps only the sleeping processes rather than the 'ready-to-run' processes, as they have the higher probability of being scheduled than the Sleeping processes. What are the requirements for a swapper to work? Answer: The swapper works on the highest scheduling priority. Firstly it will look for any sleeping process, if not found then it will look for the ready-to-run process for swapping. But the major requirement for the swapper to work the ready-to-run process must be core-resident for at least 2 seconds before swapping out. And for swapping in the process must have been resided in the swap device for at least 2 seconds. If the requirement is not satisfied then the swapper will go into the wait state on that event and it is awaken once in a second by the Kernel.

What are the criteria for choosing a process for swapping into memory from the swap device? Answer: The resident time of the processes in the swap device, the priority of the processes and the amount of time the processes had been swapped out. What are the criteria for choosing a process for swapping out of the memory to the swap device? Answer: The process's memory resident time, Priority of the process and The nice value. What do you mean by nice value? Answer: Nice value is the value that controls {increments or decrements} the priority of the process. This value that is returned by the nice () system call. The equation for using nice value is: Priority = ("recent CPU usage"/constant) + (base- priority) + (nice value) Only the administrator can supply the nice value. The nice () system call works for the running process only. Nice value of one process cannot affect the nice value of the other process. What are conditions on which deadlock can occur while swapping the processes? Answer: All processes in the main memory are asleep. All 'ready-to-run' processes are swapped out. There is no space in the swap device for the new incoming process that are swapped out of the main memory. There is no space in the main memory for the new incoming process.

What are conditions for a machine to support Demand Paging? Answer: Memory architecture must based on Pages, The machine must support the 'restartable' instructions. What is 'the principle of locality'? Answer: It's the nature of the processes that they refer only to the small subset of the total data space of the process. i.e. the process frequently calls the same subroutines or executes the loop instructions. What is the working set of a process? Answer: The set of pages that are referred by the process in the last 'n', references, where 'n' is called the window of the working set of the process. What is the window of the working set of a process? Answer: The window of the working set of a process is the total number in which the process had referred the set of pages in the working set of the process.

What is called a page fault? Answer: Page fault is referred to the situation when the process addresses a page in the working set of the process but the process fails to locate the page in the working set. And on a page fault the kernel updates the working set by reading the page from the secondary device. What are data structures that are used for Demand Paging? Answer: Kernel contains 4 data structures for Demand paging. They are, Page table entries, Disk block descriptors, Page frame data table (pfdata), Swap-use table. What are the bits that support the demand paging? Answer: Valid, Reference, Modify, Copy on write, Age. These bits are the part of the page table entry, which includes physical address of the page and protection bits.

How the Kernel handles the fork() system call in traditional Unix and in the System V Unix, while swapping? Answer: Kernel in traditional Unix, makes the duplicate copy of the parent's address space and attaches it to the child's process, while swapping. Kernel in System V Unix, manipulates the region tables, page table, and pfdata table entries, by incrementing the reference count of the region table of shared regions. Difference between the fork() and vfork() system call? Answer: During the fork() system call the Kernel makes a copy of the parent process's address space and attaches it to the child process. But the vfork() system call do not makes any copy of the parent's address space, so it is faster than the fork() system call. The child process as a result of the vfork() system call executes exec() system call. The child process from vfork() system call executes in the parent's address space (this can overwrite the parent's data and stack ) which suspends the parent process until the child process exits. What is BSS(Block Started by Symbol)? Answer: A data representation at the machine level, that has initial values when a program starts and tells about how much space the kernel allocates for the un-initialized data. Kernel initializes it to zero at run-time. What is Page-Stealer process? Answer: This is the Kernel process that makes rooms for the incoming pages, by swapping the memory pages that are not the part of the working set of a process. Page-Stealer is created by the Kernel at the system initialization and invokes it throughout the lifetime of the system. Kernel locks a region when a process faults on a page in the region, so that page stealer cannot steal the page, which is being faulted in. Name two paging states for a page in memory? Answer: The two paging states are: The page is aging and is not yet eligible for swapping, The page is eligible for swapping but not yet eligible for reassignment to other virtual address space.

What are the phases of swapping a page from the memory? Answer: Page stealer finds the page eligible for swapping and places the page number in the list of pages to be swapped. Kernel copies the page to a swap device when necessary and clears the valid bit in the page table entry, decrements the pfdata reference count, and places the pfdata table entry at the end of the free list if its reference count is 0. What is page fault? Its types? Answer: Page fault refers to the situation of not having a page in the main memory when any process references it. There are two types of page fault : Validity fault, Protection fault. In what way the Fault Handlers and the Interrupt handlers are different? Answer: Fault handlers are also an interrupt handler with an exception that the interrupt handlers cannot sleep. Fault handlers sleep in the context of the process that caused the memory fault. The fault refers to the running process and no arbitrary processes are put to sleep. What is validity fault? Answer: If a process referring a page in the main memory whose valid bit is not set, it results in validity fault. The valid bit is not set for those pages: that are outside the virtual address space of a process, that are the part of the virtual address space of the process but no physical address is assigned to it.

What does the swapping system do if it identifies the illegal page for swapping? Answer: If the disk block descriptor does not contain any record of the faulted page, then this causes the attempted memory reference is invalid and the kernel sends a "Segmentation violation" signal to the offending process. This happens when the swapping system identifies any invalid memory reference. What are states that the page can be in, after causing a page fault? Answer: On a swap device and not in memory, On the free page list in the main memory, In an executable file, Marked "demand zero", Marked "demand fill". In what way the validity fault handler concludes? Answer: It sets the valid bit of the page by clearing the modify bit. It recalculates the process priority. At what mode the fault handler executes? Answer: At the Kernel Mode. What do you mean by the protection fault? Answer: Protection fault refers to the process accessing the pages, which do not have the access permission. A process also incur the protection fault when it attempts to write a page whose copy on write bit was set during the fork() system call.

How the Kernel handles the copy on write bit of a page, when the bit is set?

Answer: In situations like, where the copy on write bit of a page is set and that page is shared by more than one process, the Kernel allocates new page and copies the content to the new page and the other processes retain their references to the old page. After copying the Kernel updates the page table entry with the new page number. Then Kernel decrements the reference count of the old pfdata table entry. In cases like, where the copy on write bit is set and no processes are sharing the page, the Kernel allows the physical page to be reused by the processes. By doing so, it clears the copy on write bit and disassociates the page from its disk copy (if one exists), because other process may share the disk copy. Then it removes the pfdata table entry from the page-queue as the new copy of the virtual page is not on the swap device. It decrements the swap-use count for the page and if count drops to 0, frees the swap space.
For which kind of fault the page is checked first? Answer:

The page is first checked for the validity fault, as soon as it is found that the page is invalid (valid bit is clear), the validity fault handler returns immediately, and the process incur the validity page fault. Kernel handles the validity fault and the process will incur the protection fault if any one is present.
In what way the protection fault handler concludes? Answer: After finishing the execution of the fault handler, it sets the modify and protection bits and clears the copy on write bit. It recalculates the process-priority and checks for signals.

How the Kernel handles both the page stealer and the fault handler? Answer: The page stealer and the fault handler thrash because of the shortage of the memory. If the sum of the working sets of all processes is greater that the physical memory then the fault handler will usually sleep because it cannot allocate pages for a process. This results in the reduction of the system throughput because Kernel spends too much time in overhead, rearranging the memory in Predict the output or error(s) for the following: void main() { int const * p=5; printf("%d",++(*p)); } Answer: Compiler error: Cannot modify a constant value. Explanation: p is a pointer to a "constant integer". But we tried to change the value of the "constant integer".

main() { char s[ ]="man"; int i; for(i=0;s[ i ];i++) printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]); } Answer: mmmm aaaa nnnn Explanation: s[i], *(i+s), *(s+i), i[s] are all different ways of expressing the same idea. Generally array name is the base address for that array. Here s is the base address. i is the index number/displacement from the base address. So, indirecting it with * is same as s[i]. i[s] may be surprising. But in the case of C it is same as s[i]. main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); } Answer: I hate U Explanation: For floating point numbers (float, double, long double) the values cannot be predicted exactly. Depending on the number of bytes, the precession with of the value represented varies. Float takes 4 bytes and long double takes 10 bytes. So float stores 0.9 with less precision than long double. Rule of Thumb: Never compare or at-least be cautious when using floating point numbers with relational operators (== , >, <, <=, >=,!= ).

main() { static int var = 5; printf("%d ",var--); if(var) main(); } Answer: 54321 Explanation: When static storage class is given, it is initialized once. The change in the value of a static variable is retained even between the function calls. Main is also treated like any other ordinary function, which can be called recursively. main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) {printf(" %d ",*c); ++q; } for(j=0;j<5;j++){printf(" %d ",*p); ++p; }} Answer: 2222223465 Explanation: Initially pointer c is assigned to both p and q. In the first loop, since only q is incremented and not c , the value 2 will be printed 5 times. In second loop p itself is incremented. So the values 2 3 4 6 5 will be printed.

main(){ extern int i; i=20; printf("%d",i);} Answer: Linker Error : Undefined symbol '_i' Explanation: extern storage class in the following declaration, extern int i; specifies to the compiler that the memory for i is allocated in some other program and that address will be given to the current program at the time of linking. But linker finds that no other variable of name i is available in any other program with memory space allocated for it. Hence a linker error has occurred . main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); } Answer: 00131 Explanation : Logical operations always give a result of 1 or 0 . And also the logical AND (&&) operator has higher priority over the logical OR (||) operator. So the expression 'i++ && j++ && k++' is executed first. The result of this expression is 0 (-1 && -1 && 0 = 0). Now the expression is 0 || 2 which evaluates to 1 (because OR operator always gives 1 except for '0 || 0' combination- for which it gives 0). So the value of m is 1.

main() { int i=3;

other var{ char *p; printf("%d %d ",sizeof(*p),sizeof(p)); } Answer: 12 Explanation: The sizeof() operator gives the number of bytes taken by its operand. P is a character pointer, which needs one byte for storing its value (a character). Hence sizeof(*p) gives a value of 1. Since it needs two bytes to store the address of the character pointer sizeof(p) gives 2.

switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } } Answer : three Explanation : The default case can be placed anywhere inside the loop. It is executed only when all other cases doesn't match.

main() { printf("%x",-1<<4); } Answer: fff0 Explanation : -1 is internally represented as all 1's. When left shifted four times the least significant 4 bits are filled with 0's.The %x format specifier specifies that the integer value be printed as a hexadecimal value. main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); } Answer: Compiler Error : Type mismatch in redeclaration of function display Explanation : In third line, when the function display is encountered, the compiler doesn't know anything about the function display. It assumes the arguments and return types to be integers, (which is the default type). When it sees the actual function display, the arguments and type contradicts with what it has assumed previously. Hence a compile time error occurs. iables are also incremented by 1.

main() { int c=- -2; printf("c=%d",c); } Answer: c=2; Explanation: Here unary minus (or negation) operator is used twice. Same maths rules applies, ie. minus * minus= plus. Note: However you cannot give like --2. Because -- operator can only be applied to variables as a decrement operator (eg., i--). 2 is a constant and not a variable. #define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); } Answer: sizeof(i)=1 Explanation: Since the #define replaces the string int by the macro char

main() { int i=10; i=!i>14; printf("i=%d",i); } Answer: i=0 Explanation: In the expression !i>14 , NOT (!) operator has more precedence than â¼× >⼌ symbol. ! is a unary logical operator. !i (!10) is 0 (not of true is false). 0>14 is false (zero). #include½stdio.h¾ main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); } Answer: 77 Explanation: p is pointing to character '\n'. str1 is pointing to character 'a' ++*p. "p is pointing to '\n' and that is incremented by one." the ASCII value of '\n' is 10, which is then incremented to 11. The value of ++*p is 11. ++*str1, str1 is pointing to 'a' that is incremented by 1 and it becomes 'b'. ASCII value of 'b' is 98. Now performing (11 + 98 - 32), we get 77("M"); So we get the output 77 :: "M" (Ascii is 77).

#include½stdio.h¾ main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); } Answer: SomeGarbageValue---1 Explanation: p=&a[2][2][2] you declare only two 2D arrays, but you are trying to access the third 2D(which you are not declared) it will print garbage values. *q=***a starting address of a is assigned integer pointer. Now q is pointing to starting address of a. If you print *q, it will print first element of 3D array. #include½stdio.h¾ main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s; printf("%d",s->x); printf("%s",s->name); } Answer: Compiler Error Explanation: You should not initialize variables in declaration

#include½stdio.h¾ main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; } Answer: Compiler Error Explanation: The structure yy is nested within structure xx. Hence, the elements are of yy are to be accessed through the instance of structure xx, which needs an instance of yy to be known. If the instance is created after defining the structure the compiler will not know about the instance relative to xx. Hence for nested structure yy you have to declare member. main() { printf("\nab"); printf("\bsi"); printf("\rha"); } Answer: hai Explanation: \n - newline \b - backspace \r - linefeed

main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); } Answer: 45545 Explanation: The arguments in a function call are pushed into the stack from left to right. The evaluation is by popping out from the stack. and the evaluation is from right to left, hence the result. #define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); } Answer: 64 Explanation: the macro call square(4) will substituted by 4*4 so the expression becomes i = 64/4*4 . Since / and * has equal priority the expression will be evaluated as (64/4)*4 i.e. 16*4 = 64

main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); } Answer: ibj!gsjfoet Explanation: ++*p++ will be parse in the given order *p that is value at the location currently pointed by p will be taken ++*p the retrieved value will be incremented when ; is encountered the location will be incremented that is p++ will be executed Hence, in the while loop initial value pointed by p is 'h', which is changed to 'i' by executing ++*p and pointer moves to point, 'a' which is similarly changed to 'b' and so on. Similarly blank space is converted to '!'. Thus, we obtain value in p becomes â¼ ibj!gsjfoetâ¼ and since p reaches '\0' and p1 points to p thus p1doesnot print anything. #include½stdio.h¾ #define a 10 main() { #define a 50 printf("%d",a); } Answer: 50 Explanation: The preprocessor directives can be redefined anywhere in the program. So the most recently assigned value will be taken.

#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); } Answer: 100 Explanation: Preprocessor executes as a seperate pass before the execution of the compiler. So textual replacement of clrscr() to 100 occurs.The input program to compiler looks like this : main() { 100; printf("%d\n",100); } Note: 100; is an executable statement but with no action. So it doesn't give any problem main() { printf("%p",main); } Answer: Some address will be printed. Explanation: Function names are just addresses (just like array names are addresses).

main() is also a function. So the address of function main will be printed. %p in printf specifies that the argument is an address. They are printed as hexadecimal numbers. main() { clrscr(); } clrscr(); Answer: No output/error Explanation: The first clrscr() occurs inside a function. So it becomes a function call. In the second clrscr(); is a function declaration (because it is not inside any function). enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); } Answer: 0..1..2 Explanation: enum assigns numbers starting from 0, if not explicitly defined. void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); } Answer: 4..2 Explanation: the second pointer is of char type and not a far pointer

main() { int i=400,j=300; printf("%d..%d"); } Answer: 400..300 Explanation: printf takes the values of the first two assignments of the program. Any number of printf's may be given. All of them take only the first two values. If more number of assignments given in the program,then printf will take garbage values. main() { char *p; p="Hello"; printf("%c\n",*&*p); } Answer: H Explanation: * is a dereference operator & is a reference operator. They can be applied any number of times provided it is meaningful. Here p points to the first character in the string "Hello". *p dereferences it and so its value is H. Again & references it to an address and * dereferences it to the value H.

main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); } Answer: Compiler error: Undefined label 'here' in function main Explanation: Labels have functions scope, in other words The scope of the labels is limited to functions . The label 'here' is available in function fun() Hence it is not visible in function main. main() { static char names[5][20]={"pascal","ada","cobol","fortran","perl"}; int i; char *t; t=names[3]; names[3]=names[4]; names[4]=t; for (i=0;i<=4;i++) printf("%s",names[i]); } Answer: Compiler error: Lvalue required in function main Explanation: Array names are pointer constants. So it cannot be modified.

void main() { int i=5; printf("%d",i++ + ++i); } Answer: Output Cannot be predicted exactly. Explanation: Side effects are involved in the evaluation of i void main() { int i=5; printf("%d",i+++++i); } Answer: Compiler Error Explanation: The expression i+++++i is parsed as i ++ ++ + i which is an illegal combination of operators. #include½stdio.h¾ main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } } Answer: Compiler Error: Constant expression required in function main. Explanation: The case statement can have only constant expressions (this implies that we cannot use variable names directly so an error). Note: Enumerated types can be used in case statements

main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here } Answer: 1 Explanation: Scanf returns number of items successfully read and not 1/0. Here 10 is given as input which should have been scanned successfully. So number of items read is 1. #define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); } Answer: 100 main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); } Answer: 1 Explanation: before entering into the for loop the checking condition is "evaluated". Here it evaluates to 0 (false) and comes out of the loop, and i is incremented (note the semicolon after the for loop).

#include¾stdio.h¿
main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }

Answer: M Explanation: p is pointing to character '\n'.str1 is pointing to character 'a' ++*p meAnswer:"p is pointing to '\n' and that is incremented by one." the ASCII value of '\n' is 10. then it is incremented to 11. the value of ++*p is 11. ++*str1 meAnswer:"str1 is pointing to 'a' that is incremented by 1 and it becomes 'b'. ASCII value of 'b' is 98. both 11 and 98 is added and result is subtracted from 32". i.e. (11+98-32)=77("M");
#include½stdio.h¾ main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }

Answer: Compiler Error Explanation: Initialization should not be done for structure members inside the structure declaration

include½stdio.h¾ main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

Answer: Compiler Error Explanation: in the end of nested structure yy a member have to be declared.
main() { extern int i; i=20; printf("%d",sizeof(i)); } Answer: Linker error: undefined symbol '_i'. Explanation: extern declaration specifies that the variable i is defined somewhere else. The compiler passes the external variable to be resolved by the linker. So compiler doesn't find an error. During linking the linker searches for the definition of i. Since it is not found the linker flags an error.

main() { printf("%d", out); } int out=100; Answer: Compiler error: undefined symbol out in function main. Explanation: The rule is that a variable is available for use from the point of declaration. Even though a is a global variable, it is not available for main. Hence an error. main() { extern out; printf("%d", out); } int out=100; Answer: 100 Explanation: This is the correct way of writing the previous program. main() { show(); } void show() { printf("I'm the greatest"); } Answer: Compier error: Type mismatch in redeclaration of show. Explanation: When the compiler sees the function show it doesn't know anything about it. So the default return type (ie, int) is assumed. But when compiler sees the actual definition of show mismatch occurs since it is declared as void. Hence the error. The solutions are as follows: declare void show() in main() . define show() before main(). declare extern void show() before the use of show().

Predict the output or error(s) for the following: class Sample { public: int *ptr; Sample(int i) { ptr = new int(i); } ~Sample() { delete ptr; } void PrintVal() { cout « "The value is " « *ptr; } }; void SomeFunc(Sample x) { cout « "Say i am in someFunc " « endl; } int main() { Sample s1= 10; SomeFunc(s1); s1.PrintVal(); } Answer: Say i am in someFunc Null pointer assignment(Run-time error) Explanation: As the object is passed by value to SomeFunc the destructor of the object is called when the control returns from the function. So when PrintVal is called it meets up with ptr that has been freed.The solution is to pass the Sample object by reference to SomeFunc: void SomeFunc(Sample &x) { cout « "Say i am in someFunc " « endl; } because when we pass objects by refernece that object is not destroyed. while returning from the function.

Which is the parameter that is added to every non-static member function when it is called? Answer: 'this' pointer class base { public: int bval; base(){ bval=0;} }; class deri:public base { public: int dval; deri(){ dval=1;} }; void SomeFunc(base *arr,int size) { for(int i=0; i½size; i++,arr++) cout«arr-¾bval; cout«endl; } int main() { base BaseArr[5]; SomeFunc(BaseArr,5); deri DeriArr[5]; SomeFunc(DeriArr,5); } Answer: 00000 01010 Explanation: The function SomeFunc expects two arguments.The first one is a pointer to an array of base class objects and the second one is the sizeof the array.The first call of someFunc calls it with an array of bae objects, so it works correctly and prints the bval of all the objects. When Somefunc is called the second time the argument passed is the pointeer to an array of derived class objects and not the array of base class objects. But that is what the function expects to be sent. So the derived class pointer is promoted to base class pointer and the address is sent to the function. SomeFunc() knows nothing about this and just treats the pointer as an array of base class objects. So when arr++ is met, the size of base class object is taken into consideration and is incremented by sizeof(int) bytes for bval (the deri class objects have bval and dval as members and so is of size ¾= sizeof(int)+sizeof(int)

You install File and Printer Sharing for Microsoft Networks.You share a folder and leave the password option blank.Who can gain access to the folder a. Anyone who can gain access to your network and has a Microsoft redirector such as the Client for Microsoft Networks installed. b.Windows 98 will not allow a blank password in this field. c.anyone with Internet Explorer installed. d.Only users that are members of the same workgroup as you. Answer: A Some protocols are considered to be technically non-routable.Which of the following statements best describes the most common reason why a protocol would be considered non-routable A. It does not contain the appropriate Data Link layer information required by routers. B. It uses advanced Transport layer services to move across the Internet and avoids the routing overhead required by the more primitive networking protocols. c.It defines Physical layer network addresses for internal routing. D.It does not specify the Network layer addresses required by routers. Answer: D What is the binary network ID of the loopback IP address A. 1 B. 10101010 C. 0 D. 1111111 Answer: D

You are the LAN administrator for your company.You have couple Windows 2000 Professional clients that dial in via PPP to the company network·s RAS server.You want the remote clients to be assigned dynamic IP addresses.You reserve a pool of class B addresses for these clients.Upon connecting, you find that the Windows 2000 computers are using a subnet mask of all 255s.What should you do A. Run ipconfig with the /release and /renew switch on the client B. Run ipconfig with the /renew_all switch on the client C. Run winipcfg on the client D. Do nothing.This is normal Answer: D You are configuring a router.According to the manual, you will need a transceiver to connect to the LAN ports of the router.What kind of physical interface does the router have A. MSAU B. RJ-11 C. AUI D. BNC Answer: C

Which of the following are connectionless protocols.(Choose the three best answers.) A. IP B. SPX C. IPX D. UDP Answer: A, C, D How can Jim Herr, a client on an NT TCP/IP network see which remote hosts are currently connected using NBT A. Use NBTSTAT B. Use NETSTAT C. Use NSLOOKUP D. Use IPCONFIG Answer: A You are setting up a new Windows 98 workstation on your network, and your DHCP server provides all of the normal TCP/IP configuration information.What must you do to configure the IP address on the workstation after you add the TCP/IP protocol A. The DHCP option is enabled automatically, and the server will auto-configure everything. B. Find out what the subnet mask on your network is, and add this information only. C. Manually enter an IP address that is not in use on the network. D. Put the address of the router in the default gateway, and put all 0s in the IP field. Answer: A Which of the following is considered a Network Attached Storage device A. A 60 GB DAT tape drive attached to the Network Server B. A file server with special software that is at a separate location from the departmental file server C. In a Windows NT environment, it would be the Backup Domain Controller D. A high speed specialized sub-network attached to the enterprise Answer: B

Credit card size, designed for notebooks, self-configuring, and non-OS dependent describes which PC bus architecture A. PCI B. ISA C. EISA D. PCMCIA Answer: D What protocol is used between E-Mail servers A. HTTP B. POP3 C. SNMP D. SMTP Answer: D When installing a manually configured adapter, what information must you know to avoid resource conflicts A. IRQ B. Number of bits C. Base I/O port address D. Base Memory address Answer: A, C & D Which of the following OSI layers is responsible for identifying communications partners A. Application B. Session C. Network D. Presentation Answer: A A broadcast message is an example of which dialog control method A. Half duplex B. Baseband C. Broadband D. Simplex Answer: D

A. Which of the following are used to resolve Windows NetBIOS names to IP addresses A. DNS B. WINS C. LMhosts file D. Hosts file Answer: B,C What is a router A. A hardware device that connects dissimilar networks, such as Cat 5 cabling and FDDI B. A network host that reads the source and destination addresses in the packet header and makes decisions about where to forward the packet C. A network host that can forward LAN-based email messages onto the Internet, after repackaging them into the SMTP format D. A software system that can translate between dissimilar networks such as Ethernet and Token Ring Answer: B Which of the following is Class C IP address? A. 10.10.14.118 B. 135.23.112.57 C. 191.200.199.199 D. 204.67.118.54 Answer: D

A Windows 95 user complains that she cannot connect to any other computers on her local subnet even when using the IP address to communicate.However, she can ping 127.0.0.1 and receive a reply.Other users on her subnet do not report having any trouble.All client computers on the network are WINS-enabled.What is the most probable cause of the problem? A. The TCP/IP stack is not installed properly B. The subnet mask is not correct, check whether the subnet mask is configured correctly. C. The default gateway is not configured properly. D. The computer is not configured to use LMHOSTS Answer: B WINS or ___ may be used for NetBIOS name resolution? A. HOSTS B. DNS C. LMHOSTS Answer: C You have set up a server that connects to an Internet services provider ( ISP) over ISDN line.How should the default gateway address be configured so that windows 95 users on the local network can access the Internet through the RAS server.The RAS server is located on the same subnet as that of the WIN95 machines. A. The default Gateway address on WINS95 must specify the IP address of the remote ISP B. The default Gateway on WN95 must specify the IP address of the RAS server on the local network. C. The HOSTS file in WIN95 machines must be configured with the host name of the RAS Server. D. The HOSTS file in WIN 95 machines must be configured with the host name of the ISP Answer: B Which of the following is the standard adopted for Ethernet CSMA/CD by IEEE Committee? A. 802.2 B. 802.1d C. 802.3 D. 802.5 Answer: C Disk Striping with Parity corresponds to which RAID level? A. RAID 0 B. RAID 1 C. RAID 3 D. RAID 5 Answer: D. Which of the following media types is most susceptible to EMI? A. Fiber Optic B. STP C. Co-axial D. UTP Answer: D

Which type of connector does a 10BaseT Ethernet cable use? A. BNC B. RJ-45 C. RJ-11 D. MSAU Answer: B Which of the following is suitable for mission critical and time sensitive applications? A. 10BaseT B. 10Base2 C. Token Ring D. Mesh Answer: C What is the default subnet mask for Class C network? A. 255.0.0.0 B. 255.255.0.0 C. 255.255.255.0 D. 255.0.255.0 Answer: C Which of the following network topologies have each computer connected to a central point? A. Bus B. Ring C. Star D. Mesh Answer: C Which of the following network topologies is the most fault tolerant? A. Bus B. Mesh C. Star D. Ring Answer: B A Bus network topology is best described as which of the following? A. All computers are attached to a single cable in a chain style B. All computers are connected to a central point C. All computers are connected to every other computer or resource in the network D. Fault Tolerant Answer: A A Ring network topology provides two links from each computer.A link in and a link out. A. True B. False Answer:A

Which connector is often used with Thinnet cable? A. RJ-11 B. AUI C. DIX D. BNC Answer:D Which of the following media connectors are used in conjunction with telephones? A. RJ-45 B. RJ-11 C. RJ-T D. None of the above are correct Answer:B 10BaseT Ethernet networks, most commonly use which of the following types of cable? A. Fiber B. Coax C. STP D. UTP Answer:D A Gateway is able to connect network environments that are dissimilar. A. True B. False Answer:A AUI connectors are commonly associated with which of the following items? A. A Vampire Tap B. Fiber Optic Cable C. 10Base2 D. Wireless Networks Answer:A A hub works in conjunction with which of the following network topologies? A. Ring B. Star C. Bus D. Mesh Answer:B Which of the following is a correct MAC address? A. 190.168.80.1 B. www.certyourself.com C. 08:34:FE:4C:F2:54 D. G2:G3:23:87:GG Answer:C A Hub operates at which of the following layers of the OSI model? A. Physical B. Session C. Transport D. Application Answer:A

‡

‡ ‡

‡ ‡

‡ ‡

‡

A Router operates in which layer of the OSI model? A. The Physical Layer B. The Data Link Layer C. The Transport Layer D. The Network Layer Answer:D A Network Interface Card operates at the Network Layer of the OSI model. A. True B. False Answer:B Which of the following is the correct order of the OSI model from bottom to top? A. Application, Presentation, Session, Transport, Network, Data Link, Physical B. Physical, Network, Data Link, Session, Transport, Application, Presentation C. Physical, Data Link, Network, Transport, Session, Presentation, Application D. Application, Session, Presentation, Transport, Network, Data Link, Physical Answer:C What is the maximum speed of 10Base5 Ethernet cable? A. 100 Mbps B. 500 Mbps C. 50 Mbps D. 10 Mbps Answer:D

‡

100Base-FX uses which of the following types of cable?
A. B. C. D. Fiber Optic Unshielded Twisted Pair Coax Shielded Twisted Pair

‡ ‡

Answer:A Which of the following TCP/IP protocols is used to communicate between a Web Browser and a Web Server?
A. B. C. D. SMTP HTTP UDP POP3

‡ ‡

Answer:B Which of the following layers of the OSI model does a Bridge operate in?
A. B. C. D. The Data Link Layer The Network Layer The Transport Layer The Session Layer

‡ ‡

Answer:A While reviewing the security logs for your server, you notice that a user on the Internet has attempted to access your internal mail server.Although it appears that the user's attempts were unsuccessful, you are still very concerned about the possibility that your systems may be compromised.Which of the following solutions are you most likely to implement?
A. B. C. D. A firewall system at the connection point to the Internet A more secure password policy File-level encryption Kerberos authentication

‡

Answer: A

‡

A server has two NIC cards installed.The first one uses IRQ 10 and I/O range of B800B81F.The second uses IRQ 10 and I/O range of D700-D80A.What action, if any, should be taken?
A. B. C. D. No action is required. Locate any available IRQ to resolve the IRQ conflict. Locate any available I/O range to resolve the I/O conflict. Change the I/O of the second NIC to B800-B81F.

‡

Can be used to reduce traffic bottlenecks in a NetBEUI network?
A. B. C. bridge router gateway

‡ ‡

‡ ‡

Answer: B Which of the following IEEE 802 standards pertain to token ring?
A. B. C. D. IEEE 802.5 IEEE 802.3 IEEE 802.2 IEEE 802.11

Answer: A You have just finished the installation of two computers on a 28 computer network using Novell's IPX/SPX.Both computers initialize with no error messages yet they cannot contact other computers on the network.All other computers are functioning normally.You probably have an ___?
A. B. C. incorrect IRQ incorrect frame type invalid IP setting

‡ ‡

Answer: A Protocol that is often used to facilitate communications with an IBM mainframe?
A. B. C. NetBEUI RIP DLC

‡ ‡

Answer: B Uses amplifiers to regenerate analog signals?
A. B. C. baseband broadband fiber-optic

‡ ‡

Answer: C Which of these protocols provide fast connectionless communications that relies on upper layers of the OSI model for error correction?
A. B. C. TCP (Transmission Control Protocol) UDP (User Datagram Protocol) SPX

‡ ‡

Answer: B Uses single frequency digital signals?
A. B. C. baseband broadband multiband

‡ ‡

‡

Answer: B

Answer: A You are hired to investigate a slow performing network server for a client.Using the performance monitor you obtain the following readings: CPU usage= 25%, Disk time= 25%, Page faults/sec= 25.What one change will increase the performance of this network server the most?
A. B. C. buy another CPU add another hard drive increase RAM

‡

Answer: C

A.

Which of the following should you check if you can connect using the IP address but NOT with the host name?
A. B. C. DNS WINS DHCP

‡

The two key components of a digital signature include the secure hash algorithm and a ___ ?
A. B. C. blowfish value certificate authority IPSec

‡ ‡

Answer: A The fastest method of transporting data with a switch?
A. B. C. store and forward cut through loop back

‡ ‡

Answer: B The Microsoft version of Novell's IPX/SPX protocol?
A. B. C. ODI NWLink DLC

‡ ‡

Answer: B Although NOT fault tolerant this RAID level is often used when one wants the highest level of performance?
A. B. C. RAID 0 RAID 1 RAID 5

‡ ‡

Answer: B Utility used to run applications on a computer at a remote location?
A. B. C. ODI Telnet ARP (Address Resolution Protocol)

‡ ‡

‡ ‡

Answer: A Four _____ are used in the 5-4-3 rule of 10Base2 networking?
A. B. C. repeaters segments routers

Answer: B Topology that offers the highest level of redundancy, is easy to troubleshoot but is expensive to install.It is the topology of the internet?
A. B. C. star ring mesh

‡

Answer: C

‡ ‡

Answer: A You have just finished installing an Ethernet PCI NIC (network interface card) in a client's computer.The computer initializes successfully and has no apparent hardware problems.The computer however is not able to communicate with other computers on this NetBEUI network.All other client computers are able to communicate.What is the most likely cause of this problem?
A. B. C. IRQ conflict incorrect transceiver setting incorrect frame type

‡

Answer: B

‡

Ordinary telephone wire has a thickness of AWG 22.Of the following which is the thickest wire?

A. AWG 14 B. AWG 28 C. AWG 32
‡ ‡ Answer: A Backup method which clears the archive bit and is the shortest to perform but takes the longest to restore?

‡

To start a Win 2000 Prof computer in the safe mode press ___ at startup?

A. B. C.
‡ ‡

F8 Ctl and Esc F1 IP address MAC address TCP address

A. full B. incremental C. differential
‡ ‡ Answer: B Which of the following protocols map a logical address to a MAC (Media Access Control) address?

Answer: A A bridge filters traffic using which type of address?

A. B. C.
‡ ‡

Answer: B A large network with 500 users notice that at specific times in the morning and afternoon network congestion ties up their computers.What is the most likely cause?

A. DNS B. WINS C. ARP
‡ ‡ Answer: C The major limiting factor for how long a cable can be in a segment is ___?

A. B. C.
‡ ‡

power fluctuations a terminator is not grounded many users are logging on or off

Answer: C A ___ is created when a unique IP address and port number are used to connect two computers?

A. collisions B. EMI C. attenuation
‡ ‡ ‡ Answer: C « Previous || Next » Backing up the system state in Win 2000 Prof will backup the ___?

A. B. C.
‡ ‡

SAP media transfer coefficient socket

Answer: C During disaster recovery of a Win 2000 Prof computer if you "Enable Boot Logging" the file ___ is saved to the C:\winnt folder for analysis?

A. B.
‡ ‡

setuplog.txt bootlog.txt ntbtlog.txt Frame Relay ATM X.25

A. registry B. boot files C. all of the above
‡ ‡ Answer: C Equipment that is designed to help identify breaks and shorts in cables?

Answer: C Which of these WAN (Wide Area Network) protocols is the fastest?

A. B. C.
‡ ‡

A. TDR B. performance monitor C. SNMP
‡ ‡ Answer: A Which company developed the Unix Operating System?

Answer: B The only files on a Win 2000 Prof Emergency Repair Disk (ERD) are autoexec.nt, config.nt, and setup.log?

A. B.
‡ ‡

True False transport data link application

Answer: A OSI layer responsible for mail and file transfers?

A. Sun B. Microsoft C. ATT
‡ Answer: C

A. B. C.
‡

Answer: C

‡

A protocol that functions at the network layer of the OSI model?

‡

Utility which can be used to identify bottlenecks in the network?

A. B. C.
‡ ‡

TCP IP SPX

A. PING B. WINIPCFG C. TRACERT
‡ ‡ Answer: C What is the first octet range for a class A IP address?

Answer: B A major advantage of ___ in an NT network is centralized security and administration?

A. B. C.
‡ ‡

user-level security share-level security RAID 5 T-1 T-3 ISDN

A. 1- 126 B. 1- 128 C. 1- 191
‡ ‡ Answer: A After you setup the IP address and subnet mask your FIRST test should be with ___?

Answer: A OC-1 has a transmission rate that is close to ___ ?

A. B. C.
‡ ‡

A. tracert to a known good server B. ping 127.0.0.1 C. ping another computer on your segment
‡ ‡ Answer: B NetBIOS computer names can have up to ___ characters?

Answer: B The maximum number an Ethernet network?

of populated segments allowed in
‡ ‡

A. B. C.
‡ ‡

3 4 5

A. 256 B. 15 C. 20
Answer: B Refers to the part of the network that is separated by routers, bridges, or switches?

Answer: A Using the TCP/IP protocol if the destination of the packet is outside the subnet then the packet is sent to the ___?

A. B. C.
‡ ‡

switch bridge default gateway IDC TU MX ring star bus

A. partition B. node C. segment
‡ ‡ Answer: C Data is organized into FRAMES for transmission at this OSI level?

Answer: C Entry in DNS to identify your mail server?

A. B. C.
‡ ‡

A. physical B. data-link C. network
‡ ‡ Answer: B 10Base2 coaxial has a limit of ___ computers per segment?

Answer: C Toplology which is the least expensive to install?

A. B. C.
‡

A. 2 B. 30 C. 100
‡ Answer: B

Answer: C

‡

‡

Cable used for ArcNet networks?
A. B. C. RG-58 RG-59 RG-62
‡ ‡

What routing protocol counts hops to the destination along multiple paths to determine the most efficient route?
A. B. C. ARP DLC RIP

‡ ‡

Answer: C A Class A IP address uses the last ___ octet(s) for the host ID.The host ID is the unique part and identifies the individual user and part of the reason 50% of all IP addresses are Class A?
A. one B. two C. three

Answer: C The source and destination addresses are stored in the ___ of a packet?
A. B. C. data trailer header

‡ ‡

Answer: C Most commonly used type of modem?
A. B. C. synchronous asynchronous external

‡ ‡

Answer: B Operates at the network layer of the OSI model?
A. B. C. bridge gateway router

‡ ‡

Answer: C Of the three (3) RAID levels used by a Win 2000 server choose the one(s) that is/are fault tolerant?
A. B. C. 0, 1, and 5 1 and 5 5

‡ ‡

Answer: C Disk duplexing (RAID 1) requires a minimum of ___?
A. B. C. 2 hard drives and 1 controller 3 hard drives and 2 controllers 2 hard drives and 2 controllers

‡ ‡

Answer: B The best method to restore the latest copy of the registry in a Win 2000 Server is to select the ___?
A. B. Emergency Repair Disk (ERD) Recovery Console

‡ ‡

Answer: C Organization responsible for the OSI model?
A. B. C. ANSI IEEE ISO

‡ ‡

Answer: C Which topology uses the least amount of cabling?
A. B. C. star bus ring

c. Last Known Good Configuration ‡ Answer: C

‡

Answer: B

‡ ‡ According to RFC 1918 this range of Class A IP addresses are reserved for private intranets and are not supposed to be used on the internet (where x is any number from 1 to 254)?

The default protocol on NT4 or Win 2000 servers?

A. B. C.
‡ ‡

IPX/SPX NWLink TCP/IP

A. B. C.
‡ ‡

10.x.x.x 20.x.x.x 30.x.x.x RG-8 RG-10 RG-58 SLIP (Serial Line Internet Protocol) PPTP (Point-to-Point Tunneling Protocol) PPP (Point to Point Protocol)

Answer: C A standard security algorithm developed in 1975 that uses 56-bit symmetric key encryption?

Answer: A Cable classification for 10Base5 thicknet coaxial?

A. B. C.
‡ ‡

A. B. C.
‡ ‡

DES EAP PAP

Answer: A Win 2000 security service that maintains permissions and passwords used to logon?

Answer: A Dial-up protocol that uses a virtual private network (VPN)?

A. B. C.
‡ ‡

A. B. C.
‡ ‡

MMPE CHAP SAM

Answer: B Type 9 ___ rated coaxial cable should be installed in drop ceilings to conform to fire code regulations?

Answer: C A voice grade demand priority standard developed by HP that is capable of 100Mbps transmissions?

A. B. C.
‡

SPF PVC plenum TDR Digital Voltmeter Protocol Analyzer

A. B. C.
‡ ‡

100VG-AnyLAN 100BaseT 100BaseFX physical data link network

Answer: A PPP is part of the ___ OSI layer?

AThe best device to use when monitoring a broadcast storm?

A. B. C.
‡ ‡

A. B. C.
‡ ‡

Answer: C Class A IP addresses can accomodate 16 million hosts while a Class B can accomodate ___?

Answer: B Network connection device that is capable of sending packets along multiple paths depending on which path is the most efficient?

A. B. C.
‡ ‡

254 65,534 4 million

A. B. C.
‡ ‡

bridge router all of the above

Answer: B SNMP relies on the information found in ___ to chart and graph components of the network for analysis and troubleshooting?

Answer: B Processes data using applications stored on its hard drive and sends the results back to the client.Saving the client the extra hard drive space he would need for the application as well as the CPU processing time?

A. B. C.
‡ ‡

SMPs MIBs SAPs
‡ ‡

A. B. C.

file server print server application server

Answer: B Prescribes the greatest packet octet length that can be transmitted?

A. B. C.
‡

SAP subnet mask MTU

Answer: C The static HOSTS text file used on UNIX systems that requires manual entries by the administrator was the precursor of ___.Today the HOSTS file system finds use mainly in maximum security operations which don't want anything changed automatically?

Answer: C ‡

A. B. C.

WINS LMHOSTS DNS

Answer: C

‡

The minimum category of UTP cable that will meet the 10BaseT standard?

A. B. C.
‡ ‡

cat2 cat3 cat5 NetBEUI NWLink TCP/IP

‡

Answer: B The easiest protocol to setup?

Can be thought of as a "hop counter" determining how many hops it takes along various paths to the destination and then telling the router which is the one with the least number of hops which most of the time is the quickest route?

A. B. C.
‡ ‡

A. B. C.
‡ ‡

DLC SAP RIP 8 32 128

Answer: A Displays data on hardware components such as memory, CPU, and the hard drive in a chart or graph which describes how these devices are operating?

Answer: C Apple's LocalTalk protocol has a ___ computer limit?

A. B. C.
‡ ‡

protocol analyzer performance monitor network monitor

A. B. C.
‡ ‡

Answer: B Ensures that one device is NOT overwhelmed by another with a data transmission?

Answer: B The OSI layer responsible for name recognition, security logins, and synchronization of the connection?

A. B. C.
‡ ‡

presentation application session

A. B. C.
‡ ‡

SMB CRC flow control

Answer: C Has twenty-four 64 Kbps channels for a total of 1.544 Mbps throughput?

Answer: C You are setting up a 10Base2 Ethernet network for a client with three segments.There are 20 computers in each segment.How many terminators will you need for this network?

A. B. C.
‡ ‡

T3 T1 X.25

A. B. C.
‡ ‡

1 2 6

Answer: B Microsoft recommends that the %CPU usage should not be above 90% for a single CPU or above __% for multiple processors for any extended period?

Answer: C Used to connect different media types but cannot filter or segment traffic?

A. B. C.
‡ ‡

50 70 90

A. B. C.
‡ ‡

bridge hub router

Answer: B The most efficient way to control security in a client/ server network is to assign permissions to ___?

Answer: A Your customer's computer is loaded with peripherals and is using COM1, COM2, LPT5, and LPT7.You install the NIC on IRQ3 and have a conflict.Which of the following is the NIC conflicting with?

A. B. C.
‡ ‡

each shared resource directories groups

A. B. C.
‡ ‡

the printer COM1 COM2 NetBEUI NWLink TCP/IP

Answer: C Which of the following IRQs can you set your NIC to without usually causing a conflict?

Answer: C The most widely used protocol?

A. B. C.
‡

A. B. C.
‡

4 7 10

Answer: C

Answer: C

‡

Characteristic of the TCP protocol?

‡

OSI layer that determines whether the transmission is a full or halfduplex transfer?

A. B. C.
‡ ‡

fast but unreliable delivery best effort delivery assurance of packet delivery coaxial fiber-optic UTP 3.x 4.x 5.x physical data-link network

A. B. C.
‡ ‡

presentation session application RAID WINS DHCP

Answer: C Cable type that offers the least resistance to EMI?

Answer: B Compensates for a hard drive failure on an NT server?

A. B. C.
‡ ‡

A. B. C.
‡ ‡

Answer: C Novell introduced TCP/IP as its default protocol in NetWare ___ ?

Answer: A In addition to DNS, DHCP, and Active Directory to boot from an RIS server in Win 2000 requires a ___ compliant NIC?

A. B. C.
‡ ‡

A. B. C.
‡ ‡

RAS PXE SAP SLIP UDP PPP

Answer: C This OSI layer packages bits into frames?

Answer: B The most popular dial-up protocol?

A. B. C.
‡ ‡

A. B. C.
‡ ‡

Answer: B Protocol used in Win 2000 to print to a URL on the internet.It requires either Peer Web Services or a IIS server to be installed?

Answer: C The standard for several hubs connected in a linear fashion (tokenbus)?

A. B. C.
‡ ‡

IPP SAP IPSec NDIS TSM ODI 21 25 80

A. B. C.
‡ ‡

802.3 802.4 802.5

Answer: A Novell added ___ which could bind many protocols to a NIC starting with NetWare 4.0?

Answer: B The minimum number of disks required to implement a fault tolerant RAID system?

A. B. C.
‡ ‡

Answer: C Port ___ is assigned to the SMTP?

A. B. C.
‡ ‡

1 2 3
‡ ‡ ‡

Answer: B For increased security Win 2000 enables encryption of files or folders on ___ volumes?

A. B. C.

A. B. C.
‡

FAT32 NTFS either FAT32 or NTFS

Answer: B You are setting up a local peer-to-peer network that will have seven Win 98 computers.Internet access is not needed.Which protocol should you use? (NetBEUI is the best one but if its not listed then pick the one with the lowest overhead)

Answer: B ‡ ‡

A. B. C. A. B. C.
‡

X.25 NWLink TCP/IP setup.exe winnt.exe win.com

Answer: B Used for installing Win NT4?

Answer: B

‡

OSI layer responsible for error checking frames and adding MAC addresses to its tables?

‡

What are the two methods switching hubs use to transport data between devices?

A. B. C.
‡ ‡

presentation transport data-link

Answer: C The initial formation of the packet header is started at this OSI level?

A. B. C. D. E.
‡ ‡

Routing Forwarding Cut-through Active Store-and-forward

A. B. C.
‡ ‡

Application Session Physical

Answer: E,C What happens when a device is disconnected from the middle of a BUS network?

A. B. C. D. E.
‡ ‡

Answer: A For a Class C IP address the first ___ octet(s) are reserved for the network ID?

A. B. C.
‡ ‡

1 2 3 SNMP LMHOSTS Telnet T-connector BNC terminator topologies protocols gateways
‡ ‡

Answer: C Utility used to check SMTP connectivity?

The hub will propagate error messages to the rest of the network All devices on the network will fail The Server will stop responding to that device Data will not be able to get to devices on the other side of this device If a bridge is on the network, only that segment will be effected

A. B. C.
‡ ‡

Answer: A What are some advantages of a Client/Server network over a Peer-toPeer network?

Answer: C Prevents bounce-back of signals in a 10Base2 network?

A. B. C.
‡ ‡

A. B. C. D. E.
‡ ‡

Performance is better on a Peer-to-Peer Security is better on a Client/Server Performance is better on a Client/Server Security is better on a Peer-to-Peer Client/Server is easier to administrate

Answer: C A set of "rules" for network transmissions?

Answer: E,B Name two protocols in the TCP/IP suite that function at the Transport layer of the OSI model.

A. B. C.
‡ ‡

Answer: B What bridging protocol can be used to prevent bridge looping when more than one physical path exists between two or more network segments?

A. B. C. D. E. A. B. C. D. E.
‡

TCP IP UDP SNMP ARP Addressing Holding Organizing Delivery Verifying

A. B. C. D. E.
‡

The Spanning Tree Protocol The Inverted Tree Protocol The Transparent Tree Protocol The Domain Name Tree Protocol The Looping Bridge Protocol

Answer: C,A IP is responsible for sorting and _________________ of packets.

Answer: A

Answer: D

‡

What is the first octet range for a class B IP address?

A. B. C. D. E.
‡ ‡

127-191 128-191 192-223 1-127 128-255 1-126 128-191 192-225 192-223 192-255 Store-and-forward Cut-through Routing Spanning Tree Pass-Through

‡

A packet in a TCP/IP network whose destination is outside the local network goes to the ___?

Answer: B What is the first octet range for a class C IP address?

A. TCP transceiver B. default gateway C. IP subnet
‡ ‡ Answer: B One important difference between routers and bridges is that when a bridge can't locate the destination address in its table it ___?

A. B. C. D. E.
‡ ‡

Answer: D What method of transporting data with a switch is fastest?

A. sends the transmission to the default gateway B. dumps the packet C. broadcasts the transmission to all ports
‡ ‡ Answer: C Novell's NetWare 5.0 was developed in part from the ___ standard?

A. B. C. D. E.
‡ ‡

Answer: B The inner core of a coaxial cable that carries the signals is made of ___?

A. ATM B. NDIS C. X.500
‡ ‡ Answer: C The freely distributed open source Unix based operating system that has gained in popularity recently?

A. B. C.
‡ ‡

aluminum copper zinc route the signal using the most efficient path send an acknowledgement once the packet is received regenerate the signal like repeaters 3 4 5

Answer: B Active hubs can ___?

A. B. C.
‡ ‡

A. XP B. Linux C. DLC
‡ ‡ Answer: B The term used to describe the physical layout of a network?

Answer: C RAID 5 requires a minimum of __ hard drives?

A. B. C.
‡ ‡

A. protocol B. server C. topology
‡ ‡ Answer: C Is the interface between the NIC drivers and MAC sublayer?

Answer: A What is an advantage of Cat 3 UTP cable instead of RG-58 A/U coaxial?

A. B. C.
‡

UTP supports longer cable segments UTP is less susceptible to EMI UTP is easier to install and less expensive

A. WINS B. NDIS C. DLC
‡ Answer: B

Answer: C

‡

Records the number of hops and latency of the packet on its way to its destination?
A. B. C. IPCONFIG TRACERT PING

‡

What are the two types of routing connections?
A. B. C. D. E. Token passing Connectionless Reliable Connection Orientated Unreliable

‡ ‡

Answer: B NDIS operates at which layer of the OSI model?
A. B. C. presentation data-link network

‡ ‡

Answer: D,B What type of routing connection would typically fragment data packets?
A. B. C. D. E. Connection Orientated Cut-Through Reliable Connectionless Static

‡ ‡

Answer: B When checking the TCP/IP protocol you have just finished installing for connectivity the proper first step it to ___?
A. B. C. PING another computer on that segment PING 127.0.0.1 PING the default gateway

‡ ‡

Answer: B As data travels down the OSI layers it reaches the ___ layer which is responsible for its bit conversion and actual transmission to other computers?
A. B. C. network application physical

‡ ‡

Answer: D What name is given to Novell's client software loaded on the workstation, and what feature does it provide that earlier versions of the Generic Windows client do not offer?
A. B. C. D. E. NETX Client for NetWare Networks Client32 Support for NetWare Print Queues Support for NetWare Directory Services

‡ ‡

Answer: C Can switching hubs propagate broadcast packets on the network?
A. B. Yes No

‡ ‡

Answer: A How many physical addresses can be assigned to a NIC?
A. B. C. D. E. One Two Three; One by the IEEE, one by the NIC vendor, and one by the Network Administrator Depends on the NOS Depends on the NIC driver

‡ ‡

Answer: C,E If two computers are assigned the same IP address then ___?
A. B. C. neither computer will be able to connect the first computer to sign on will be able to connect the other will not both computers will be able to connect to the local network but not to the internet

‡

Answer: A

‡ ‡

Answer: B The physical address assigned by the NIC manufacturer?
A. B. C. subnet mask IP address MAC address

‡

Answer: C

‡

Similar to WINS in that it resolves NetBIOS names into IP address but stores this information in a text file?

‡

How many devices can communicate simultaneously within a Tokenring LAN?

A. B. C.
‡ ‡

LMHOSTS DLC DNS user-level share-level permissions for

Answer: A A small peer to peer network uses ___ security?

A. B. C. D. E.
‡ ‡

A. B. C.
‡ ‡

One for each MAU on the LAN One Two As many devices as the administrator defines within the NOS Between 1 and 5 if the ring speed is 16mbp/s

Answer: B The TCP/IP protocol used on the internet allows for approximately ___ billion unique IP addresses?

Answer: B What are three common items that must be configured correctly when installing a Network Interface Card (NIC)?

A. B. C.
‡ ‡

1 4 10
‡ ‡

Answer: B What happens when a device is disconnected from the middle of a BUS network?

A. B. C. D. E.

PCI or ISA slot IRQ setting DMA Address Driver I/O Address

A. B. C. D. E.
‡ ‡

The hub will propagate error messages to the rest of the network All devices on the network will fail The Server will stop responding to that device Data will not be able to get to devices on the other side of this device If a bridge is on the network, only that segment will be effected

Answer: B,C,D,E When troubleshooting connection problems you can confirm that physical layer devices are communicating by visually inspecting _______________ on the NIC and hub.

A. B. C. D. E.
‡ ‡

Cross over cable The Link-Lights The electrical connection The Patch cable The power light

Answer: B Why is there a limit to the number of MAUs that can be connected together in a standard Token-ring network?

Answer: B What is the name of a common test performed on a NIC with vendor supplied diagnostic software?

A. B. C. D. E.
‡

Too many MAUs would exceed the cable limits imposed by the Token Ring specification Too many MAUs would create to large of a collision domain for communications to take place Too many MAUs require more electricity than the devices can support Too many devices connected through MAUs requires more time to get control of the token that communications becomes unacceptable There is no limit to the number of MAUs a token ring network can support

A. B. C. D. E.
‡ ‡

NIC Test Diagnostic Test PING Loopback NICBack

Answer: D Name two driver interfaces that allow a NIC to communicate on more than one protocol.

Answer: D ‡ ‡

A. B. C. D. E. A. B. C. D. E.
‡

NDIS NetBEUI NetBIOS ODI UNIX The Data-Link Layer Top Layer The Transport Layer The Session Layer The Network Layer

Answer: D,A Bridges operate at the _____________ OSI level.

Answer: A

‡

What bridging method is commonly used in Ethernet with only one bridge.

A. B. C. D. E.
‡ ‡

Collision Routing Transparent Spanning Tree Open Shortest Path First (OSPF)

‡

Another fast non-routable protocol with low overhead developed by DEC?

A. ATM B. LAT C. SPX
‡ ‡ Answer: B You are hired to setup a 100Mbps Ethernet network for a client in an office that already has cat 3 UTP installed.Your client wants to keep the costs to a minimum but needs the 100Mbps throughput.What should you recommend?

Answer: C Where are bridging address tables maintained when using sourceroute bridging?

A. B. C. D. E.
‡ ‡

In routing tables on the hard drive In routing tables in RAM In routing tables in ROM At each PC on the network On special routing devices BNC T-connectors RJ-11 UTP

Answer: A Characteristic of an IEEE 802.3 10BaseT Ethernet network?

A. B. C.
‡ ‡

A. keep the existing cable but purchase 100Mbps hubs B. keep the existing cable but use 100Mbps patch cable from the wall outlet C. new cat 5 UTP and if not already installed 100 Mbps hubs and 100 Mbps NICs
‡ ‡ Answer: C Your client's 10BaseT Ethernet network using NetBEUI wants to access data on an IBM mainframe.What device will allow this connection?

Answer: C You suspect a faulty NIC is causing a broadcast storm in a network.What troubleshooting tool would you use to locate which computer has the defective NIC?

A. B. C.
‡ ‡

VOM protocol analyzer TDR

A. bridge B. gateway C. router
‡ ‡ Answer: B Of the following protocols which is the fastest?

Answer: B A dial-up protocol that does not support automatic IP addressing using DHCP?

A. B. C.
‡ ‡

PPP DLC SLIP

A. TCP/IP B. IPX/SPX C. UDP/IP
‡ ‡ Answer: C Access to files and folders in Win 2000 is accomplished using ___ ?

Answer: C Of the two types of routers the one that uses the discovery process to create its routing table?

A. B. C.
‡ ‡

static dynamic multiplexed
‡

Answer: B Your client's NT server has been having trouble booting.Where should you look first for some answers?

A. compression B. tunneling C. permissions
Answer: C

A. B. C.
‡

performance monitor event viewer SNMP

Answer: B

‡

A ___ is used to connect two pieces of 10Base2 coaxial cable together?

‡

Increases the data rate of modems?

A. B. C.
‡ ‡

T-connector barrel connector patch cable

A. encryption B. compression C. synchronization
‡ ‡ Answer: B Wireless technology commonly used to connect workstations that are all located in a single room?

Answer: B One reason the ATM WAN protocol is faster than Frame Relay is because its packets are a ___ size which allows them to be switched and routed more easily?

A. B. C.
‡ ‡

variable fixed compressed access databases setup the default gateway identify a defective NIC LAT NWLink DLC Frame Relay ArcNet ATM

A. IrDA B. microwave C. SONET
‡ ‡ Answer: A Your customer has a client/ server Ethernet network consisting of a server and 225 computers running Win NT4.What kind of security would you recommend to him for centralized control of access to files and directories on the network?

Answer: B SQL is used to ___?

A. B. C.
‡ ‡

Answer: A Which of the following is a routable protocol?

A. B. C.
‡ ‡

A. use a password for each file and groups for each directory B. use a password for each file and directory shared C. setup groups of shared resources and users who have access to these groups
‡ ‡ Answer: C Running performance monitor your CPU usage averages 45% except when you load an application and it surges to 100%.Is there a problem?

Answer: B Uses token passing?

A. B. C.
‡ ‡

Answer: B For Cat 5 UTP, patch cables from the wall outlet to the computer can be a maximum of ___ m?

A. yes, your CPU needs an upgrade or multiple CPUs may have to be installed B. yes, but it is not the CPU, you need more RAM C. no, its normal for the %usage to surge when loading an application
‡ ‡ Answer: C Interface between the computer and POTS?

A. B. C.
‡ ‡

1 3 10

Answer: B The static text file ___ and DNS contain similar names and IP addresses?

A. ATAPI B. SONET C. TAPI
‡ ‡ Answer: C The following protocols are supported by RAS?

A. B. C.
‡

LMHOSTS HOSTS WINS

Answer: B ‡

A. TCP/IP B. NetBEUI C. all of the above
Answer: C

‡

Which of the following protocols need to be installed on your client's NT system before DHCP and DNS can be enabled?

‡

Which architecture is recommended under high network utilization of up to 70% or 80%?

A. B. C.
‡ ‡

Ethernet bus Token Ring DLC

A. TCP/IP B. IPX/SPX C. NetBEUI
‡ ‡ Answer: A A router uses ___ addressing to choose its path?

Answer: B A token-ring network has a maximum limit of ___ computers?

A. physical B. logical C. system
‡ ‡ Answer: B Which topology provides for equal access to the network for all computers?

A. B. C.
‡ ‡

1024 260 512

A. star B. bus C. ring
‡ ‡ Answer: C Using the TCP/IP protocol when is a subnet mask required?

Answer: B Dial-up protocol used when a secure connection is desired?

A. B. C.
‡ ‡

PPP SLIP PPTP

A. only when connecting outside the LAN B. only when using TCP/IP C. for both intranet and internet usage
‡ ‡ Answer: C OSI level that ensures error-free delivery of packets?

Answer: C Your IP address is 135.72.14.43.What portion of this IP address identifies your network ID?

A. data-link B. network C. transport
‡ ‡ Answer: C The IEEE specification for a token ring network?

A. B. C.
‡ ‡

135 135.72 135.72.14

A. 802.3 B. 802.5 C. 802.6
‡ ‡ Answer: B RIP counts hops (or routers it encounters) as the packet travels to its destination.Another name for a hop is a ___?

Answer: B Allows users to connect to a remote network with a PPP dial-up connection?

A. B. C.
‡

RAS SAP SONET

A. interval B. sequence C. metric
‡ Answer: C

Answer: A

‡

A protocol that functions at the transport layer of the OSI model?

A. B. C.
‡ ‡

IP IPX SPX 64 32 128

‡

Smart Cards in Win 2000 use the ___ RAS authentication protocol for security?

Answer: C How many bits are there in an IP address?

A. B. C.
‡ ‡

A. PAP B. MSCHAP C. EAP
‡ ‡ Answer: C Because of its low overhead this is the fastest of these protocols?

Answer: B An easy to configure, fast, and efficient protocol recommended for small non-routable networks?

A. B. C.
‡ ‡

NetBEUI TCP/IP X.25

A. TCP/IP B. NWLink C. NetBEUI
‡ ‡ Answer: C The ERD made in the Win 2000 Server Backup utility contains the files needed to boot the computer?

Answer: A What type of troubleshooting device examines the network at the packet level?

A. True B. False
‡ ‡ Answer: B Your client has a 10Base2 Ehternet network which is using 160m of RG-58A/U cable and two 50 ohm terminators that are both grounded.What is wrong with his network?

A. B. C.
‡ ‡

TDR VOM protocol analyzer DHCP DNS WINIPCFG

Answer: C Resolves domain names into IP addresses?

A. B. C.
‡ ‡

A. the terminators should be 93 ohms B. he should be using RG-59/U cable C. only one terminator should be grounded
‡ ‡ Answer: C Of the following the one that is NOT an alogorithm that determines the shortest path for routers?

Answer: B ___ uses data encryption to secure data being transmitted over the internet so even if it is intercepted it can't be read without knowing the key?

A. B. C.
‡ ‡

DLC SSL ARP

A. SAP B. RIP C. OSPF
‡ ‡ Answer: A The most common topology in use today among corporate users?

Answer: B Device drivers can be disabled in Win 2000 Prof in Device Manager or by using the ___?

A. B. C.
‡

ERD Recovery Console RDISK

A. bus B. ring C. star-bus
‡ Answer: C

Answer: B

Uses a 93 ohm resistor? A. RG62 B. RG58 C. RG59 Answer: A OSI level responsible for compression and encryption of data? A. session B. application C. presentation Answer: C

What is data structure? Answer: A data structure is a way of organizing data that considers not only the items stored, but also their relationship to each other. Advance knowledge about the relationship between data items allows designing of efficient algorithms for the manipulation of data. List out the areas in which data structures are applied extensively? Answer: The name of areas are: Compiler Design, Operating System, Database Management System, Statistical analysis package, Numerical Analysis, Graphics, Artificial Intelligence, Simulation What are the major data structures used in the following areas : RDBMS, Network data model & Hierarchical data model. Answer: The major data structures used are as follows: RDBMS - Array (i.e. Array of structures) Network data model - Graph Hierarchical data model - Trees

Convert the expression ((A + B) * C - (D - E) ^ (F + G)) to equivalent Prefix and Postfix notations. Answer: Prefix Notation: ^ - * +ABC - DE + FG Postfix Notation: AB + C * DE - - FG + ^ How many null branches are there in a binary tree with 20 nodes? Answer: 21 Let us take a tree with 5 nodes (n=5)

It will have only 6 (ie,5+1) null branches. A binary tree with n nodes has exactly n+1 null nodes. What are the methods available in storing sequential files? Answer: The methods available in storing sequential files are: Straight merging, Natural merging, Polyphase sort, Distribution of Initial runs.

If you are using C language to implement the heterogeneous linked list, what pointer type will you use? Answer: The heterogeneous linked list contains different data types in its nodes and we need a link, pointer to connect them. It is not possible to use ordinary pointers for this. So we go for void pointer. Void pointer is capable of storing pointer to any type as it is a generic pointer type. Minimum number of queues needed to implement the priority queue? Answer: Two. One queue is used for actual storing of data and another for storing priorities. What is the data structures used to perform recursion? Answer: Stack. Because of its LIFO (Last In First Out) property it remembers its 'caller' so knows whom to return when the function has to return. Recursion makes use of system stack for storing the return addresses of the function calls. Every recursive function has its equivalent iterative (non-recursive) function. Even when such equivalent iterative procedures are written, explicit stack is to be used. What are the notations used in Evaluation of Arithmetic Expressions using prefix and postfix forms? Answer: Polish and Reverse Polish notations.

How many different trees are possible with 10 nodes ? Answer: 1014 For example, consider a tree with 3 nodes(n=3), it will have the maximum combination of 5 different (ie, 23 - 3 = 5) trees.

In general: If there are n nodes, there exist 2n-n different trees.

List out few of the Application of tree data-structure? Answer: The list is as follows: The manipulation of Arithmetic expression, Symbol Table construction, Syntax analysis. List out few of the applications that make use of Multilinked Structures? Answer: The applications are listed below: Sparse matrix, Index generation. In tree construction which is the suitable efficient data structure? Answer: Linked list is the efficient data structure. What is the type of the algorithm used in solving the 8 Queens problem? Answer: Backtracking

In an AVL tree, at what condition the balancing is to be done? Answer: If the 'pivotal value' (or the 'Height factor') is greater than 1 or less than -1. What is the bucket size, when the overlapping and collision occur at same time? Answer: One. If there is only one entry possible in the bucket, when the collision occurs, there is no way to accommodate the colliding value. This results in the overlapping of values. Traverse the given tree using Inorder, Preorder and Postorder traversals.

Answer: Inorder : D H B E A F C I G J Preorder: A B D H E C F G I J Postorder: H D E B F I J G C A

There are 8, 15, 13, 14 nodes were there in 4 different trees. Which of them could have formed a full binary tree? Answer: 15. In general: There are 2n-1 nodes in a full binary tree. By the method of elimination: Full binary trees contain odd number of nodes. So there cannot be full binary trees with 8 or 14 nodes, so rejected. With 13 nodes you can form a complete binary tree but not a full binary tree. So the correct answer is 15. In the given binary tree, using array you can store the node 4 at which location?

Answer: At location 6

1 2 3 4 5 Root LC1 RC1 LC2 RC2 LC3 RC3 LC4 RC4 where LCn means Left Child of node n and RCn means Right Child of node n

For the given graph, draw the DFS and BFS

Answer: BFS: A X G H P E M Y J DFS: A X H P E Y M J G

Classify the Hashing Functions based on the various methods by which the key value is found. Answer: The list of Hashing functions is as follows: Direct method Subtraction method Modulo-Division method Digit-Extraction method Mid-Square method Folding method Pseudo-random method

What are the types of Collision Resolution Techniques and the methods used in each of the type? Answer: The types of Collision Resolution Techniques are: Open addressing (closed hashing) The methods used include: Overflow block Closed addressing (open hashing) The methods used include: Linked list Binary tree In RDBMS, what is the efficient data structure used in the internal storage representation? Answer: B+ tree. Because in B+ tree, all the data is stored only in leaf nodes, that makes searching easier. This corresponds to the records that shall be stored in leaf nodes. Draw the B-tree of order 3 created by inserting the following data arriving in sequence - 92 24 6 7 11 8 22 4 5 16 19 20 78 Answer:

What is a spanning Tree? Answer: A spanning tree is a tree associated with a network. All the nodes of the graph appear on the tree once. A minimum spanning tree is a spanning tree organized so that the total edge weight between nodes is minimized. Does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes? Answer: No. Minimal spanning tree assures that the total weight of the tree is kept at its minimum. But it doesn't mean that the distance between any two nodes involved in the minimum-spanning tree is minimum. Convert the given graph with weighted edges to minimal spanning tree. Answer: the equivalent minimal spanning tree is:

Whether Linked List is linear or Non-linear data structure? Answer: According to Access strategies Linked list is a linear one. According to Storage Linked List is a Non-linear one. Draw a binary Tree for the expression : A * B - (C + D) * (P / Q) Answer:

For the following COBOL code, draw the Binary tree? 01 STUDENT_REC. 02 NAME. 03 FIRST_NAME PIC X(10). 03 LAST_NAME PIC X(10). 02 YEAR_OF_STUDY. 03 FIRST_SEM PIC XX. 03 SECOND_SEM PIC XX

‡Explain the concept of Reentrancy. Answer: It is a useful, memory-saving technique for multiprogrammed timesharing systems. A Reentrant Procedure is one in which multiple users can share a single copy of a program during the same period. Reentrancy has 2 key aspects: The program code cannot modify itself, and the local data for each user process must be stored separately. Thus, the permanent part is the code, and the temporary part is the pointer back to the calling program and local variables used by that program. Each execution instance is called activation. It executes the code in the permanent part, but has its own copy of local variables/parameters. The temporary part associated with each activation is the activation record. Generally, the activation record is kept on the stack. Note: A reentrant procedure can be interrupted and called by an interrupting program, and still execute correctly on returning to the procedure. . s n et ap ec ne e e egap r t r f r i i r n a r ec r o eu t s s h T. y a m n A s y da e s s h T. ss ec o p i t f r i i l o l eh o de ac ol a e a s e m rf e o mneh w nev e s es ae c n t t t l r a r r i e m not uc ex e eh ,. ei , s neppah esr ev e eh , s e m e m it i t . r t it o .r ucc o sl ua egap r e we es uac eb,r e s a s not uc ex e t f f t f i i r t t l a ss ec o p eh , yr o m m au ri v ss ec o p a o de ac ol a s e m rf f o r t e l t r eb m n eh gn s ae c n no, yl aus . y a m na I del ac os A u t i r i l l o l l :r e w n A s . y a on A s y a e n a px E l l i l ‡

‡What is a binary semaphore? What is its use? Answer: A binary semaphore is one, which takes only 0 and 1 as values. They are used to implement mutual exclusion and synchronize concurrent processes. ‡What is thrashing? Answer: It is a phenomenon in virtual memory schemes when the processor spends most of its time swapping pages, rather than executing instructions. This is due to an inordinate number of page faults.

‡List the Coffman's conditions that lead to a deadlock. Answer: ‡Mutual Exclusion: Only one process may use a critical resource at a time. ‡Hold & Wait: A process may be allocated some resources while waiting for others. ‡No Pre-emption: No resource can be forcible removed from a process holding it. ‡Circular Wait: A closed chain of processes exist such that each process holds at least one resource needed by another process in the chain.

‡What are short-, long- and medium-term scheduling? Answer: Long term scheduler determines which programs are admitted to the system for processing. It controls the degree of multiprogramming. Once admitted, a job becomes a process. Medium term scheduling is part of the swapping function. This relates to processes that are in a blocked or suspended state. They are swapped out of real-memory until they are ready to execute. The swapping-in decision is based on memory-management criteria. Short term scheduler, also know as a dispatcher executes most frequently, and makes the finestgrained decision of which process should execute next. This scheduler is invoked whenever an event occurs. It may lead to interruption of one process by preemption. ‡What are turnaround time and response time? Answer: Turnaround time is the interval between the submission of a job and its completion. Response time is the interval between submission of a request, and the first response to that request. ‡What are the typical elements of a process image? Answer: ‡User data: Modifiable part of user space. May include program data, user stack area, and ‡programs that may be modified. ‡User program: The instructions to be executed. ‡System Stack: Each process has one or more LIFO stacks associated with it. Used to store ‡parameters and calling addresses for procedure and system calls. ‡Process control Block (PCB): Info needed by the OS to control processes

‡What is cycle stealing? Answer: We encounter cycle stealing in the context of Direct Memory Access (DMA). Either the DMA controller can use the data bus when the CPU does not need it, or it may force the CPU to temporarily suspend operation. The latter technique is called cycle stealing. Note that cycle stealing can be done only at specific break points in an instruction cycle. ‡What is meant by arm-stickiness? Answer: If one or a few processes have a high access rate to data on one track of a storage disk, then they may monopolize the device by repeated requests to that track. This generally happens with most common device scheduling algorithms (LIFO, SSTF, C-SCAN, etc). High-density multisurface disks are more likely to be affected by this than low density ones.

‡What are the stipulations of C2 level security? Answer: C2 level security provides for: ‡Discretionary Access Control ‡Identification and Authentication ‡Auditing ‡Resource reuse ‡What is busy waiting? Answer: The repeated execution of a loop of code while waiting for an event to occur is called busywaiting. The CPU is not engaged in any real productive activity during this period, and the process does not progress toward completion. ‡Explain the popular multiprocessor thread-scheduling strategies. Answer: ‡Load Sharing: Processes are not assigned to a particular processor. A global queue of threads is maintained. Each processor, when idle, selects a thread from this queue. Note that load balancing refers to a scheme where work is allocated to processors on a more permanent basis. ‡Gang Scheduling: A set of related threads is scheduled to run on a set of processors at the same time, on a 1-to-1 basis. Closely related threads / processes may be scheduled this way to reduce synchronization blocking, and minimize process switching. Group scheduling predated this strategy. ‡Dedicated processor assignment: Provides implicit scheduling defined by assignment of threads to processors. For the duration of program execution, each program is allocated a set of processors equal in number to the number of threads in the program. Processors are chosen from the available pool. ‡Dynamic scheduling: The number of thread in a program can be altered during the course of execution.

‡When does the condition 'rendezvous' arise? Answer: In message passing, it is the condition in which, both, the sender and receiver are blocked until the message is delivered. ‡What is a trap and trapdoor? Answer: Trapdoor is a secret undocumented entry point into a program used to grant access without normal methods of access authentication. A trap is a software interrupt, usually the result of an error condition. ‡What are local and global page replacements? Answer: Local replacement means that an incoming page is brought in only to the relevant process' address space. Global replacement policy allows any page frame from any process to be replaced. The latter is applicable to variable partitions model only. ‡Define latency, transfer and seek time with respect to disk I/O. Answer: Seek time is the time required to move the disk arm to the required track. Rotational delay or latency is the time it takes for the beginning of the required sector to reach the head. Sum of seek time (if any) and latency is the access time. Time taken to actually transfer a span of data is transfer time.

‡Describe the Buddy system of memory allocation. Answer: Free memory is maintained in linked lists, each of equal sized blocks. Any such block is of size 2^k. When some memory is required by a process, the block size of next higher order is chosen, and broken into two. Note that the two such pieces differ in address only in their kth bit. Such pieces are called buddies. When any used block is freed, the OS checks to see if its buddy is also free. If so, it is rejoined, and put into the original free-block linked-list.
What is time-stamping? Answer: It is a technique proposed by Lamport, used to order events in a distributed system without the use of clocks. This scheme is intended to order events consisting of the transmission of messages. Each system 'i' in the network maintains a counter Ci. Every time a system transmits a message, it increments its counter by 1 and attaches the time-stamp Ti to the message. When a message is received, the receiving system 'j' sets its counter Cj to 1 more than the maximum of its current value and the incoming time-stamp Ti. At each site, the ordering of messages is determined by the following rules: For messages x from site i and y from site j, x precedes y if one of the following conditions holds....(a) if Ti<j.< and Ti="Tj" if (b) or> ‡How are the wait/signal operations for monitor different from those for semaphores? Answer: If a process in a monitor signal and no task is waiting on the condition variable, the signal is lost. So this allows easier program design. Whereas in semaphores, every operation affects the value of the semaphore, so the wait and signal operations should be perfectly balanced in the program.

‡In the context of memory management, what are placement and replacement algorithms? Answer: Placement algorithms determine where in available real-memory to load a program. Common methods are first-fit, next-fit, best-fit. Replacement algorithms are used when memory is full, and one process (or part of a process) needs to be swapped out to accommodate a new program. The replacement algorithm determines which are the partitions to be swapped out. ‡In loading programs into memory, what is the difference between load-time dynamic linking and run-time dynamic linking? Answer: For load-time dynamic linking: Load module to be loaded is read into memory. Any reference to a target external module causes that module to be loaded and the references are updated to a relative address from the start base address of the application module. With run-time dynamic loading: Some of the linking is postponed until actual reference during execution. Then the correct module is loaded and linked. ‡What are demand- and pre-paging? Answer: With demand paging, a page is brought into memory only when a location on that page is actually referenced during execution. With pre-paging, pages other than the one demanded by a page fault are brought in. The selection of such pages is done based on common access patterns, especially for secondary memory devices. ‡Paging a memory management function, while multiprogramming a processor management function, are the two interdependent? Answer: Yes. ‡What is page cannibalizing? Answer: Page swapping or page replacements are called page cannibalizing. ‡What has triggered the need for multitasking in PCs? Answer: Increased speed and memory capacity of microprocessors together with the support fir virtual memory and Growth of client server computing ‡What are the four layers that Windows NT have in order to achieve independence? Answer: ‡Hardware abstraction layer ‡Kernel ‡Subsystems ‡System Services.

‡What is SMP? Answer: To achieve maximum efficiency and reliability a mode of operation known as symmetric multiprocessing is used. In essence, with SMP any process or threads can be assigned to any processor. ‡What are the key object oriented concepts used by Windows NT? Answer: Encapsulation Object class and instance ‡Is Windows NT a full blown object oriented operating system? Give reasons. Answer: No Windows NT is not so, because its not implemented in object oriented language and the data structures reside within one executive component and are not represented as objects and it does not support object oriented capabilities .

‡What is the Translation Lookaside Buffer (TLB)? Answer: In a cached system, the base addresses of the last few referenced pages is maintained in registers called the TLB that aids in faster lookup. TLB contains those page-table entries that have been most recently used. Normally, each virtual memory reference causes 2 physical memory accesses-- one to fetch appropriate page-table entry, and one to fetch the desired data. Using TLB in-between, this is reduced to just one physical memory access in cases of TLB-hit. ‡What is the resident set and working set of a process? Answer: Resident set is that portion of the process image that is actually in real-memory at a particular instant. Working set is that subset of resident set that is actually needed for execution. (Relate this to the variable-window size method for swapping techniques.)

‡What is an idle thread? Answer: The special thread a dispatcher will execute when no ready thread is found. ‡What is FtDisk? Answer: It is a fault tolerance disk driver for Windows NT. ‡What are the possible threads a thread can have? Answer: ‡Ready ‡Standby ‡Running ‡Waiting ‡Transition ‡Terminated. ‡What are rings in Windows NT? Answer: Windows NT uses protection mechanism called rings provides by the process to implement separation between the user mode and kernel mode. ‡What is Executive in Windows NT? Answer: In Windows NT, executive refers to the operating system code that runs in kernel mode. ‡What are the sub-components of I/O manager in Windows NT?

‡Answer: ‡Network redirector/ Server ‡Cache manager. ‡File systems ‡Network driver ‡Device driver ‡What are DDks? Name an operating system that includes this feature. Answer: DDks are device driver kits, which are equivalent to SDKs for writing device drivers. Windows NT includes DDks. ‡What level of security does Windows NT meets? Answer: C2 level security. Questions on file management in uinx Following are some unix sample questions. How are devices represented in UNIX? All devices are represented by files called special files that are located in/dev directory. Thus, device files and other files are named and accessed in the same way. A 'regular file' is just an ordinary data file in the disk. A 'block special file' represents a device with characteristics similar to a disk (data transfer in terms of blocks). A 'character special file' represents a device with characteristics similar to a keyboard (data transfer is by stream of bits in sequential order).

‡What is 'inode'? Answer: All UNIX files have its description stored in a structure called 'inode'. The inode contains info about the file-size, its location, time of last access, time of last modification, permission and so on. Directories are also represented as files and have an associated inode. In addition to descriptions about the file, the inode contains pointers to the data blocks of the file. If the file is large, inode has indirect pointer to a block of pointers to additional data blocks (this further aggregates for larger files). A block is typically 8k. Inode consists of the following fields: ‡File owner identifier ‡File type ‡File access permissions ‡File access times ‡Number of links ‡File size ‡Location of the file data ‡Brief about the directory representation in UNIX Answer: A Unix directory is a file containing a correspondence between filenames and inodes. A directory is a special file that the kernel maintains. Only kernel modifies directories, but processes can read directories. The contents of a directory are a list of filename and inode number pairs. When new directories are created, kernel makes two entries named '.' (refers to the directory itself) and '..' (refers to parent directory). System call for creating directory is mkdir (pathname, mode).

‡What are the Unix system calls for I/O? Answer: ‡open(pathname,flag,mode) - open file ‡creat(pathname,mode) - create file ‡close(filedes) - close an open file ‡read(filedes,buffer,bytes) - read data from an open file ‡write(filedes,buffer,bytes) - write data to an open file ‡lseek(filedes,offset,from) - position an open file ‡dup(filedes) - duplicate an existing file descriptor ‡dup2(oldfd,newfd) - duplicate to a desired file descriptor ‡fcntl(filedes,cmd,arg) - change properties of an open file ‡ioctl(filedes,request,arg) - change the behaviour of an open file The difference between fcntl anf ioctl is that the former is intended for any open file, while the latter is for device-specific operations. ‡How do you change File Access Permissions? Answer: Every file has following attributes: ‡owner's user ID ( 16 bit integer ) ‡owner's group ID ( 16 bit integer ) ‡File access mode word 'r w x -r w x- r w x' (user permission-group permission-others permission) r-read, w-write, x-execute To change the access mode, we use chmod(filename,mode). Example 1: To change mode of myfile to 'rw-rw-r--' (ie. read, write permission for user - read,write permission for group - only read permission for others) we give the args as: chmod(myfile,0664) . Each operation is represented by discrete values 'r' is 4 'w' is 2 'x' is 1 Therefore, for 'rw' the value is 6(4+2). Example 2: To change mode of myfile to 'rwxr--r--' we give the args as: chmod(myfile,0744).

‡What are links and symbolic links in UNIX file system? Answer: A link is a second name (not a file) for a file. Links can be used to assign more than one name to a file, but cannot be used to assign a directory more than one name or link filenames on different computers. Symbolic link 'is' a file that only contains the name of another file.Operation on the symbolic link is directed to the file pointed by the it.Both the limitations of links are eliminated in symbolic links. Commands for linking files are: Link ln filename1 filename2 Symbolic link ln -s filename1 filename2

What is a FIFO? Answer: FIFO are otherwise called as 'named pipes'. FIFO (first-in-first-out) is a special file which is said to be data transient. Once data is read from named pipe, it cannot be read again. Also, data can be read only in the order written. It is used in interprocess communication where a process writes to one end of the pipe (producer) and the other reads from the other end (consumer). ‡How do you create special files like named pipes and device files? Answer: The system call mknod creates special files in the following sequence. 1.kernel assigns new inode, 2.sets the file type to indicate that the file is a pipe, directory or special file, 3.If it is a device file, it makes the other entries like major, minor device numbers. For example: If the device is a disk, major device number refers to the disk controller and minor device number is the disk. ‡Discuss the mount and unmount system calls Answer: The privileged mount system call is used to attach a file system to a directory of another file system; the unmount system call detaches a file system. When you mount another file system on to your directory, you are essentially splicing one directory tree onto a branch in another directory tree. The first argument to mount call is the mount point, that is , a directory in the current file naming system. The second argument is the file system to mount to that point. When you insert a cdrom to your unix system's drive, the file system in the cdrom automatically mounts to /dev/cdrom in your system. ‡How does the inode map to data block of a file? Answer: Inode has 13 block addresses. The first 10 are direct block addresses of the first 10 data blocks in the file. The 11th address points to a one-level index block. The 12th address points to a two-level (double in-direction) index block. The 13th address points to a threelevel(triple in-direction)index block. This provides a very large maximum file size with efficient access to large files, but also small files are accessed directly in one disk read. ‡What is a shell? Answer: A shell is an interactive user interface to an operating system services that allows an user to enter commands as character strings or through a graphical user interface. The shell converts them to system calls to the OS or forks off a process to execute the command. System call results and other information from the OS are presented to the user through an interactive interface. Commonly used shells are sh,csh,ks etc.

‡Brief about the initial process sequence while the system boots up. Answer: While booting, special process called the 'swapper' or 'scheduler' is created with Process-ID 0. The swapper manages memory allocation for processes and influences CPU allocation. The swapper inturn creates 3 children: the process dispatcher, vhand and dbflush with IDs 1,2 and 3 respectively. This is done by executing the file /etc/init. Process dispatcher gives birth to the shell. Unix keeps track of all the processes in an internal data structure called the Process Table (listing command is ps -el). ‡What are various IDs associated with a process? Answer: Unix identifies each process with a unique integer called ProcessID. The process that executes the request for creation of a process is called the 'parent process' whose PID is 'Parent Process ID'. Every process is associated with a particular user called the 'owner' who has privileges over the process. The identification for the user is 'UserID'. Owner is the user who executes the process. Process also has 'Effective User ID' which determines the access privileges for accessing resources like files. getpid() -process id getppid() -parent process id getuid() -user id geteuid() -effective user id ‡Explain fork() system call. Answer: The 'fork()' used to create a new process from an existing process. The new process is called the child process, and the existing process is called the parent. We can tell which is which by checking the return value from 'fork()'. The parent gets the child's pid returned to him, but the child gets 0 returned to him. ‡Predict the output of the following program code main() { fork(); printf("Hello World!"); } Answer: Hello World!Hello World! Explanation: The fork creates a child that is a duplicate of the parent process. The child begins from the fork().All the statements after the call to fork() will be executed twice.(once by the parent process and other by child). The statement before fork() is executed only by the parent process. ‡Predict the output of the following program code main() { fork(); fork(); fork(); printf("Hello World!"); } Answer: "Hello World" will be printed 8 times. Explanation: 2^n times where n is the number of calls to fork()

‡What is a drawback of MVT? Answer: It does not have the features like ‡ability to support multiple processors ‡virtual storage ‡source level debugging ‡What is process spawning? Answer: When the OS at the explicit request of another process creates a process, this action is called process spawning. ‡How many jobs can be run concurrently on MVT? Answer: 15 jobs ‡List out some reasons for process termination. Answer: ‡Normal completion ‡Time limit exceeded ‡Memory unavailable ‡Bounds violation ‡Protection error ‡Arithmetic error ‡Time overrun ‡I/O failure ‡Invalid instruction ‡Privileged instruction ‡Data misuse ‡Operator or OS intervention ‡Parent termination. ‡What are the reasons for process suspension? Answer: swapping ‡interactive user request ‡timing ‡parent process request ‡What is process migration? Answer: It is the transfer of sufficient amount of the state of process from one machine to the target machine ‡What is mutant? Answer: In Windows NT a mutant provides kernel mode or user mode mutual exclusion with the notion of ownership.

What is Software Engineering?
‡ Software engineering can be described in terms of analysis (front end software engineering; breaking apart a problem into pieces) and synthesis (back end software engineering; constructing a solution from available or new components). By analogy to other engineering disciplines, we can infer that software engineering attempts to establish the kinds of methods and tools that enable software projects to be built predictably within proscribed schedules and budgets, meeting the customer's requirements of functionality and reliability. Lethbridge's definition is: software engineering is the process of solving customers' problems by the systematic development and evolution of largehigh quality software systems within cost, time, and other constraints. ‡ ‡ ‡ ‡ ‡ ‡ But software engineering is radically different than other engineering disciplines, in that: the end product is abstract, not a concrete object like a bridge costs are almost all human; materials are an ever shrinking fraction easy to fix bugs, but hard to test and validate software never wears out...but the hardware/os platforms it runs on do variations in application domain are open-ended, may require extensive new non-software, non-engineering knowledge for each project

Phases of Software Development Whether you follow the "Waterfall Model" or the "Spiral Model", software development includes the following aspects. The Waterfall Model says to do these things in order. The Spiral Model says to repeat these tasks in a cycle, adding detail and making corrections, until you know what you are doing. Note that many or most of these tasks produce documents, not programs, as their end result. Requirements Analysis Software Design Coding Testing Maintenance

Use Cases and Class Extraction You can identify classes from a software specification document by looking for "interesting" nouns, where interesting implies there are some pieces of information to represent in your application, and operations to perform on them. You can also identify classes by developing use cases from the specification document. Use cases are formatted descriptions of "discrete" tasks. By "discrete", we mean an individual standalone thing a user does while using the system. If you look through the tasks mentioned in a specification document, you can identify a set of candidates. Example candidate tasks for a "wargame": ‡ Combat ‡ Roll dice ‡ Move pieces ‡ Perform the Missions Phase Example candidate tasks for Monopoly: 1. Buy property 2. Roll dice 3. Move piece 4. Count money

Terminology actor role that an external entity plays in a system use case (or just "case") depiction of some aspect of system functionality that is visible to one or more actors. extension a use case that illustrates a different or deeper perspective on another use case use a use cases that re-uses another use case. We have previously introduced use cases and use case diagrams. Lethbridge defines a use case as: A use case is a typical sequence of actions that an actor performs in order to complete a given task. Now we will expand on the discussion of use cases, use case diagrams, and look at examples.

Use Case Descriptions Drawing an oval and putting the name of a task in it is not very helpful by itself, for each use case you need to add a detailed use case description. Your first homework assignment is to "go and do this" for your semester project. . Each use case has many or all of the following pieces of information. The items in bold would be found in any reasonable use case description. Name The name of the use case. Actors What participants are involved in this task. Goals What those people are trying to accomplish. Preconditions The initial state or event that triggers this task. Summary Short paragraph stating what this task is all about. Related use cases What use cases does this use case use or extend? What uses/extends this use case?

Steps The most common sequence of actions that are performed for this task. Lethbridge divides actions into two columns: user input is given in the left column, while system response is given in the right column. The two column format is optional, but saves on paper and may improve clarity. The steps are numbered, so there is no ambiguity in using both columns on each line. Alternatives Some use cases may vary the normal sequence of steps. Postconditions what does this task produce?

A simple generic use case for a "file open" operation might look like:
Open File Summary: A user performs this task in order to view a document. The user specifies a filename and the document is opened in a new window. Steps: 1. Choose "Open" from the menu bar. 2. System displays a File Open dialog. 3. User selects a filename and clicks "OK". 4. System closes the dialog and opens the file in a new window. Alternative: If the user clicks Cancel in step 3, no file is opened

Exit parking lot, paying cash Actor: car driver Goal: to leave the parking lot Precondition: driver previously entered the parking lot, picked up a ticket, and has stayed in the lot long enough that they must pay to leave. Summary: driver brings their vehicle to an exit lane, inserts their ticket into a machine, and pays the amount shown on the machine. Related use case: exit parking lot, paying via credit card. Steps:

1. Drive to exit lane, triggering a sensor. 3. Insert ticket. 5. Insert money into slot until cash in exceeds amount due. 7. Drive through exit, triggering a sensor.

2. System prompts driver to insert their ticket. 4. System displays amount due. 6. System returns change (if any) and raises exit barrier 8. Lower exit barrier

This one is for a library management application Check out item for a borrower Actor: Checkout clerk (regularly), chief librarian (occasionally) Goal: Help the borrower borrow the item, and record the loan Precondition: The borrower wants to borrow a book, and must have a library card and not owe any fines. The item must be allowed for checkout (not on reserve, not from reference section, not a new periodical, etc.) Steps:

1. Scan item's bar code and borrower's library card. 3. Stamp item with the due date.

2. Display confirmation that the loan is allowed, give due date.

4. Click "OK" to check out item to 5. Record the loan and display confirmation borrower. that record has been made. Alternative: the loan may be denied for any number of interesting reasons in step 2 (see preconditions).

Use Case Diagrams and Examples One reason to do a use case diagram is simply to summarize or catalog what tasks are part of the system; a sort of table of contents. But the main reason use case diagrams exist is in order to show who does what, when different users (actors) participate in different (overlapping) tasks. If you only have one actor, or there are no tasks in which multiple actors interact, there may be no reason that you have to do a use case dialog.

There are three actors (Registrar, Student, Professor), and there are five use cases. The "Find information about course" use case is vague and probably the three actor types can find out different information from each other. They are not typically involved in the same instance of finding out information about a class, so the example could be better. a bunch of more exotic use case diagram items, namely actors and use cases that use or extend other actors and use cases.

Class Diagrams
Class diagrams are the "meat and potatoes" of object-oriented analysis and design. We will begin our discussion of them today, and continue next week. Class diagrams describe more detailed, more implementation-oriented things than use case diagrams. Class diagrams can present varying levels of detail about the classes in them. Some class diagrams may have nothing more than the class name for each class; others may hold the full list of fields and methods. When more space is taken by class details, there is room for fewer classes per diagram, so you often have "overview diagrams" that show many classes and their connections, supplemented by "detail diagrams" that show more information about closely related classes. Associations Perhaps the main purpose for class diagrams is to identify and depict relationships between objects that will be needed in the running system. An association is the word we use for such a relationship. We draw a line between the rectangles for classes to depict an assocation. There are three major types of associations: inheritance aggregation user defined

Inheritance: the Un-Association We have discussed how inheritance is not really an association, it is a relationship between kinds of things, in the design and maybe in the programming language type system, whereas associations are relationships between instances (objects) at runtime. Inheritance is so vital that many class diagrams focus specifically on a large inheritance class hierarchy, similar to a biological taxonomy of species. Inheritance is usually a static feature of a design, although there exist languages in which instances can change who they inherit from at runtime. Here is an example class hierarchy

Aggregation: the Simplest Association Aggregation, the parts-whole relationship, is perhaps the most useful association of all of them. Many many complex things are made up of an assembly of simpler items. There are at least two flavors of aggregation, static and dynamic. Static aggregation is lifelong aggregation; the parts cannot exist apart from the whole, or enter or leave the whole. Dynamic aggregation is more like a team whose members can come and go. Here is an example of a massive chain of aggregations with a familiar theme:

Association Details There are many details added to associations to show more information about the relationship. Some of these details are discussed in Chapter 5 in your text.

link
just as classes have instances at runtime called objects, associations have instances at runtime called links. Links occasionally are so important and complicated that they need their own attributes. The main information about them is usually their lifetime, and what instances they are connecting.

multiplicity
a.k.a. cardinality, it is the number of object instances per link instance in a given relationship

qualifier
some many-to-one relationships have a unique key used to traverse the association.

roles
the different ends of an association may have differing roles associated with them. Especially useful if both ends of an association connect the same class.

composition
there is a special kind of aggregation called composition, which denotes aggregations in which the component parts have no existence apart from the whole thing. The relationship is hardwired, static, or constant. Composition is marked using a filled diamond; hollow diamond means a regular (transitory, or dynamic) aggregation.

Here are some more class diagram figures from some old software engineering text (Pfleeger). One point here is that it is logical to start with a simple sketch of classes and basic relationships, and add many details later on.

Statecharts A statechart, or state diagram, depicts dynamic properties of a system. See p. 276 of the text. A statechart consists of

a set of states
drawn as circles, ovals, or rectangles, with a label or number inside.

a set of transitions
drawn as arrows from one state to another.

a start state, and a set of final states
Some of you may be getting an eery sense of deja vu at this point. Statecharts are a non-trivial extension of finite automata, because they have: instead of "input symbols", events associated with transitions these may be complex, synchronous or asynchronous events may have conditions, drawn inside square brackets activities

Statechart Diagram Examples

Collaboration Diagrams Collaboration diagrams are the next form of UML diagram we will describe in this course. Collaboration diagrams describe how a set of objects interacts by calling from method to method. Collaboration Diagram Examples

A collaboration where an actor pushes a button to get an elevator to his floor. The control object checks how long the job queues of all the elevators are and chooses the shortest. It then creates a job order object and invokes it by putting it in a queue. The elevator object runs concurrently and picks up jobs from the queues. The elevator is an active object, meaning that it executes concurrently with its own thread of control.

The object MainWindow receives the message NewCustomer, and creates a Customer object. A CustomerWindow is created, and the customer object is then passed to the CustomerWindow which allows for update of the customer data.

Object Oriented Design: Adding Detail Detailed Design You are dividing labor right now for work on phase 2, adding details and corrections to your project analysis, and merging ideas you find in other teams' homework #2. Make sure your names are on any submitted course documents. In fact, I need to know who did which parts of which documents, so I don't lump everyone together under the same grade. If you are asked to prepare part of a document you don't understand, better ask your classmates and/or instructor what is needed for that part.

User Interface Design By the next round of turnin, we will need to establish a fairly complete user interface design for things like the main screen. User Interface Design is the subject of an entire course (CS 485) and for our purposes we will have to settle for a rudimentary and primitive introduction. User interface design starts from what tasks/activities the application is to support. You probably will discover a few tasks in this phase that requires a dialog for a task we haven't identified previously. But mainly we need to design dialogs and sequences of actions to perform specific tasks in use cases. Aspects of User Interfaces look this is the most obvious part of user interface design, but not the most important part feel this is like: what clicks perform what operations. how many clicks does it take. does it feel like you are directly manipulating the objects on the screen, or does it feel like you are following a long sequence of orders you receive from the program. metaphors users can quickly learn an unfamiliar task, or quickly interpret an unfamiliar graphic, if a familiar metaphor is used. Examples: "desktop metaphor" mental model a user interface provides the user with a particular mental model of how they view the system. designing that model will determine many aspects of the user interface (what info to show, what tasks to support) navigation rules navigation through large structures which don't all fit on the screen is a central issue for many (most) applications.

1. 2. 3. 4. 5.

A few Obvious User Interface Tips Minimize # of clicks for common tasks Provide all the information that's needed on a single screen Strive for "direct manipulation" Modeless is usually better than modal Be familiar and consistent with other applications

Interpersonal Communications: Some Rules of Engagement 1. Respect your classmates, even when you disagree or they are wrong. "Treat others the way you would like to be treated" - Jesus. I am not impressed, and will not tolerate for long, group "leaders" who disrespect their teammates publically. If you have a problem with one of your team member's contributions, discuss it with them privately. If you cannot resolve it through polite discussion with the individual, discuss it RESPECTFULLY within your group, and if there is a problem that can't be resolved internally, see me. Part of your grade will be based on whether I determine that you respected your classmates or not. 2. Accept group decisions even when you disagree. "The Needs of the Many Outweigh the Needs of the Few...or the One" - Spock. There has to be some mechanism for making decisions, whether it is democracy, dictatorship, or whatever. Those decisions should be made based on what's best for the group, not what makes an individual look good. 3. You must include all group members in decisions. I want to hear no more team members who are surprised about something that affects them. 4. You should do your best to contribute to your team. "From each according to his abilities" - Marx. The easiest way to fail this course is to not contribute to your team. If you do your best, make your contribution, and the team discards it, that is not your problem or fault. If you don't do your best to help your team succeed, don't be surprised at the grade you get. 5. E-mail is not a good medium for resolving problems. I have found through many long years that e-mail does not work well at conveying emotions. Using e-mail to try to resolve problems can easily make them worse. Of course, sometimes you have no choice, but basically e-mail is easily misinterpreted. Human faces and intonation are lost, and people do not type as well as they talk. When there is a problem, your best bet is to e-mail to setup a meeting to discuss it. Your next best bet is to think, and rethink, what you are planning to send by e-mail. Ask: how will this person react to this e-mail? Have I respected them? Will they understand my situation? Will they feel I am attacking them, or trying to help?

Design methods 1. modular decomposition top-down breaking up function into parts 2. data-oriented decomposition top-down breaking up information into parts 3. event-oriented decomposition identifying what changes are to be made, and when they occur 4. outside-in design blackbox I/O orientation 5. object-oriented design relationships between data Things that get designed 1. Architecture interaction between programs and their environment, including other programs 2. Code algorithms and data structures, starting with equations, pseudocode, etc. 3. Executable/package how is this system going to be installed and run on user machines? Common architectures Pipes, layers, client-server, peer-to-peer, ring ... Some common breakdowns 1. poor prioritization 2. failure to consider constraints on the solution (missing requirements) 3. failing to perform mental simulations of complex multi-step activities 4. failing to track and return to subproblems which aren't solved yet 5. failing to expand/merge/integrate subsolutions into a complete whole

"Good" Design .

Low coupling
Coupling refers to the interdependences between components. Components need to be as independent as possible. The book defines many kinds of coupling, including content coupling, control coupling, stamp coupling, and data coupling.

High cohesion
Cohesion refers to the degree to which a component is focused and connected internally (it is almost "internal coupling"). Bad cohesion has a single component doing unrelated tasks. Bad cohesion may coinside with lots of duplicate code (same thing repeated with slight changes for different tasks). The book defines levels of cohesion: coincidental, logical, temporal, procedural, communicational, sequential, functional.

Minimal complexity
There are several types of complexity, but in general, complexity is bad, and the goal is to minimize it while meeting requirements. Most of the complexity measures that are out there measure the complexity of code, but we are talking about design right now. Designs that are complex, or designs that poorly address the application domain and requirements, lead to complex code. Bad programmers can of course create complex code from even good designs.

Final Exam Review The final exam will cover the whole course, with an emphasis on software engineering "back-end" issues. Review your UML, especially parts you missed on the midterm -- what is the difference between a state and an event? When I ask you to draw a statechart, knowing what a state is will be important. What is the difference between a class and an association? There were in general more misunderstandings about statecharts than about class diagrams, and more misunderstandings about collaboration diagrams than about statecharts. What is the purpose of a collaboration diagram? What tasks are involved in the so-called ``back end'' of software development? When you take a UML class diagram and write the code that corresponds to it, how to you implement each of the things you see in the diagram? The closer the language corresponds back to the diagramming notation, the easier it will be to implement from a design and keep them in sync. What is software testing? What is its purpose? What kinds of software testing are there? What is software metrics? What categories of measurement are there? What specific measures? What are the most frequent kinds of bugs you have encountered in this semester? What has been the hardest part about doing the project? What has been the hardest part about doing the coding? What methods worked, and what methods did not work very well? Is it harder to write new code, or to modify someone else's existing code? Why? What is CVS? How does it work? What are the major CVS commands? Suppose you get a "conflicts during merge" message from CVS; what causes it and what do you do about it? What other software tools did we use this semester? What do they do, how do you use them? Were there any C++ language features you had to learn this semester in order to implement your project? If so, what were they? Were there any problems related to using the language or class libraries?

Binary search Example
Looking for 46
Trial 1

2 4 5 12 16 19 22 26 29 32 37 41 46 50 2 2 4 5 12 16 19 22 26 29 32 37 41 46 50 3 2 4 5 12 16 19 22 26 29 32 37 41 46 50

Notes on Binary Searches
‡ List must be ordered (sorted)
± can maintain a list in ordered fashion

‡ Much more efficient than linear
± in example, took 3 iterations instead of 13 ± time ~ log2(listLength) ± linear
‡ worst case ~ listLength ‡ average ~ listLength/2

± for 100K words: 17 iterations versus 50,000

‡ More complex to program

Searching
Things To Know ‡ Be able to recognize and write a linear search ‡ Understand its pros and cons ‡ Know the concepts of a Binary Search

Questions
2 10 17 45 49 55 68 85 92 98
How many comparisons are needed to determine if the following items are in the list of 10 items? number
15 49 98 2

linear search
10 (3, if know list sorted) 5 10 1

binary search
3 (49, 10, 17) 1 4 (49, 85, 92, 98) 3 (49, 10, 2)

Sorting
‡ Put elements of an array in some order
± alphabetize names ± order grades lowest to highest

‡ Three simple sorting algorithms
± selection sort ± insertion sort ± bubble

Selection Sort
‡ Sorts by putting values directly into their final, sorted position ‡ For each position in the list, the selection sort finds the value that belongs in that position and puts it there

Selection Sort
General Algorithm
‡ Scan the list to find the smallest value ‡ Exchange (swap) that value with the value in the first position in the list ‡ Scan rest of list for the next smallest value ‡ Exchange that value with the value in the second position in the list ‡ And so on, until you get to the end of the list

Selection Sort
At Work
98 68 68 98 83 83 74 74 93 93

68 68 68

74 74 74

83 83 83

98 98 93

93 93 98

SORTED!

Selection Sort
‡ Sorts in ascending order ‡ Can be changed to sort in descending order
± look for max instead of min

Insertion Sort
‡ Like we¶d actually sort things ‡ Insert each new item into an already sorted list ‡ Each unsorted element is inserted at the appropriate spot in the sorted subset until the list is ordered

Insertion Sort
General Algorithm
‡ Sort the first two values (swap, if necessary) ‡ Repeat:
± insert list¶s next value into the appropriate position relative to the first ones (which are already sorted)

‡ Each time insertion made, number of values in the sorted subset increases by one ‡ Other values in array shift to make room for inserted elements

Insertion Sort
At Work
98 68 68 98 83 83 74 74 93 93

68 68 68

83 74 74

98 83 83

74 98 93

93 93 98

SORTED!

Insertion Sort
‡ Outer loop controls the index in the array of the next value to be inserted ‡ Inner loop compares the current insert value with values stored at lower indexes ‡ Each iteration of the outer loop adds one more value to the sorted subset of the list, until the entire list is sorted

Bubble Sort
‡ "bubble"
± largest values bubble to the end ± smallest values sink to the beginning

‡ Idea
± go through the list and swap neighboring items if needed

‡ Pros
± easy to understand and code

‡ Cons
± horribly inefficient (listLength2)

Bubble Sort
At Work
98 68 68 68 68 68 68 98 83 83 83 74 83 83 98 74 74 83 74 74 74 98 93 93 93 93 93 93 98 98

SORTED!

Sort Implementations
‡ All three use double (nested) loops ‡ Selection and insertion
± an outer loops scans all elements ± an inner loop scans and switches/inserts as needed

‡ Bubble
± an outer loop repeats until no swaps are needed ± an inner loops scans and swaps as needed

Sorting
Things To Know ‡ Be able to recognize and follow an insertion sort, selection sort, and bubble sort ‡ Understand their pros and cons ‡ Know that many other sorts exist with varying efficiency and programming difficulty
Sorting animations (in Java of course!)
http://www.cs.hope.edu/~alganim/animator/Animator.html

Question
Given the operation of the following sort, identify the type of sort (selection, insertion, or bubble) original

34 21 21 21 21 15

21 34 34 34 15 21

97 97 15 15 34 34

15 15 97 87 87 87

87 87 87 97 97 97

pass 1 pass 2 pass 3 pass 4 pass 5 SORTED

Question
Given the operation of the following sort, identify the type of sort (selection, insertion, or bubble)

34 21 21 15 15

21 34 34 21 21

97 97 97 34 34

15 15 15 97 87

87 87 87 87 97

original pass 1 pass 2 pass 3 pass 4 SORTED

Sorting
Things Other Than Numbers ‡ characters
± same as integers (compare with < and >)

‡ Strings
± use the built-in compareTo method

‡ Other Objects
± we write a compareTo method ± use the compareTo method

Recursion
‡ Recursive functions are defined in terms of themselves.
± sum(n) = n + sum(n-1) if n > 1 ± Example:

‡ Other functions that could be defined recursively include factorial and Fibonacci sequence.

Recursion (cont.)
‡ A method is recursive if it calls itself. ‡ Factorial example:

‡ Fibonacci sequence example:

Recursion (cont.)
‡ Tracing a recursive method can help to understand it:

Recursion (cont.)
‡ Guidelines for implementing recursive methods:
± Must have a well-defined stopping state ± The recursive step must lead to the stopping state. ‡ The step in which the method calls itself ± If either condition is not met, it will result in infinite recursion. ‡ Creates a stack overflow error and program crashes

Recursion (cont.)
‡ Run-time support for recursive methods:
± A call stack (large storage area) is created at program startup. ± When a method is called, an activation record is added to the top of the call stack. ‡ Contains space for the method parameters, the method¶s local variables, and the return value

Recursion (cont.)

Figure 12-1: Activation records on the call stack during recursive calls to factorial

Recursion (cont.)

Figure 12-2: Activation records on the call stack during returns from recursive calls to factorial

Recursion (cont.)
‡ Recursion can always be used in place of iteration, and vice-versa.
± Executing a method call and the corresponding return statement usually takes longer than incrementing and testing a loop control variable. ± Method calls tie up memory that is not freed until the methods complete their tasks. ± However, recursion can be much more

Recursion (cont.)
‡ Tail-recursive algorithms perform no work after the recursive call.
± Some compilers can optimize the compiled code so that no extra stack memory is required.

Complexity Analysis
‡ What is the effect on the method of increasing the quantity of data processed?
± Does execution time increase exponentially or linearly with amount of data being processed?

‡ Example:

Complexity Analysis (cont.)
‡ If array¶s size is n, the execution time is determined as follows: ‡ Execution time can be expressed using Big-O notation.
± Previous example is O(n)
‡ Execution time is on the order of n. ‡ Linear time

Complexity Analysis (cont.)
‡ Another O(n) method:

Complexity Analysis (cont.)
‡ An O(n2) method:

Complexity Analysis (cont.)

Table 12-1: Names of some common big-O values

Complexity Analysis (cont.)
‡ O(1) is best complexity. ‡ Exponential complexity is generally bad.

Table 12-2: How big-O values vary depending on n

Complexity Analysis (cont.)
‡ Recursive Fibonacci sequence algorithm is exponential.
± O(rn), where r § 1.62

Figure 12-7: Calls needed to compute the sixth Fibonacci number recursively

Complexity Analysis (cont.)

Table 12-3: Calls needed to compute the nth Fibonacci number recursively

Complexity Analysis (cont.)
‡ Three cases of complexity are typically analyzed for an algorithm:
± Best case: When does an algorithm do the least work, and with what complexity? ± Worst case: When does an algorithm do the most work, and with what complexity? ± Average case: When does an algorithm do a typical amount of work, and with

Complexity Analysis (cont.)
‡ Examples:
± A summation of array values has a best, worst, and typical complexity of O(n). ‡ Always visits every array element ± A linear search: ‡ Best case of O(1) ± element found on first iteration ‡ Worst case of O(n) ± element found on last iteration ‡ Average case of O(n/2)

Complexity Analysis (cont.)
‡ Bubble sort complexity:
± Best case is O(n) ± when array already sorted ± Worst case is O(n2) ± array sorted in reverse order ± Average case is closer to O(n2).

Binary Search

Figure 12-8: Binary search algorithm (searching for 320)

Figure 12-9: List for the binary search algorithm with all numbers visible

Binary Search (cont.)

Table 12-4: Maximum number of steps needed to binary search lists of various sizes

Binary Search (cont.)
‡ Iterative and recursive binary searches are O(log n).

Binary Search (cont.)

Figure 12-10: Steps in an iterative binary search for the number 320

Binary Search (cont.)

Quicksort
‡ Sorting algorithms, such as insertion sort and bubble sort, are O(n2). ‡ Quick Sort is O(n log n).
± Break array into two parts and then move larger values to one end and smaller values to other end. ± Recursively repeat procedure on each array half.

Quicksort (cont.)

Figure 12-11: An unsorted array

‡ Phase 1:

Quicksort (cont.)
‡ Phase 1 (cont.):

Quicksort (cont.)
‡ Phase 1 (cont.):

Quicksort (cont.)
‡ Phase 1 (cont.):

Quicksort (cont.)
‡ Phase 1 (cont.):

Quicksort (cont.)
‡ Phase 1 (cont.):

‡ Phase 2 and beyond: Recursively perform phase 1 on each half of the array.

Quicksort (cont.)
‡ Complexity analysis:
± Amount of work in phase 1 is O(n). ± Amount of work in phase 2 and beyond is O(n). ± In the typical case, there will be log2 n phases. ± Overall complexity will be O(n log2 n).

Quicksort (cont.)
‡ Implementation:

Merge Sort
‡ Recursive, divide-and-conquer approach
± Compute middle position of an array and recursively sort left and right subarrays. ± Merge sorted subarrays into single sorted array.

‡ Three methods required:
± mergeSort: Public method called by clients

Merge Sort (cont.)

Merge Sort (cont.)

Merge Sort (cont.)

Figure 12-22: Subarrays generated during calls of mergeSort

Merge Sort (cont.)

Figure 12-23: Merging the subarrays generated during a merge sort

Merge Sort (cont.)
‡ Complexity analysis:
± Execution time dominated by the two for loops in the merge method ± Each loops (high + low + 1) times ‡ For each recursive stage, O(high + low) or O(n) ± Number of stages is O(log n), so overall complexity is O(n log n).

Design, Testing, and Debugging Hints
‡ When designing a recursive method, ensure:
± A well-defined stopping state ± A recursive step that changes the size of the data so the stopping state will eventually be reached

‡ Recursive methods can be easier to write correctly than equivalent iterative methods.

Summary
‡ A recursive method is a method that calls itself to solve a problem. ‡ Recursive solutions have one or more base cases or termination conditions that return a simple value or void. ‡ Recursive solutions have one or more recursive steps that receive a smaller instance of the problem as a parameter.

Summary (cont.)
‡ Some recursive methods combine the results of earlier calls to produce a complete solution. ‡ Run-time behavior of an algorithm can be expressed in terms of big-O notation. ‡ Big-O notation shows approximately how the work of the algorithm grows as a function of its problem size.

Summary (cont.)
‡ There are different orders of complexity such as constant, linear, quadratic, and exponential. ‡ Through complexity analysis and clever design, the complexity of an algorithm can be reduced to increase efficiency. ‡ Quicksort uses recursion and can perform much more efficiently than selection sort, bubble sort, or insertion

Selection Sort Algorithm
‡ List is sorted by selecting list element and moving it to its proper position ‡ Algorithm finds position of smallest element and moves it to top of unsorted portion of list ‡ Repeats process above until entire list is sorted

Selection Sort Algorithm (Cont¶d)

Figure 1: An array of 10 elements

Figure 2: Smallest element of unsorted array

Selection Sort Algorithm (Cont¶d)

Figure 3: Swap elements list[0] and list[7]

Figure 4: Array after swapping list[0] and list[7]

Insertion Sort Algorithm
‡ The insertion sort algorithm sorts the list by moving each element to its proper place

Figure 6: Array list to be sorted

Figure 7: Sorted and unsorted portions of the array list

Insertion Sort Algorithm (Cont¶d)

Figure 8: Move list[4] into list[2]

Figure 9: Copy list[4] into temp

Insertion Sort Algorithm (Cont¶d)

Figure 10: Array list before copying list[3] into list[4], then list[2] into list[3]

Figure 11: Array list after copying list[3] into list[4], and then list[2] into list[3]

Insertion Sort Algorithm (Cont¶d)

Figure 12: Array list after copying temp into list[2]

Bubble Sort Algorithm
‡ Bubble sort algorithm:
± Suppose list[0...N - 1] is a list of n elements, indexed 0 to N - 1 ± We want to rearrange; that is, sort, the elements of list in increasing order ± The bubble sort algorithm works as follows:
‡ In a series of N - 1 iterations, the successive elements, list[index] and list[index + 1] of list are compared ‡ If list[index] is greater than list[index + 1], then the elements list[index] and list[index + 1] are swapped, that is, interchanged

Bubble Sort Algorithm (Cont¶d)

Figure 13: Elements of array list during the first iteration

Figure 14: Elements of array list during the second iteration

Bubble Sort Algorithm (Cont¶d)

Figure 15: Elements of array list during the third iteration

Figure 16: Elements of array list during the fourth iteration

Outline of Today¶s Tutorial
‡ ‡ ‡ ‡ ‡ ‡ Objective Introduction to C++ Function Pointer Class Summary

Objective of tutorials
‡ To acquire adequate programming knowledge for the coming assignments ‡ To be able to turn ideas into codes ‡ Programming in C++ (VC++ in Windows environment) ‡ I assume that most of you do not have any experience in programming. I will start from those fundamental knowledge.

Objective of tutorials
‡ Attendance will not be counted towards your final score of the course, but you are strongly encourage to attend. ‡ Guidance and hints are provided for assignments and test preparation ‡ If you have any question, please post it on the newsgroup or approach to the TAs.

TA of COMP171
‡ Chan Ming-yuen pazuchan@ust.hk 4204 ‡ Yihai SHEN shenyh@cs.ust.hk ‡ He Junfeng hejf@cs.ust.hk 4204

What¶s C++
‡ ‡ ‡ ‡ ‡ A programming language Data abstraction Object-oriented programming Generic programming Compiler translate C++ codes to a machine specific executable program (eg. VC++ in Windows)

Ideas to codes
‡ ‡     ‡ The art of programming From problems to solutions Problem solving technique Programming technique and style How to develop a program Use of various tools to help programming Practice makes perfect

How to create a Program
‡ Specify the problem ± eg. Remove ambiguity and identify constraints ‡ Develop algorithms and design classes (OOP) ‡ Implementation ± design, coding, debug. ‡ Documentation, testing, maintenance of programs.

Hello World
‡ Example: a ³Hello World´ program ‡

Hello World
‡ #include statement makes libraries of classes & functions accessible to the program ‡ Compile needs access to interface, what the functions look like, but not the implementation. ‡ Documentation ± comments on codes increase the readability. Cost of maintenance is always higher than that of development.

A More General C++ program

Functions
‡ Reason: functions are abstractions that help you to reuse ideas and codes ± make the code clearer, more logical and comprehensible

Functions
‡ function prototyping: a description of the types of arguments when declaring and defining a function ‡ void funct(float x, float y, float z); ‡ Of course, you can choose not to have any arguments, void funct(void)

Functions
‡ Return values ‡ Example

Execution and Flow
‡ Execution of C++ program is organized around statements  Statements execute sequentially  Or governed by control that repeats a group of statement (loop). Eg. For, while..  Or selected one of several groups to execute. (if else)  A statement executes, it cause other statements to execute (function calls)

Pointers & Dynamic Data

Pointer Variable

Dereference Operator

More Example

Pointer & Array
‡ Pointer and array are closely related in C++ ‡ We can use a pointer to access the elements of an array

Pointer & array

Pointer & Array

Pointers & Constants
‡ When using a pointer, two objects are involved: the pointer itself and the object pointed to. ‡ Consider the difference between pointer to constant, constant pointer and constant pointer to constant

Pointers & Constants

Pointers and Constants
‡ Besides, the address of a constant cannot be assigned to an unrestricted pointer

References
‡ A reference is an alternative name for an object. ‡ The notation X& means reference to X ‡ Different from the previous µ&¶ which indicates the address

References
‡ Example

Reference
‡ To ensure that a reference is a name for something, the reference must be initialized ‡ Example

References
‡ Another example

Note that rr++ does not increment the reference rr (comparing with pointer), rather, it is applied to an int that happens to be ii

Reference
‡ Value of a reference cannot be changed after initialization ‡ Similar to a constant pointer (but cannot be manipulated the way that a pointer is) ‡ In the previous case, pp is a pointer and rr is a reference to ii

Function Revisited
‡ Usually, arguments are passed to function as input for manipulation ‡ Knowledge on pointers and references can be employed ‡ The manner that parameters are passed to the function can lead to different results

Parameter Passing
‡ Different ways to pass parameters into a function ‡ Pass-by-value, pass-by-address, and pass-by reference ‡ Ordinarily, arguments are passed by value to a function ± a copy of the argument is made inside the function

Pass-by-value

Pass-by-address
‡ A pointer is passed instead of a value ‡ Pointer acts as an alias to an outside object ‡ Any changes to the alias in the function will be reflect to ³outside´ object

Pass-by-address

Pass-by-reference
‡ C++ provide another way to pass an address into a function ± reference ‡ Similar to pass-by-address ‡ The effect of the reference is that it actually takes the address and passes it in, rather than making a copy of the value

Pass-by-reference

Class
‡ A tool for creating new types ‡ Conveniently used as if the built-in type, but user-defined ‡ Derived classes and templates ± related classes are organized in a specific way according to their relationships ‡ Remember: Class is an abstraction of a group of objects, while an object is an instance of the class

Class

Class

Class ± Member Functions
‡ Functions declared within a class definition ‡ Invoked only for a specific variable of the appropriate type

Class ± Constructor
‡ A special function for the initialization of class objects ‡ It has the same name as the class itself ‡ Default or user-defined constructors

Class - Constructor

Class ± Access Control
‡ Three keywords/categories: public, private and protected ‡ public means all member declarations that follow are available to everyone ‡ The private keyword, means that no one can access that member except you, the creator of the type, inside function members of that type

Class ± Access Control
‡ Protected acts just like Private, except that it allow the inherited class to gain access. ‡ Example

Summary
‡ Topics covered in this tutorial: Function, Class, Pointer, Reference, etc ‡ For more details, please refer to your lecture notes ,texture book and references ‡ Of course, I am looking forward to having your feedback on the tutorials (for example, Is there any interesting problem that you want me to address in the tutorial)

This week's topics
‡ Sorting
± Selection, bubble, and insertion sort

‡ Profiling and analyzing sort algorithms ‡ Searching
± Linear search ± Binary search

Sorting
‡ Often useful and necessary to sort information (alphabetical order, numerical order) ‡ Ordering of information helps the process of evaluation, searching, and selecting data. ‡ What types of data do you know that is typically sorted? ‡ Simple sort algorithms are:
± selection sort ± bubble sort ± insertion sort

Selection Sort
‡ Given an unsorted array of numbers, sort them in order smallest to largest ‡ Algorithm:
± Compare the first array element with the smallest of the remaining elements. If the first element is larger, then swap them. Otherwise, leave them alone. ± When done, the first element in the array will be the smallest. ± Repeat, starting with the second element of the array. ± Repeat for entire array up to the next to last element. Try on: 35 4 17 2
How does this algorithm change to sort from largest to smallest?

Bubble Sort
‡ Given an unsorted array of numbers, sort them in order smallest to largest ‡ Algorithm:
± Compare the first two elements of the array. If the first element is larger than the second, then swap them. Otherwise, leave them alone. ± Repeat this step for the second and third element, then the third and fourth, and so on. ± At the end of the first pass, the last number in the array is the largest. ± Repeat for as many times as there are elements in the array. Try on: 35 4 17 2
How does this algorithm change to sort from largest to smallest?

Insertion Sort
‡ ‡ Given an unsorted array of numbers, sort them in order smallest to largest Algorithm:
± Start with the first element of the array. At this point, this first element is sorted. ± Compare second element of array with the first element. If the first element is larger than the second, then swap them. Otherwise, leave them alone. At this point, the first two elements are sorted. ± Compare third element of array with the second element. If the second element is larger than the third, then swap them and compare the second with the first element, swapping again if necessary. If no swap is necessary, this step is done and the first three elements in the array are sorted. ± Repeat for entire array. Try on: 35 4 17 2
How does this algorithm change to sort from largest to smallest?

Profiling sort algorithms
‡ What is the efficiency of the sort algorithms? Which is the best to use? ‡ Profiling is one way to determine. Can use system clock to get time of execution in milliseconds:
± Get CPU clock time (t1) ± Run sort method ± Get CPU clock time (t2) ± Sort time (approximately) is t2 ± t1
Selection soft graph results with increasing size of numbers to sort:

Time

numbers

Parabola shape. Double data results in fourfold increase in time.

Analyzing sort algorithms
‡ Can also determine time by analyzing how many times each array element is visited during search. ‡ Number of visits for selection sort (n numbers): ½ n2 + 5/2 n ± 3 ‡ As n gets bigger, fastest growing term is n2, so rest of equation can be ignored. ‡ Selection sort considered O(n2) algorithm - this is called Big-Oh notation ‡ Selection sort, Bubble sort, and Insertion sort are all O(n2)algorithms

Searching
‡ When there are a large number of items to search, it is often necessary to have a strategy for finding a specific item. ‡ What examples can you think of for searching out an item? ‡ Does it help if the items are ordered or arranged? ‡ Two simple searching techniques are the linear search and the binary search.

Linear Search
‡ A linear search looks through list from the beginning until it encounters the desired item. ‡ If the list is sorted, the search process can end when a value greater than the one sought out is found.
int foundIt = -1; for (int i = 0; i < array.length; i++) { if (array[i] == searchValue) { foundIt = i; break; // out of for loop } } // at this point, foundIt holds position of item or ±1
Linear search is O(?) algorithm

Binary Search
³Divide and Conquer´
‡ ‡
± ±

A binary search assumes you start with a sorted list. Algorithm:
The list is divided in half to find the mid-point. Code for binary At this mid-point, one of three states exist: search is in BigJava pg. 652 1. You have found the item. 2. The item is less than the mid-point. 3. The item is greater than the mid-point. If the value sought is not found, divide the remaining space in half and find a new mid-point. Repeat until you find the item or run out of space to divide.

± ±

Binary search is O(logn) algorithm

Next Week
Be sure to review the course schedule for new assignments and assignments that are due.

Question :Is the following statement a declaration/definition. Find what does it mean? int (*x)[10]; Answer:Definition. x is a pointer to array of(size 10) integers. Apply clock-wise rule to find the meaning of this definition.
Question :What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); } Answer:Compiler error: Multiple declaration for error The name error is used in the two meanings. One means that it is a enumerator constant with value 1. The another use is that it is a type name (due to typedef) for enum errorType. Given a situation the compiler cannot distinguish the meaning of error to know in what sense the error is used: error g1; g1=error; // which error it refers in each case? When the compiler can distinguish between usages then it will not issue error (in pure technical terms, names can only be overloaded in different namespaces). Note: the extra comma in the declaration, enum errorType{warning, error, exception,} is not an error. An extra comma is valid and is provided just for programmerï¿ s convenience.

#ifdef something int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); } Answer:Compiler error : undefined symbol some This is a very simple example for conditional compilation. The name something is not already known to the compiler making the declaration int some = 0; Question : effectively removed from the source code. #if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); } Answer:0 0 This code is to show that preprocessor expressions are not the same as the ordinary expressions. If a name is not known the preprocessor treats it to be equal to zero.

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.