Tuesday, May 10, 2011

Software Engineering Questions


1. How might a project policy that requires all programming staff to produce 50 lines of documentation per 1000 LOC prove inappropriate or counter-productive?
Ans : Provide 5 examples to support your position and limit your answer to 500 words or less.
This policy could reward inappropriate behavior such as
1. a programmer that is very careful to produce self-documenting code and thus may feel that he/she does not need to add extra documentation may be discouraged from continuing to produce self-documenting code.
2. mandating a specific number of documentation lines per 1000 LOC does not take into account that there are differences in the amount of documentation needed for different types of code - very complex algorithms may need more and standard business type apps may take less and rewarding them in the same way does not impress upon the programmers when documentation is appropriate and necessary.
3. mandating the amount and not the quality does not reward the programmer that produces clear, concise comments as opposed to the programmer that produces lots of rambling, confusing documentation.
4. to connect the code to the requirements, specification and design documents, the comments may in fact be very terse since they just reference these documents and thus once again this appropriate behaviour may be inadvertently discouraged.
5. this policy does not address the case where programmers are extending classes or modifying existing codes - there may not be a clear way to count either the real LOC or the appropriate number of comments since these are both influenced by previous work. If the current programmer is punished for the inappropriate behavior of others this will taint the programmer's view of extending or using other's code.



2. Compute the function point count for the system which is described in the following informal requirements statement. Clearly state all assumptions that you make.
Ans : The system processes various commands from an operator of a chemical plant. These commands include:
• calculate and display the average temperature of a specific reactor over a 24-hour period
• calculate and display the average pressure in a specific reactor over a 24-hour period
• calculate and display a summary of the average temperatures and pressures in a specific reactor over a given time period (where the time period is greater than 1 day)
The operator can also send the results to an electronic bulletin board.

3. Develop 4 different definitions for LOC that are most appropriate for the following purposes:
1. maintainability
2. testability
3. system efficiency
4. programmer efficiency
Justify your definitions and test them out on the code you and your partner produced for any of the pair programming exercises.
Ans : • maintainability
o For maintainability, one should reward behaviour that produces well-documented code that is neither too terse or too verbose. To this end, LOC should be divided into lines of documentation, total number of LOC, and lines of executable code. If there are many lines of executable code versus total LOC then this is probably complex code that should be very well documented and thus the number of documentation lines can be evaluated with this in mind.
• testability
o For testability, the most important LOC feature is the number of executable lines since this will give you an idea of the complexity of the code and thus the quantity of testing that will be needed. If number of executable lines can be further divided into number of "control" lines (if-then-else, switch, etc) then this measure of complexity and need for tests will be further enhanced.
• system efficiency
o For system efficiency, the most important LOC features are lines of execution versus lines of non-execution that are not comment lines. A large number of non-execution lines may be an indication of lots of memory allocations - this might be a sign of possible system efficiency problems - not guaranteed to be but worth a look.
• programmer efficiency
o For programmer efficiency, the LOC features to compare would be the ratio between executable lines, non-executable lines and comment lines. This should be in balance so that one does not dominant the others. Once again this is just a way to flag if a programmer has a distinctive propensity to be too verbose or too terse.

4. Compare the measurement of program size in the case of traditional procedural programming languages and in the case of object-oriented languages. Construct your answer in the following way:
• briefly describe how size is measured in procedural language programs
• briefly describe how size is measured in object-oriented language programs
• describe the similarities
• describe the differences
Limit your answer to 500 words.


5. Develop a project policy statement that uses lines of code and the quality metrics of your choice (i.e. equations that relate LOC to elements of quality such as productivity, maintainability, etc.) to motivate and reward team members.
Ans : Provide 4 examples to support your policy decisions and limit your answer to 100 words or less.
Policy: To produce extensible/reusable code, programmers will be advised to produce code that has the following properties:
• each logical segment of code (e.g. class, method, etc) will have a ratio of lines of documentation to lines of code of at least 1:10
• all logical segment of code should be of a similar size (+- 20%) with regards LOC
This policy will have the following effects:
1. encourage documentation but not too much documentation
2. encourage programmers to consider the size of their classes and methods and thus to review their design choices and code properties such as high cohesion and low coupling
3. since this policy will probably result in code that is highly compartmentalized and well designed, it will be easier to reuse
4. since each module will be appropriately documented this should also make reuse and extending more likely

6. Assume that you're the manager of a small project. What baselines would you define for the project and how would you control them?
Ans : A baseline is a software configuration management concept that helps us to control change without seriously impeding justifiable change. The baselines that I will define for the project are as under:
• Schedule baseline
• Cost baseline
• Scope baseline
• Development baseline
• Source code
• Test cases
• Design specification
• System specification
• Software requirements
As a project manager, I will ensure that all the baselines are being met accordingly and the software project is proceeding as desired. Software schedule will be monitored throughout the software development, and in case of any deficiencies, appropriate solution will be figured out. Cost is also a baseline for project. It can only be met in case the software requirements are easily understood and are complete. Source code needs also be checked through the development process and the bugs that are found will be fixed at appropriate time in order to deliver good quality product to end users.

2. What is the difference between an SCM audit and a formal technical review?
Answer.
1st version of the answer:
SCM Audit:
A software configuration audit complements the formal technical review by assessing configuration object for characteristics that are generally not considered during review.
Formal Technical Review:
The formal technical review focuses on the technical correctness of the configuration object that has been modified. The reviewers assess the SCI to determine consistency with other SCIs,omissions, or potential side effects. A formal technical review is the most effective filter from a quality assurance standpoint. Conducted by software engineers for software engineers, the FTRis an effective means for improving software quality.
No, the functions of SCM Audit and Formal Technical Review cannot be folded into one reviewbecause of the fact.
Formal Technical Reviews are used for improving software quality, whereas software configuration management audit is usually used to answer the questions that are indirectly related to software to achieve the desired quality. For example, we can perform formal technical reviews for coding, testing, debugging, etc., as these are directly related to the quality of the software, however, for SCM Audit, we will answer the questions which are not directly related to software quality rather indirectly. Some questions could be...
• Has the change specified in the ECO been made?
• Have any additional modifications been incorporated?
• Has a formal technical review been conducted to assess technical correctness?
• Has the software process been followed and have software engineering standards been properly applied?
• Has the change been "highlighted" in the SCI?
• Have the change date and change author been specified?
• Do the attributes of the configuration object reflect the change?
• Have SCM procedures for noting the change, recording it, and reporting it been followed?
• Have all related SCIs been properly updated?
• Besides above, in some cases questions are asked as part of a formal technical review. However,when SCM is a formal activity, the SCM audit is conducted separately by the quality assurance group.

Friday, April 01, 2011

Computer Network Questions and Answers

Q-1 What are the goals in mind of IEEE 802 committee?
Ans: IEEE 802 committee has few goals in mind, namely
–To promote compatibility
–Implementation with minimum efforts
–Accommodate diverse applications

Q-2. List the functions performed by the physical layer of 802.3 standard?
Ans. Functions of physical layer are:
i) Data encoding/decoding (To facilitate synchronization and efficient transfer of signal through the medium).
ii) Collision detection (It detects at the transmit side)
iii) Carrier sensing (Channel access senses a carrier on the channel at both the transmit and receive sides)
iv) Transmit/receive the packets (Frame transmitted to all stations connected to the channel)
v) Topology and medium used (Mediums are co-axial cable, twisted pair and fiber optic cable)

Q-3. Why do you require a limit on the minimum size of Ethernet frame?
Ans. To detect collision, it is essential that a sender continue sending a frame and at the same time receives another frame sent by another station. Considering maximum delay with five Ethernet segments in cascade, the size of frame has been found to be 64 bytes such that the above condition is satisfied.

Q-4. What are the different types of cabling supported by Ethernet standard?
Ans. Types of cabling are:
i) 10 BASE 5 - Maximum cable length is 500 meters using 4” diameter coaxial cable.
ii) 10 BASE 2 - Maximum cable length is 185 meters using 0.25” diameter CATV cable.
iii) 10 BASE T - Maximum cable length is 100 meters using twisted-pair cable (CAT-3 UTP).
iv) 10 BASE FL - Maximum cable length is 2 Km using multimode fiber optic cable (125/62.5 micrometer).

Q-5. Explain the basic difference between IEEE 802.3 and switched Ethernet, as far as implementation is concerned.
Ans: In Ethernet (IEEE 802.3) the topology, though physically is start but logically is BUS. i.e. the collision domain of all the nodes in a LAN is common. In this situation only one frame can send the frame, if more than one station sends the frame, there is a collision.
In Switched Ethernet, this collision domain is separated. Hub is replaced by a switch, a device that can recognize the destination address and can route the frame to the port to which the destination station is connected, the rest of the media is not involved in the transmission process. The switch can receive another frame from another station at the same time and can route this frame to its own final destination.

Q-6. Explain the two techniques for implementing Ethernet switches.
Ans: There are two techniques used in the implementation of Ethernet switches: store-and-forward and cut-through. In the first case, the entire frame is captured at the incoming port, stored in the switch’s memory, and after an address lookup to determine the LAN destination port, forwarded to the appropriate port. The lookup table is automatically built up. On the other hand, a cut-through switch begins to transmit the frame to the destination port as soon as it decodes the destination address from the frame header.
Store-and-forward approach provides a greater level of error detection because damaged frames are not forwarded to the destination port. But, it introduces longer delay of about 1.2 msec for forwarding a frame and suffers from the chance of loosing data due to reliance on buffer memory. The cut-through switches, on the other hand, has reduced latency but has higher switch cost.

Q-7. What are the different categories of Fast Ethernet?
Ans: IEEE has designed two categories of Fast Ethernet: 100Base-X and 100Base-T4. 100Base-X uses two cables between hub and the station while 100Base-T4 uses four. 100-Base-X itself is divided into two: 100Base-TX and 100base-FX.
* 100 BASE-T4: This option is designed to avoid overwriting. It is used for half-duplex communication using four wire-pairs of the existing category 3 UTP cable, which is already available for telephone services in homes/offices. Two of four pairs are bi-directional; other two are unidirectional. This means that there are 3 pairs to be used for carrying data, in each direction (2 bi-directional and 1 uni-directional). Because 100Mbps data cannot be handled by voice-grade UTP, this specification splits the 100 Mbps flow into three 33.66Mbps flow.
* 100 BASE TX: This option uses two category 5 UTP or two shielded (STP) cable to connect a station to hub. One pair is used to carry frames from the hub to the station and other to carry frames from station to hub. Encoding is 4B/5B to handle 100 Mbps; signaling is NRZ-I. The distance between station and hub should be less than 100 meters.
* 100 BASE FX: This option uses two Fiber optic cables, one carry frames from station to hub and other from hub to station. The encoding is 4B/5B and signaling in NRZ-I. the distance between station and hub should be less than 2000 meters.

Q-8. What are the Objectives of The Gigabit Ethernet Alliance?
Ans: The objectives of the alliance are:
• supporting extension of existing Ethernet and Fast Ethernet technology in response to demand for higher network bandwidth.
• developing technical proposals for the inclusion in the standard
• establishment of inter-operability test procedures and processes

Q-9. Explain GMII (Gigabit Media Independent Interface) in brief.
Ans: The GMII is the interface between the MAC layer and the Physical layer. It allows any physical layer to be used with the MAC layer. It is an extension of the MII (Media Independent Interface) used in Fast Ethernet. It uses the same management interface as MII. It supports 10, 100 and 1000 Mbps data rates. It provides separate 8-bit wide receive and transmit data paths, so it can support both full-duplex as well as half-duplex operation.
The GMII provides 2 media status signals: one indicates presence of the carrier, and the other indicates absence of collision. With the GMII, it is possible to connect various
media types such as shielded and unshielded twisted pair, and single-mode and multi mode optical fiber, while using the same MAC controller. It has three sub-layers namely: PCS (Physical Coding Sublayer), PMA (Physical Medium Attachment) and PMD (Physical Medium Dependent)

Wednesday, March 23, 2011

Computer Network Questions and Answers

1. The IP datagram for a TCP ACK message is 40 bytes long: It contains 20 bytes of TCP header and 20 bytes of IP header. Assume that this ACK is traversing an ATM network that uses AAL5 to encapsulate IP packets. How many ATM layer packets will it take to carry the ACK for each of AAL layer?
a. AAL5
b. AAL3/4
ANS
a)) The length of the AAL5 CS-PDU into which the ACK is encapsulated is exactly 48 bytes, and this fits into a single ATM cell.
b)) When AAL3/4 is used the CS-PDU is again 48 bytes, but now the per-cell payload is only 44 bytes and two cells are necessary.

2. Suppose there are N stations on a LAN that has capacity (transmission rate) C. All packets have a fixed length L and the end-to-end propagation delay of the channel is P. If only one station ever has a message to send (i.e., the other N-1 stations generate no traffic). What is the maximum possible throughput seen by this single node under each of the protocols:
a. CSMA
Assuming that the station senses the channel immediately after finishing its transmission, and finding it idle, sends another packet, the throughput is C. Note that this ignores the overhead time needed to do channel sensing.

b. Slotted Aloha
Assuming the station always has data to send, it will always to do under slotted Aloha, so the throughput would be C.

c. Token Passing
After sending a message, a station gives up the token. The token circulates around the ring (taking time P). Assuming that L is the amount of time needed to transmit a message, the throughput is thus (L/(L+PC))*C.


3. Consider sending a 1500-byte datagram into a link that has an MTU of 500 bytes. Suppose the original datagram is stamped with the identification number 1. Assume that IPv4 is used.
a. Where does fragmentation happen? Where are the fragments reassembled?
Fragmentation happens in the router preceding the link with the small MTU. The fragments are reassembled in the end system.

b. How many fragments are generated?
The maximum size of the data field in each fragment = 480 (because there are 20 bytes IP header). Thus the number of required fragments= 1500-20/480 = 4

c. What are the values of the fragmentation-related fields in the generated IP datagram(s)?
Each fragment will have an identical identification number. Each fragment except the last one will be of size 500 bytes (including the IP header). The last datagram will be of size 60 bytes (including the IP header). The offsets of the 4 fragments will be 0, 60, 120, 180. Each of the first 3 fragments will have flag=1; the last fragment will have flag=0.

d. What changes if IPv6 were used?
The router preceding the link with the small MTU will drop the packet and send an ICMP error message “Packet Too Big” back to the source. The source is responsible for adjusting the packet size.

4. Consider building a CSMA/CD network running at 1 Gbps over a 1-km cable with no repeaters. The signal speed in the cable is 200,000 km/sec. What is the minimum frame size?
ANS
For a 1-km cable, the one-way propagation time is 5 μsec, so 2τ = 10 μsec. To make CSMA/CD work, it must be impossible to transmit an entire frame in this interval. At 1 Gbps, all frames shorter than 10,000 bits can be completely transmitted in under 10 μsec, so the minimum frame is 10,000 bits or 1250 bytes

5. In the CSMA/CD protocol, what condition on the transmission delay Ttrans and the propagation delay Tprop has to be satisfied to guarantee that a node always detects a collision?
ANS Ttrans>2Tprop


6. At low load, consider the delay of pure ALOHA versus slotted ALOHA. Which one is less? Explain your answer.
ANSWith pure ALOHA, transmission can start instantly. At low load, no collisions are expected so the transmission is likely to be successful. With slotted ALOHA, it has to wait for the next slot. This introduces half a slot time of delay.

Tuesday, March 22, 2011

Operating System Questions

1. Define operating system (MU AP-96)
An operating system is a set of program that controls, co-ordinates and supervises the activities of the computer hardware and software.

2. What is the role of an os?

An OS acts as an interface between the user and the computer. It acts as The manager of the resources of the computer.

3. Write the functions of an OS(BU Ap-97)

(i) Memory Management.
(ii) Processor management.
(iii) Interrupt Handling.
(iv) Accounting.
(v) Automatic job sequencing.
(vi) Management and control of I/O devices

4. What is the need for an OS?
A medium is needed to communicate between the user and the m/c. An OS acts as a medium of interface

5. What are the characteristics of an OS(MSU Ap-96)
(i) User friendly .
(ii) Keep track of the status of eaCH RESOURCE.
(iii) Allows sharing of resources(H/W and S/W).
(iv) Provides adequate security.
(v) Protection.

6. What is a process?
A process is basically a program in execution. It is the unit of work in a Modern operating system.


7. What is meant by a process state?
When a process executes, it changes, its status. This is known as process's State.

8. What are the various process states ?

The various process states are
(i) new
(ii) ready
(iii) running
(iv) suspended
(v) terminated

9. How does a process differ from a job?(BDU Ap-96).
A process is an active entity with a program counter specifying the next instructions to execute and a set to associated resources, whereas a batch System executes jobs.(which is a collection of processes).

10. Differentiate program and a process?
A process is a program in execution(ie) A program is a passive entity, Where as a process is an active entity.


11. What is process control Block?
Each process is represented in the operating system by a process control Block(PCB) also called a task control block.

12. What is the function of a process control block?
A (PCB) contains many pieces of information associated with a specific Process. It serves as the repository for any information that may vary From process to process.


13. What are the information contained in a PCB?
A PCB contains pieces of information associated with a specific process, Namely

(i) process state
(ii) program counter
(iii) CPU register
(iv) CPU scheduling information
(v) Memory management information
(vi) Accounting information
(vii) I/O status information

14. What are the operations on process?
(i) create a process
(ii) destroy a process
(iii) suspend a process
(iv) resume a process
(v) change the priority of a process
(vi) block a process
(vii) wakeup a process
(viii) dispatch a process
(ix) enable a process to communicate with another

15. What are the operation involved in creating a process?
(i) name the process
(ii) insert it in the system’s known processes list(or) process table.
(iii) Determine the process’s initial priority
(iv) Create the process control block
(v) Allocate the process’s initial resource.

16. What is the nucleus or kernel of an operating system?

Kernel is the part of the OS which directly makes interface with the Hardware system.

17. What are the main functions of the kernel?

To provide mechanism for
(i) creation and deletion of processes
(ii) inter process communication
(iii) synchronization of processes.

18. What are the components of an OS?
OS which is a collection of programs are of 2 types
(i) control program
(ii) supervisory program


19. What is multi programming?
The ability of keeping several jobs in the memory at one time, where The cpu is switched back and forth among them is called as Multi programming

20. What is the use of Multi Programming ?
Multi programming helps to increase CPU utilization, and to decrease the total time needed to execute the jobs.

21. Illustrate the factors that usually determine the degree of Multi Programming
(MSU: Nov-96)
(i) The number of Programs residing in Primary memory.
(ii) Passing of the control of the CPU rapidly between these programs.
(iii) Protection of user process from one another.

Search Aptipedia