Quantcast Job Interview Questions - www.interviewhelper.org: August 2008



Get unlimited interview questions on our new improved website...


 Interview Helper Home | Forum | Submit Link | Online Tickets | Freelance Work | Free Games | Jobs

Saturday, August 30, 2008

CCNA Certification Dumps


1 As system administrator, you type "debug ipx sap" and receive the following lines as part of the IOS response: type 0x4, "HELLO2", 199.0002.0003.0006 (451), 2 hops type 0x4, "HELLO1", 199.0002.0003.0008 (451), 2 hops What does "0x4" signify?

A. That is a Get Nearest Server response.

B. That it is a General query.

C. That it is a General response.

D. That it is a Get Nearest Server request.

Ans A

2 To monitor IP igrp traffic, you can use "debug IP igrp transaction" or "debug IP igrp events". How do you display information about IPX routing update packets?

A. debug routing

B. debug ipx transaction

C. debug ipx routing activity

D. debug ipx events

Ans: C

3 To monitor ipx traffic on a network, what command would you use?

A. debug ipx transaction

B. show ipx traffic

C. show ipx events

D. display ipx traffic

Ans B

4 What command would you use to find out the names of Novell servers on a network?

A. show ipx servers

B. show ipx hosts

C. show ipx sap

D. show ipx nodes.

Ans A

5 The "ipx delay number" command will allow an administrator to change the default settings. What are the default settings?

A. For LAN interfaces, one tick; for WAN interfaces, six ticks

B. For LAN interfaces, six ticks; for WAN interfaces, one tick

C. For LAN interfaces, zero ticks; for WAN interfaces, five ticks

D. For LAN interfaces, five ticks; for WAN interfaces, zero Ticks

Ans A

The default is--for LAN interfaces, one tick; for WAN interfaces, six ticks

6 As a system administrator, you need to set up one Ethernet interface on the Cisco router to allow for both sap and Novell-ether encapsulations. Which set of commands will accomplish this?

A. interface ethernet 0.1 ipx encapsulation Novell-ether ipx network 9e interface ethernet 0.2 ipx network 6c

B. interface ethernet 0 ipx encapsulation Novell-ether ipx network 9e interface ethernet 0 ipx encapsulation sap ipx network 6c

C. interface ethernet 0.1 ipx encapsulation Novell-ether interface ethernet 0.2 ipx encapsulation sap

D. interface ethernet 0.1ipx encapsulation Novell-ether ipx network 9e interface ethernet 0.2 ipx encapsulation sap ipx network 6c

Ans D

The following commands setup the subinterfaces to allow for two types of encapsulation: interface ethernet 0.1 ipx encapsulation Novell-ether ipx network 9e interface ethernet 0.2 ipx encapsulation sap ipx network 6c

7 What does the "IPX maximum-paths 2" command accomplish?

A. It enables load sharing on 2 paths if the paths are equal metric paths.

B. It sets up routing to go to network 2.

C. It is the default for Cisco IPX load sharing.

D. It enables load sharing on 2 paths if the paths are unequal metric paths.

Ans A

It enables load sharing on 2 paths if the paths are equal metric paths. The default is 1 path and the maximum is 512 paths.

8 You want to enable both arpa and snap encapsulation on one router interface. How do you do this?

A. The interface can handle multiple encapsulation types with no extra configuration.

B. Assign two network numbers, one for each encapsulation type.

C. Enable Novell-ether to run multiple encapsulation types.

D. Both arpa and snap are enabled by default so you don't have to configure anything.

Ans B

To assign multiple network numbers, you usually use subinterfaces. A sample configuration follows: ipx ethernet 0.1 ipx encapsulation novell-ether ipx network 9e interface ethernet 0.2 ipx encapsulation sap ipx network 6c

By default, Cisco routers forward GNS SAPs to remote networks.

A. False

B. True

Ans A

GNS is Novell's protocol to Get Nearest Server. If there is a server on the local network, that server will respond. If there isn't, the Cisco router has to be configured to forward the GNS SAP.

9 To prevent Service Advertisements (SAPs) from flooding a network, Cisco routers do not forward them. How are services advertised to other networks?

A. Each router builds its own SAP table and forwards that every 60 seconds.

B. Each router assigns a service number and broadcasts that.

C. SAPs aren't necessary with Cisco routers.

D. Cisco routers filter out all SAPs.

Ans: A

Cisco routers build SAP tables and forward the table every 60 seconds. All SAPs can't be filtered even with 4.x since NDS and time synchronization uses SAPs.

10 Novell's implementation of RIP updates routing tables every ____ seconds.

A. 60

B. 90

C. 10

D. 30

Ans A

Novell's RIP updates routing tables every 60 seconds, Apple's RTMP is every 10 seconds, routers ARP every 60 seconds, IGRP signal every 90 seconds, and Banyan VINES signals every 90 seconds.

11 In Novell's use of RIP, there are two metrics used to make routing decisions. Select the two metrics.

A. Ticks.

B. Hops

C. Loops

D. Counts

Ans:A &B

It first uses ticks (which is about 1/18 sec.); if there is a tie, it uses hops; if hops are equal, then it uses an administratively assigned tiebreaker.

12 What is the Cisco name for the encapsulation type used on a serial interface?

A. HDLC

B. SDLC

C. SAP

D. SNAP

Ans A

13 "arpa" is used by the Cisco IOS for which encapsulation types?

A. Ethernet_II

B. Ethernet_802.3

C. Ethernet_802.2

D. Ethernet_SNAP

Ans A

Novell's IPX and Cisco's IOS name their protocols differently. Cisco uses sap for Ethernet_802.2, Token-Ring, and Novell's FDDI_802.2. Cisco uses snap for Ethernet_SNAP, Token-Ring_SNAP, and FDDI_SNAP. Cisco uses arpa for Ethernet_II and, finally the default is Novell-ether for Novell's Ethernet_802.3.

14 "snap" is used by the Cisco IOS for which encapsulation types?

A. Ethernet_SNAP

B. Token-Ring_SNAP

C. FDDI_SNAP

D. Novell-SNAP

E. Novell-FDDI.

Ans: A,B &C Novell's IPX and Cisco's IOS name their protocols differently. Cisco uses sap for Ethernet_802.2, Token-Ring, and Novell's FDDI_802.2. Cisco uses snap for Ethernet_SNAP, Token-Ring_SNAP, and FDDI_SNAP. Cisco uses arpa for Ethernet_II and, finally the default is Novell-ether for Novell's Ethernet_802.3.

15"sap" is used by the Cisco IOS for which encapsulation types?

A. Ethernet_802.2

B. Token-Ring

C. FDDI_SNAP

D. Ethernet_802.3

E. FDDI_802.2

Ans A,B &E

Novell's IPX and Cisco's IOS name their protocols differently. Cisco uses sap for Ethernet_802.2, Token-Ring, and Novell's FDDI_802.2. Cisco uses snap for Ethernet_SNAP, Token-Ring_SNAP, and FDDI_SNAP. Cisco uses arpa for Ethernet_II and, finally the default is Novell-ether for Novell's Ethernet_802.3.

16 Which type of Ethernet framing is used for TCP/IP and AppleTalk?

A. Ethernet 802.3

B. Ethernet 802.2

C. Ethernet II

D. Ethernet SNAP

Ans D

Ethernet 802.3 is used with NetWare versions 2 through 3.11, Ethernet 802.2 is used with NetWare 3.12 and later plus OSI routing, Ethernet II is used with TCP/IP and DECnet, and Ethernet SNAP is used with TCP/IP and AppleTalk.

17 Which type of Ethernet framing is used for TCP/IP and DECnet?

A. Ethernet 802.3

B. Ethernet 802.2

C. Ethernet II

D. Ethernet SNAP

Ans: C

Ethernet 802.3 is used with NetWare versions 2 through 3.11, Ethernet 802.2 is used with NetWare 3.12 and later plus OSI routing, Ethernet II is used with TCP/IP and DECnet, and Ethernet SNAP is used with TCP/IP and AppleTalk.

18 You are a system administrator on a NetWare network, you are running NetWare 4.11 and you cannot communicate with your router. What is the likely problem?

A. NetWare 4.11 defaults to 802.2 encapsulation.

B. NetWare 4.11 defaults to 802.3 encapsulation

C. Cisco routers only work with NetWare 3.11.

D. NetWare 3.11 defaults to 802.2 encapsulation.

Ans A

The default encapsulation on Cisco routers is Novell Ethernet_802.3 and NetWare 3.12 and later defaults to 802.2 encapsulation, 3.11 and earlier defaults to 802.3.

19 NetWare IPX addressing uses a network number and a node number. Which statements are true?

A. The network address is administratively assigned and can be up to 16 hexadecimal digits long.

B. The node address is always administratively assigned.

C. The node address is usually the MAC address.

D. If the MAC address is used as the node address, then IPX eliminates the use of ARP.

Ans A, C &D

The network address can be up to 16 hexadecimal digits in length. The node number is 12 hexadecimal digits. The node address is usually the MAC address. An example IPX address is 4a1d.0000.0c56.de33. The network part is 4a1d. The node part is 0000.0c56.de33. The network number is assigned by the system administrator of the Novell network.

20 Which NetWare protocol works on layer 3--network layer—of the OSI model?

A. IPX

B. NCP

C. SPX

D. NetBIOS

Ans A

IPX (Internetwork Packet Exchange) is a NetWare network layer 3 protocol used for transferring information on LANs.

21 Which NetWare protocol provides link-state routing?

A. NLSP

B. RIP

C. SAP

D. NCP

Ans: A

NetWare Link Services Protocol (NLSP) provides link-state routing. SAP (Service Advertisement Protocol) advertises network services. NCP (NetWare Core Protocol) provides client-to-server connections and applications. RIP is a distance vector routing protocol.

22 As a system administrator, you want to debug igrp but are worried that the "debug IP igrp transaction" command will flood the console. What is the command that you should use?

A. debug IP igrp event

B. debug IP igrp-events

C. debug IP igrp summary

D. debug IP igrp events

Ans D

The "debug IP igrp events" is used to only display a summary of IGRP routing information. You can append an IP address onto either command to see only the IGRP updates from a neighbor.

23 What does the following series of commands accomplish? router igrp 71 network 10.0.0.0 router igrp 109 network 172.68.7.0

A. It isolates networks 10.0.0.0 and 172.68.7.0.

B. It loads igrp for networks 109 and 71.

C. It disables RIP.

D. It disables all routing protocols.

Ans A

It isolates network 10.0.0.0 and 172.68.7.0 and associates autonomous systems 109 and 71 with IGRP. IGRP does not disable RIP, both can be used at the same time.

24 In the command "router igrp 109" what does 109 signify?

A. an autonomous system

B. any network number which the router is attached to

C. the allowable length of the routing table

D. the network socket number

Ans A

The Cisco IOS global configuration command "router igrp xxx" is used to configure the Interior Gateway Routing Protocol. In this case, the 109 is called the process-id , which can also be used for an autonomous system number.

25 IGRP supports a feature that allows traffic to be distributed among up to 6 (4 default) paths to provide greater overall throughput and reliability. What is this called?

A. unequal-cost load balancing

B. equal-cost load balancing

C. proportionate load balancing

D. low cost load balancing

Ans A

An unequal-cost load balancing is used to provide alternate paths for data distribution on an internetwork. Cisco developed this method to use unused or under utilized links to increase bandwidth and network availability.

26 IGRP uses flash updates, poison reverse updates, holddown times, and split horizon. How often does it broadcast its routing table updates?

A. 90 seconds

B. 10 seconds

C. 30 seconds

D. 45 seconds

Ans A

27 The command "show IP protocol" displays which information?

A. routing timers

B. network information

C. contents of the IP routing table

D. information about all known network and subnetworks

Ans A & B

"show IP protocol" displays routing timers and network information. "show IP route" displays the routing table with information about all known networks and subnetworks.

28 When using RIP, routing updates are broadcast every ____ seconds.

A. 30

B. 10

C. 60

D. 90

Ans: A

Novell's RIP updates routing tables every 60 seconds, Apple's RTMP is every 10 seconds, routers ARP every 60 seconds, DECnet hosts and IGRP signal every 15 seconds, and Banyan VINES signals every 90 seconds.

29 An autonomous system can only exist if all routers in that system meet which criteria?

A. interconnected

B. run the same routing protocol

C. assigned same autonomous system number

D. run IGRP only

E. run RIP only

Ans A,B &C

An autonomous system is a set of routers and networks under the same administration. Each router must be interconnected, run the same routing protocol, and assigned the same autonomous system number. The network Information Center (NIC) assigns a unique autonomous system number to enterprises.

30 A default route is analogous to a _________.

A. default gateway

B. static route

C. dynamic route

D. one-way route

Ans: A

A default route is analogous to a default gateway. It is used to reduce the length of routing tables and to provide complete routing capabilities when a router might not know the routes to all other networks.

31 Routers can learn about destinations through static routes, default, or dynamic routing. By default, a router will use information derived from __________.

A. IGRP

B. RIP

C. IP

D. TCP

Ans A

The quality of information is rated:

Connected interface 0

Static route 1

IGRP 100

RIP 120

Unknown 255

The lower the value, the more reliable the source with 255 signifying information that the router will ignore. So, the router will use IGRP, rated at 100, before RIP, rated at 120.

32 You are logged into a router, what command would show you the IP addresses of routers connected to you?

A. show cdp neighbors detail

B. show run

C. show neighbors

D. show cdp

Ans A

33 As a system administrator, you perform an extended ping at the privileged EXEC prompt. As part of the display, you see "Set DF bit in IP header? [yes] :" What would happen if you answered no at the prompt.

A. This lets the router fragment the packet.

B. It tells the router not to fragment the packet.

C. This lets the router direct the packet to the destination it finds in its routing table.

D. It tell the router to send the packet to the next hop router

Ans A

"Set DF bit in IP header?" is a response to an extended ping at the router. If you answer yes (the default) the router will not fragment the packet. If you answer no, the router will fragment the packet.

34 You have typed "ping" 172.16.101.1 and get the following display: Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 172.16.101.1, timeout is 2 seconds:

What does the "." signify?

A. That one message timed out.

B. That all messages were successful.

C. That one message was successful.

D. That one message completed in under the allotted timeframe.

Ans A

The possible responses from the ping command are: ! Successful receipt of an echo reply. Timed out waiting for a reply U Destination unreachable C Congestion-experienced packet I Ping interrupted ? Packet type unknown & Packet TTL exceeded

35 Which command, that is used to test address configuration, uses Time-To-Live (TTL) values to generate messages from each router.

A. trace

B. ping

C. telnet

D. bootp

Ans: A

The Cisco IOS EXEC command "trace [protocol] [destination]" is used to discover routes that packets will travel to their destination hosts. Trace uses TTL (Time to Live) values to report destination route information.

36 What does the command "IP name-server 255.255.255.255" accomplish?

A. It sets the domain name lookup to be a local broadcast.

B. This is an illegal command.

C. It disables domain name lookup.

D. The command is now defunct and has been replaced by "IP server-name ip any"

Ans A

By default DNS is enabled on a router with a server address of 255.255.255.255, which provides for a local broadcast.

37 As a system administrator, you need to provide your routers with a Domain Name System (DNS) server. How many DNS servers can you specify with one command?

A. 6

B. 1

C. 2

D. 4

Ans A

You can only specify six name servers in one command. The syntax is "IP name-server server-address1 [[ server-address2 ]...server-address6]. You must also enable DNS.

38 How would you configure one host name that points to two IP addresses?

A. IP host jacob 1.0.0.5 2.0.0.8

B. IP jacob 1.0.0.5 2.0.0.8

C. IP host jacob 1.0.0.5

D. IP host duplicate "all"

Ans A

The correct syntax is IP host name [ TCP-port-number ] address [ address ]..... So, "IP host P1R1 1.0.0.5 2.0.0.8" is the correct choice. "IP host jacob 1.0.0.5" only points the host name jacob to one IP address--1.0.0.5.

39 The following selections show the command prompt and the configuration of the IP network mask. Which two are correct?

A. Router#term IP netmask-format { bitcount | decimal | hexadecimal }

B. Router(config-if)#IP netmask-format { bitcount | decimal | hexadecimal }

C. Router(config-if)#netmask-format { bitcount | decimal | hexadecimal }

D. Router#ip netmask-format { bitcount | decimal | hexadecimal }

Ans A & B

Router#term IP netmask-format { bitcount | decimal | hexadecimal } and Router(config-if)#IP netmask-format { bitcount | decimal | hexadecimal } are correct. You can configure the mask for the current session and you can configure it for a specific line.

40 When configuring the subnet mask for an IP address, which formats can be used?

A. dotted-decimal.

B. Hexadecimal

C. Bit-count

D. Octal

E. Binary

Ans A, B &C

41 You are given the following address: 153.50.6.27/25. Determine the subnet mask, address class, subnet address, and broadcast address.

A. 255.255.255.128, B,153.50.6.0, 153.50.6.127

B. 255.255.255.128, C,153.50.6.0, 153.50.6.127

C. 255.255.255.128, C,153.50.6.127, 153.50.6.0

D. 255.255.255.224, C,153.50.6.0, 153.50.6.127

Ans A

42 You are given the following address: 128.16.32.13/30. Determine the subnet mask, address class, subnet address, and broadcast address.

A. 255.255.255.252, B,128.16.32.12, 128.16.32.15

B. 255.255.255.252, C,128.16.32.12, 128.16.32.15

C. 255.255.255.252, B,128.16.32.15, 128.16.32.12

D. 255.255.255.248, B,128.16.32.12, 128.16.32.15

Ans A

43 You are given the following address: 15.16.193.6/21. Determine the subnet mask, address class, subnet address, and broadcast address.

A. 255.255.248.0, A, 15.16.192.0, 15.16.199.255

B. 255.255.248.0, B, 15.16.192.0, 15.16.199.255

C. 255.255.248.0, A, 15.16.199.255, 14.15.192.0

D. 255.255.242.0, A, 15.16.192.0, 15.16.199.255

Ans A

44 You have an IP host address of 201.222.5.121 and a subnet mask of 255.255.255.248. What is the broadcast address?

A. 201.222.5.127

B. 201.222.5.120

C. 201.222.5.121

D. 201.222.5.122

Ans A

The easiest way to calculate this is to subtract 255.255.255.248 (subnet mask) from 255.255.255.255, this

equals 7. Convert the address 201.222.5.121 to binary--11001001 11011110 00000101 01111001. Convert the

mask 255.255.255.248 to binary--11111111 11111111 11111111 11111000. AND them together to get: 11001001 11011110

00000101 01111000 or 201.222.5.120. 201.222.5.120 is the subnet address, add 7 to this address for 201.222.5.127 or

the broadcast address. 201.222.5.121 through 201.222.5.126 are the valid host addresses.

45 Given the address 172.16.2.120 and the subnet mask of 255.255.255.0. How many hosts are available?

A. 254

B. 510

C. 126

D. 16,372

Ans A

172.16.2 120 is a standard Class B address with a subnet mask that allows 254 hosts. You are a network administrator and have been assigned the IP address of 201.222.5.0. You need to have 20 subnets with 5 hosts per subnet. The subnet mask is 255.255.255.248.

46 Which addresses are valid host addresses?

A. 201.222.5.17

B. 201.222.5.18

C. 201.222.5.16

D. 201.222.5.19

E. 201.222.5.31

Ans A,B & D

Subnet addresses in this situation are all in multiples of 8. In this example, 201.222.5.16 is the subnet, 201.22.5.31 is the broadcast address. The rest are valid host IDs on subnet 201.222.5.16.

47 You are a network administrator and have been assigned the IP address of 201.222.5.0. You need to have 20 subnets with

5 hosts per subnet. What subnet mask will you use?

A. 255.255.255.248

B. 255.255.255.128

C. 255.255.255.192

D. 255.255.255.240

Ans A

By borrowing 5 bits from the last octet, you can. have 30 subnets. If you borrowed only 4 bits you could only have 14 subnets. The formula is (2 to the power of n)-2. By borrowing 4 bits, you have (2x2x2x2)-2=14. By borrowing 5 bits, you have (2x2x2x2x2)-2=30. To get 20 subnets, you would need to borrow 5 bits so the subnet mask would be 255.255.255.248.

48 You are given the IP address of 172.16.2.160 with a subnet mask of 255.255.0.0. What is the network address in binary?

A. 10101100 00010000

B. 00000010 10100000

C. 10101100 00000000

D. 11100000 11110000

Ans: A

To find the network address, convert the IP address to binary--10101100 000100000 00000010 10100000--then ANDed it with the subnet mask--11111111 11111111 00000000 00000000. The rest is 10101100 00010000 00000000 00000000, which is 172.16.0.0 in decimal.

The first octet rule states that the class of an address can be determined by the numerical value of the first octet.

49 Which addresses are INCORRECTLY paired with their class?

A. 128 to 191, Class B

B. 192 to 223 Class B

C. 128 to 191, Class C

D. 192 to 223, Class C

Ans B & C

Address classes are: 1 to 126, Class A; 128 to 191, Class B, 192 to 223, Class C; 224 to 239, Class D; and 240 to 255, Class E. The first octet rule states that the class of an address can be determined by the numerical value of the first octet.

50 Which addresses are INCORRECTLY paired with their class?

A. 1 to 126, Class A

B. 128 to 191, Class A

C. 1 to 126, Class B

D. 128 to 191, Class B

Ans:B & C.

Address classes are: 1 to 126, Class A; 128 to 191, Class B, 192 to 223, Class C; 224 to 239, Class D; and 240 to 255, Class E. The first octet rule states that the class of an address can be determined by the numerical value of the first octet.

51 Which addresses are INCORRECTLY paired with their class?

A. 240 - 255, Class D

B. 240 - 255, Class E

C. 224 - 239, Class D

D. 224 - 239, Class E

Ans A & D

Address classes are: 1 to 126, Class A; 128 to 191, Class B, 192 to 223, Class C; 224 to 239, Class D; and 240 to 255, Class E.

52 Which IP Address Class is INCORRECTLY paired with its range of network numbers?

A. Class A addresses include 192.0.0.0 through 223.255.255.0

B. Class A addresses include 1.0.0.0 through 126.0.0.0

C. Class B addresses include 128.0.0.0 through 191.255.0.0

D. Class C addresses include 192.0.0.0 through 223.255.255.0

E. Class D addresses include 224.0.0.0 through 239.255.255.0

Ans A

Class A addresses include 1.0.0.0 through 126.0.0.0

Class B addresses include 128.0.0.0 through 191.255.0.0

Class C addresses include 192.0.0.0 through 223.255.255.0

Class D addresses include 224.0.0.0 through 239.255.255.0

53 Which IP Address Class can have 16 million subnets but support 254 hosts?

A. Class C

B. Class A

C. Class B

D. Class D

Ans A

Possible Subnets IP Address Class Possible Hosts

254 A 16M.

64K B 64K

16M C 254

54 Which IP Address Class can have 64,000 subnets with 64,000 hosts per subnet?

A. Class B

B. Class A

C. Class C

D. Class D

Ans A

IP Address Class Possible Subnets Possible Hosts

254 A 16M

64K B 64K

16M C 254

55 There are two processes to pair MAC address with IP addresses. Which process finds an IP address from a MAC address?

A. RARP

B. ARP

C. RIP

D. IGRP

Ans A

ARP (Address Resolution Protocol) maps an IP address to the MAC address, RARP (Reverse Address Resolution Protocol) maps the MAC address to the IP address. ARP and RARP work at the internet layer of the Internet Model or the network layer of the OSI model.

56 When the router runs out of buffer space, this is called ________.

A. Source Quench

B. Redirect

C. Information Request

D. Low Memory

Ans A

Source quench is the process where the destination router, or end internetworking device will "quench" the date from the "source", or the source router. This usually happens when the destination router runs out of buffer space to process packets.

57 Which protocol carries messages such as destination Unreachable, Time Exceeded, Parameter Problem, Source Quench, Redirect, Echo, Echo Reply, Timestamp, Information Request, Information Reply, Address Request, and Address Reply?

A. ICMP

B. UDP

C. TCP

D. TFTP

E. FTP

Ans A

ICMP (Internet Control Message Protocol) is a network layer internet protocol described in RFC # 792. ICMP reports IP packet information such as destination Unreachable, Time Exceeded, Parameter Problem, Source Quench, Redirect, Echo, Echo Reply, Timestamp, Information Request, Information Reply, Address Request, and Address Reply.

58 Two of the protocols that can be carried in the Protocol field of an IP packet are?

A. TCP

B. UDP

C. FTP

D. TFTP

Ans A & B

The following are the fields in an IP segment, their length, and their definitions:

VERS (Version number - 16 bits)

HLEN (Number of 32-bit words in the header - 4 bits)

Type of Server (How the datagram should be handled - 32 bits)

Total Length (Total length of header and data - 32 bits)

Identification (Provide fragmentation of datagrams to allow different MTUs in the internet - 4 bits)

Flags (Provide fragmentation of datagrams to allow different MTUs in the internet - 4 bits)

Frag Offset (Provide fragmentation of datagrams to allow different MTUs in the internet - 6 bits)

TTL (Time-To-Live - 6 bits)

Protocol (Upperlayer protocol sending the datagram - 16 bits)

Header Checksum )Integrity check on the header - 16 bits)

Source IP Address (32 bits)

Destination IP Address (32 bits)

IP Options (network testing, debugging, security and others - 4 bits)

Data (4 bits).

59 Where would network testing be included in an IP packet?

A. IP Options field

B. Identification field

C. Type of Service field

D. Reservation field

Ans A

The following are the fields in an IP segment, their length, and their definitions:

VERS (Version number - 16 bits)

HLEN (Number of 32-bit words in the header - 4 bits)

Type of Server (How the datagram should be handled - 32 bits)

Total Length (Total length of header and data - 32 bits)

Identification (Provide fragmentation of datagrams to allow different MTUs in the internet - 4 bits)

Flags (Provide fragmentation of datagrams to allow different MTUs in the internet – 4 bits)

Frag Offset (Provide fragmentation of datagrams to allow different MTUs in the internet - 6 bits)

TTL (Time-To-Live - 6 bits)

Protocol (Upperlayer protocol sending the datagram - 16 bits)

Header Checksum )Integrity check on the header - 16 bits)

Source IP Address (32 bits)

Destination IP Address (32 bits)

IP Options (network testing, debugging, security and others - 4 bits)

Data (4 bits).

60 What field tells the Internet layer how to handle an IP packet?

A. Type of Service

B. Identification

C. Flags

D. Frag Offset

Ans A

The following are the fields in an IP segment, their length, and their definitions:

VERS (Version number - 16 bits)

HLEN (Number of 32-bit words in the header - 4 bits)

Type of Server (How the datagram should be handled - 32 bits)

Total Length (Total length of header and data - 32 bits)

Identification (Provide fragmentation of datagrams to allow different MTUs in the internet - 4 bits)

Flags (Provide fragmentation of datagrams to allow different MTUs in the internet - 4 bits)

Frag Offset (Provide fragmentation of datagrams to allow different MTUs in the internet - 6 bits)

TTL (Time-To-Live - 6 bits)

Protocol (Upperlayer protocol sending the datagram - 16 bits)

Header Checksum )Integrity check on the header - 16 bits)

Source IP Address (32 bits)

Destination IP Address (32 bits)

IP Options (network testing, debugging, security and others - 4 bits) Data (4 bits).

61 Which fields of an IP packet provide for fragmentation of datagrams to allow differing MTUs in the internet?

A. Identification

B. Flags

C. Frag Offset

D. Type of Service

E. Total Length

Ans A, B & C

The following are the fields in an IP segment, their length, and their definitions:

VERS (Version number - 16 bits)

HLEN (Number of 32-bit words in the header - 4 bits)

Type of Server (How the datagram should be handled - 32 bits)

Total Length (Total length of header and data - 32 bits)

Identification (Provide fragmentation of datagrams to allow different MTUs in the internet - 4 bits)

Flags (Provide fragmentation of datagrams to allow different MTUs in the internet - 4 bits)

Frag Offset (Provide fragmentation of datagrams to allow different MTUs in the internet - 6 bits)

TTL (Time-To-Live - 6 bits)

Protocol (Upperlayer protocol sending the datagram - 16 bits)

Header Checksum )Integrity check on the header - 16 bits)

Source IP Address (32 bits)

Destination IP Address (32 bits)

IP Options (network testing, debugging, security and others - 4 bits)

Data (4 bits).

62 Which processes does TCP, but not UDP, use?

A. Windowing

B. Acknowledgements

C. Source Port

D. Destination Port

Ans A & B

UDP (User Datagram Protocol) does not use sequence or acknowledgement fields in transmission.

UDP is a connectionless and unreliable protocol, since there is no delivery checking mechanism in the UDP data format.

63 What is the UDP datagram format?

A. Source Port - 16 bits, Destination Port - 16 bits, Length - 16 Bits, Checksum - 16 bits, Data

B. Destination Port - 16 bits, Source Port - 16 bits, Length - 16 Bits, Checksum - 16 bits, Data

C. Source Port - 16 bits, Destination Port - 16 bits, Checksum - 16 Bits, Length - 16 bits, Data

D. Source Port - 8 bits, Destination Port - 8 bits, Length -8 Bits, Checksum - 8 bits, Data

Ans A

The UDP format for a segment is as follows:

Source Port 16 bits

Destination Port 16 bits

Length 16 bits

Checksum 16 bits

Data xx bits

64 What is the function of DDR on Cisco routers?

A. DDR is dial--on-demand routing. It provides a continuous LAN only connection.

B. DDR is dial-on-demand routing. It provides routing for high volume traffic.

C. DDR is dial--on-demand routing. It provides a continuous WAN connection.

D. DDR is dial-on-demand routing. It provides routing for low volume and periodic traffic.

Answer: D

DDR is dial-on-demand routing. It provides routing for low volume and periodic traffic. It initiates a call to a remote site when there is traffic to transmit.

65 What are the two types of access lists that can be configured on a Cisco router?

A. Standard

B. Extended

C. Filtering

D. Packet

Ans: A & B

The access lists are standard and extended. Standard access lists for IP check the source address of packets that could be routed. Extended access lists can check the source and destination packet plus check for specific protocols, port numbers, etc.

66 When using access lists, what does a Cisco router check first?

A. To see if the packet is routable or bridgeable

B. The destination address

C. The source address

D. The packet contents

Ans A

The first thing checked is to see if the packet is routable or bridgeable. If it is not, the packet will be dropped.

67 How many access lists are allowed per interface?

A. One per port, per protocol

B. Two per port, per protocol

C. Unlimited

D. Router interface +1 per port.

Ans: A

Only one access list is allowed per interface. An access list must have conditions that test true for all packets that use the access list.

68 What do the following commands accomplish?

access-list 1 deny 172.16.4.0 0.0.0.255

access-list 1 permit any interface ethernet 0

IP access-group 1 out

A. This will block traffic from subnet 172.16.4.0 and allow all other traffic.

B. This will allow traffic from subnet 172.16.4.0 and block all other traffic.

C. All traffic is allowed.

D. All traffic is blocked.

Ans: A

This will block traffic from subnet 172.16.4.0 and allow all other traffic. The first statement "access-list 1 deny 172.16.4.0 0.0.0.255" will deny access to the subnet 172.16.4.0.

69 What do the following statements in an extended access list accomplish?

access-list 101 deny TCP 172.16.4.0 0.0.0.255 172.16.3.0 0.0.0.255 eq 21

access-list 101 deny TCP 172.16.4.0 0.0.0.255 172.16.3.0 0.0.0.255 eq 20

access-list 101 permit TCP 172.16.4.0 0.0.0.255 0.0.0.0 255.255.255.255

A. This will block ftp traffic.

B. This will block http traffic.

C. This will permit ftp traffic.

D. This will permit tftp traffic.

Ans: A

This will block ftp traffic since ftp uses ports 20 and 21.

70 Access lists are numbered. Which of the following ranges could be used for an IP access list?

A. 600 - 699

B. 100 - 199

C. 1 - 99

D. 800 - 899

E. 1000 - 1099

Answer: B & C

AppleTalk access lists use numbers in the 600 - 699 range. IP uses 1 - 99 for standard access lists or 100-199 for extended access lists. IPX uses 800 - 899 or 900 - 999 for extended access lists. IPX SAP filters use 1000 - 1099.

71 Cisco routers use wildcard masking to identify how to check or ignore corresponding IP address bits. What does setting a wildcard mask bit to 0 cause the router to do?

A. It tells the router to check the corresponding bit value.

B. It tells the router to ignore the corresponding bit value.

C. It tells the router to check its alternate routing list.

D. It tells the router to use its primary routing list.

Ans A

It tells the router to check the corresponding bit value.

72 You are a system administrator and you want to deny access to a group of computers with addresses 172.30.16.0 to 172.30.31.0. Which wildcard mask would you use?

A. 0.0.15.255

B. 0.0.255.255

C. 0.0.31.255

D. 0.0.127.255

E. 0.0.255.255

Ans: A

0.0.15.255 will check the last 13 bits of an address so that computers 172.30.16.0 to 172.30.31.0 will be denied access. 0.0.31.255 would check the last 6 binary digits and deny access to addresses 172.30.32.0 to 172.30.63.0. 0.0.127.255 would check the last 7 binary digits and deny access to addresses 172.30.64.0 to 172.30.127.0. 0.0.255.255 would deny 172.30.0.0 to 172.30.254.0. If you write decimal 15 in binary, you have 0001111, the 1's tell the router to ignore address with these bits set; 0's tell the router to check the bits. The third octet for 172.30.16.0 is 00010000. The third octet for 172.30.31.0 would be 00011111. So, traffic from these addresses would be denied.

73 In order to limit the quantity of numbers that a system administrator has to enter, Cisco can use which abbreviation to indicate 0.0.0.0?

A. host

B. any

C. all

D. include

Ans: A

Cisco uses host to specify 0.0.0.0. This tells the router to check all. Cisco uses any to specify 255.255.255.255. This tells the router to ignore all and permit any address to use an access list test.

74 What do the following commands accomplish?

access-list 1 permit 172.16.0.0 0.0.255.255

interface ethernet 0

IP access-group 1 out

interface ethernet 1

IP access-group 1 out

A. Only traffic from the source network 172.16.0.0 will be blocked.

B. Only traffic from the source network 172.16.0.0 will be forwarded. Non-172.16.0.0 network traffic is blocked.

C. Non-172.16.0.0 traffic will be forwarded.

D. All traffic will be forwarded.

Ans: B

Only traffic from the source network 172.16.0.0 will be forwarded. Non-172.16.0.0 network traffic is blocked. The wildcard mask 0.0.255.255 tells the router to check the first 2 octets and to ignore the last 2 octets.

75 When using access lists, it is important where those access lists are placed. Which statement best describes access list placement?

A. Put standard access lists as near the destination as possible. Put extended access lists as close to the source as possible.

B. Put extended access lists as near the destination as possible. Put standard access lists as close to the source as possible.

C. It isn't import where access lists are placed since the router will read and cache the whole list.

D. Put access lists as close to corporate headquarters as possible.

Ans A

Put standard access lists as near the destination as possible. Put extended access lists as close to the source as possible. Standard access lists don't specify the destination address.

76 As the system administrator, you enter the following commands at the command prompt:

ipx routing

access-list 800 permit 2b 4d

int e0

ipx network 4d

ipx access-group 800 out

int e1

ipx network 2b

int e2

ipx network 3c

77.What did these command accomplish?

A. Traffic from network 4c destined for network 4d will be forwarded out Ethernet0.

B. Traffic from network 3c destined for network 4d will be forwarded out Ethernet0.

C. Traffic from network 2b destined for network 4d will be forwarded out Ethernet0.

D. Traffic from network 4d destined for network 2d will be forwarded out Ethernet0.

Ans C

Traffic from network 2b destined for network 4d will be forwarded out Ethernet0. The other interfaces E1 and E2 are not subject to the access list since they lack the access group statement to link them to access list 800.

78 The following commands were entered at the command prompt of a Cisco router. What do they accomplish?

access-list 1000 deny 9e.1234.5678.1212 4

access-list 1000 permit -1

interface ethernet 0

ipx network 9e

interface ethernet 1

ipx network 4a

interface serial 0

ipx network 1

ipx output-sap-filter 1000

A. File server advertisements from server 9e.1234.5678.1212 will not be forwarded on interface S0.

B. All other SAP services, other than file server, from any source will be forwarded on S0.

C. All other SAP services, other than print server, from any source will be forwarded on S0.

D. Print server advertisements from server 9e.1234.5678.1212 will not be forwarded on interface S0.

Ans A & B

File server advertisements from server 9e.1234.5678.1212 will not be forwarded on interface S0. All other SAP services, other than file server, from any source will be forwarded on S0.

79 You receive "input filter list is 800 and output filter list is 801" as part of the output from a show interfaces command. What kind of traffic are you filtering?

A. IPX/SPX

B. TCP/IP

C. LocalTalk

D. DDR

Ans: A

Because the access list is numbered in the 800 range, you are filtering IPX/SPX traffic.

80 Which service uses telephone control messages and signals between the transfer points along the way to the called destination?

A. Signaling System 7 (SS7)

B. Time-division Multiplexing (TDM)

C. X.25

D. Frame relay

Ans: A

Signaling System 7 (SS7) uses telephone control messages and signals between the transfer points along the way to the called destination. Time-division Multiplexing (TDM) has information from multiple sources and allocates bandwidth on a single media. Circuit switching uses signaling to determine the call route, which is a dedicated path between the sender and the receiver. Basic telephone service and Integrated Services Digital Network (ISDN) use TDM circuits. X.25 and Frame Relay services have information contained in packets or frames to share non-dedicated bandwidth. X.25 avoids delays for call setup. Frame Relay uses permanent virtual circuits (PVCs).

81 Which service takes information from multiple sources and allocates bandwidth on a single media?

A. Time-division Multiplexing (TDM)

B. Signaling System 7 (SS7)

C. X.25

D. Frame relay

Ans A

82 Which three devices can be used to convert the user data from the DTE into a form acceptable to the WAN service's facility?

A. Modem

B. CSU/DSU

C. TA/NT1

D. CO

E. SS7

Ans A, B & C

A modem, CSU/DSU (Channel Service Unit/Data Service Unit), or TA/NT1 (Terminal Adapter/Network Termination 1) can be used to convert the user data from the DTE into a form acceptable to the WAN service's facility.

83 What is the juncture at which the CPE ends and the local loop portion of the service begins?

A. Demarc

B. CO

C. Local loop

D. Last-mile

Ans A

The demarcation or demarc is the juncture at which the CPE ends and the local loop portion of the service begins. The CO (Central Office) is the nearest point of presence for the provider's WAN service. The local loop or "last-mile" is the cabling that extends from the demarc into the WAN service provider's central office.

84 You can access three forms of WAN services with Cisco routers. Select the three forms:

A. Switched or relayed services

B. Interface front end to IBM enterprise data center computers

C. Using protocols that connect peer-to-peer devices like HDLC or PPP encapsulation.

D. IPX/SPX

E. NetBEUI

Ans: A, B & C

You can access three forms of WAN services with Cisco routers. Switched or relayed services include X.25, Frame Relay, and ISDN. An interface front end to IBM enterprise data center computers includes SDLC. And, you can access the services of WAN providers using protocols that connect peer devices such as HDLC and PPP encapsulation. IPX/SPX and NetBEUI are LAN protocols.

85 Select the fields for the Cisco HDLC protocol:

A. Flag, Address, Control

B. Flag, Address, Control, Protocol, LCP (Code, Identifier, Length, Data), FCS, Flag

C. Flag, Address, Control, Data, FCS, Flag

D. Flag, Address, Control, Proprietary, Data, FCS, Flag

Ans D

The Cisco HDLC frame format is Flag, Address, Control Proprietary, Data, FCS, Flag. The PPP frame format is Flag, Address, Control, Protocol, LCP (Code, Identifier, Length, Data), FCS, Flag. The SDLC and LAPB format is Flag, Address, Control, Data, FCS, Flag.

85: Select the physical interfaces that PPP can be configured on a Cisco router:

A. Asynchronous serial

B. HSSI

C. ISDN

D. Synchronous serial

Ans A, B, C & D

All four of them can carry PPP traffic. HSSI is High Speed Serial Interface.

86 Select the correct statements about PPP and SLIP for WAN communications?

A. PPP uses its Network Control Programs (NCPs) component to encapsulate multiple protocols.

B. PPP can only transport TCP/IP

C. SLIP can only transport TCP/IP.

D. SLIP uses its Network Control Programs (NCPs) component to encapsulate multiple protocols.

Ans A & C

87a Which protocol for PPP LCP (Link Control Protocol) performs a challenge handshake?

A. CHAP

B. PAP

C. UDP

D. IPX

Ans: A

87b Which form of PPP error detection on Cisco routers monitors data dropped on a link?

A. Quality

B. Magic Number

C. Error Monitor

D. Droplink

Ans: A

The Quality protocol monitors data dropped on a link. Magic Number avoids frame looping.

88 Which protocol for PPP provides load balancing across multiple links?

A. Multilink Protocol (MP)

B. Quality

C. Magic Number

D. Stacker

E. Predictor

Ans A

89 As the system administrator, you type "ppp authentication chap pap secret". Which authentication method is used first in setting up a session?

A. secret

B. PAP

C. CHAP

D. PPP/SLIP

Ans C

90 Select the compression protocols for PPP?

A. Stac

B. Predictor

C. Quality

D. Magic Number

Ans: A & B

91 What are the three phases of PPP session establishment?

A. Link establishment phase

B. Authentication phase

C. Network layer protocol phase

D. Handshake phase

E. Dial-in phase

Ans A, B & C

92 What is the default IPX Ethernet encapsulation?

A.) SNAP

B.) Arpa

C.) 802.2

D.) Novell-Ether

E.) SAP

Ans D

93 What must be true for two Routers running IGRP to communicate their routes?

A.) Same autonomous system number

B.) Connected using Ethernet only

C.) Use composite metric

D)Configured for PPP

Ans A

94 The following is partial output from a routing table, identify the 2 numbers in the square brackets; '192.168.10.0 [100/1300] via 10.1.0.1, 00:00:23, Ethernet1'

A.) 100 = metric, 1300 = administrative distance

B.) 100 = administrative distance, 1300 = hop count

C.) 100 = administrative distance, 1300 = metric

D.) 100 = hop count, 1300 = metric

Ans C

95 Identify 3 methods used to prevent routing loops?

A.) Split horizon

B.) Holddown timers

C.) Poison reverse

D.) SPF algorithm

E.) LSP's

Ans A B C

96 Which statement is true regarding full duplex?

A.) Allows for transmission and receiving of data simultaneously

B.) Only works in a multipoint configuration

C.) Does not affect the bandwidth

D.) Allows for transmission and receiving of data but not a the same time

Ans A

Full duplex is just the opposite of half duplex. It handles traffic in both directions simultaneously.

97 Identify the switching method that receives the entire frame then dispatches it?

A.) Cut-through

B.) Receive and forward

C.) Store and forward

D.) Fast forward

Ans C

Store and forward switching receives the entire frame before dispatching it.

98 Identify the purpose of ICMP?

A.) Avoiding routing loops

B.) Send error and control messages

C.) Transporting routing updates

D.) Collision detection

Ans B

ICMP is used to send error and control messages. Ping uses ICMP to carry the echo-request and echo-reply.

99 Which statement is true regarding the user exec and privileged exec mode?

A.) The '?' only works in Privileged exec

B.) They are identical

C.) They both require the enable password

D.) User exec is a subset of the privileged exec

Ans D

The user exec mode is a subset of the privileged exec mode. Only a certain number of commands are available at the user exec mode.

100 Which OSI layer end to end communication, segmentation and re-assembly?

A.) Network

B.) Transport

C.) Physical

D.) Application

E.) Data-Link

F.) Presentation

Ans B

Layer 4 the Transport layer performs this function.

101 What IP command would you use to test the entire IP stack?

A.) Stack-test

B.) Arp

C.) Telnet

D.) Ping

E.) Trace

Ans C

Because Telnet is an application and it resides at the top of the stack it traverses down the stack and up the stack at the receiving end.

102 Identify the 2 hardware components used to manage and/or configure a router?

A.) Auxiliary port

B.) ROM port

C.) Management port

D.) Console port

Ans A D

The 2 hardware ports used to configure the router are the console and auxiliary ports.

103 What is the default bandwidth of a serial connection?

A.) 1200 baud

B.) 1.544 Mbps (T1)

C.) 10 Mbps

D.) 96Kpbs

Ans B

The default bandwidth is T1.

104 Identify 2 functions of IPX access-lists?

A.) Control SAP traffic

B.) Limit number of Novell servers on a network

C.) Limit number of workstations on a network

D.) Block IPX traffic

Ans A D

IPX access lists are used to restrict IPX traffic and SAP broadcasts.

105 Identify 2 HDLC characteristics?

A.) Default serial encapsulation

B.) Open standard

C.) Supports Stacker compression

D.) Supports point-to-point and multipoint

Ans A D

HDLC is the default serial encapsulation and supports point-to-point and multipoint. It is not an open standard and does not support compression.

106 Identify 3 IP applications?

A.) AURP

B.) ARP

C.) Telnet

D.) SMTP

E.) DNS

F.) RARP

Ans C D E

ARP and AURP are not part the application layer of the TCP/IP stack. SMTP - Simple Mail Transfer Protocol, Telnet, DNS - Domain Name Services (name to IP resolution).

107 Identify 3 LAN technologies?

A.) FDDI

B.) HDLC

C.) HSSI

D.) X.25

E.) 802.3

F.) 802.5

Ans A E F

The question is asking for 3 LAN technologies, HDLC, HSSI and X.25 are all WAN technologies.

108 Identify the 4 that are not LAN technologies?

A.) HDLC

B.) FDDI

C.) 802.5

D.) HSSI

E.) SDLC

F.) Frame Relay

Ans A D E F

802.5 and FDDI are LAN technologies

109 Which OSI layer supports the communication component of an application?

A.) Data-Link

B.) Physical

C.) Session

D.) Presentation

E.) Application

F.) Transport

Ans E

Layer 7 the Application layer performs this function.

110 Identify the length of an IPX address and it's components?

A.) 80 bits, 48 bits network and 32 bits node

B.) 32 bits, 16 bits network and 16 bits node

C.) None of the above

D.) 80 bits, 32 bits network and 48 bits node

Ans D

IPX address has 2 components; network and node. The network address is 32 bits and the node is 48 bits, total of 80 bits.

111 Identify the administrative distance and appropriate routing protocol?

A.) RIP = 255, IGRP = 100

B.) RIP = 100, IGRP = 120

C.) RIP = 1, IGRP = 0

D.) RIP = 120, IGRP = 100

Ans D

The administrative distance for RIP is 120 and IGRP is 100. The lower the AD the better the routing information.

112 Which OSI layer incorporates the MAC address and the LLC?

A.) Data link

B.) Network

C.) Physcial

D.) Transport

Ans): A

Layer 2 the Data-Link layer incorporates the MAC and LLC sublayers

113 If configuring a Cisco router to connect to a non-Cisco router across a Frame Relay network, which encapsulation type would you select?

A.) Q933a

B.) ISDN

C.) IETF

D.) CISCO

E.) ANSI

Ans C

There are two types of Frame Relay encapsulations; Cisco and IETF. IETF is required when connecting a Cisco to a non-Cisco router.

114 Identify the 2 items that TCP and UDP share in common?

A.) Both use port numbers to identify upper level applications

B.) Operate at the Network layer

C.) Both are Transport protocols

D.) Both are reliable communications

Ans A C

TCP and UPD are both layer 4 Transport protocols and both use port number to identify upper level applications.

115 Identify 3 characteristics of IP RIP?

A.) Distance vector

B.) Administrative distance is 120

C.) Periodic updates every 60 seconds

D.) Uses a composite metric

E.) Can load balance

Ans A B E

IP RIP is a distance vector protocol, it can load balance up to 4 equal cost paths and it's rating of trustworthiness is 120.

116 Which of the following is a layer 2 device?

A.) Switch

B.) Router

C.) Repeater

D.) Hub

Ans A

A Hub and Repeater are layer 1 devices. A Router is a layer 3 device.

117 Identify the definition of demarcation?

A.) Date in which the WAN service contract expires

B.) Cabling which extends from the WAN service provider to the customer

C.) Division of responsibility, where the CPE ends and the local loop begins

D.) Equipment which is located at the customer premises

Ans C

Demarcation is the point in which responsibility changes hands.

118 Identify the 3 key features of the Cisco Discovery Protocol?

A.) Off by default

B.) Will allow for the discovery of layer 3 addresses on neighbor routers

C.) Verify connectivity

D.) Open standard

E.) Does not require any layer 3 protocols to be configured

Ans B C E

CDP is used for 2 basic reasons; neighbor connectivity and layer 3 discovery if configured. It is proprietary and is on by default.

119 Identify the 3 characteristics of IPX RIP?

A.) Distance vector

B.) Does not support multiple paths

C.) 60 second updates

D.) Default encapsulation is SAP

E.) Uses ticks and hop count as a metric

Ans A C E

IPX RIP is a distance vector routing protocol, it does support multiple paths, the default encapsulation is 'novell-ether', it uses tick count as a primary metric and hop count as a tie breaker and it sends it’s updates every 60 seconds.

120 Identify the access-list range for an extended IP access-list?

A.) 800 - 899

B.) 1 - 99

C.) 1000 - 1099

D.) 100 - 199

Ans D

IP extended access-lists use the number range of 100-199.

121 Identify the X.25 addressing standard?

A.) X.121

B.) X.25a

C.) ITU-1

D.) Q933a

Ans A

The X.25 layer 3 addressing standards is X.121.

122 Identify 3 features of IGRP?

A.) Composite metric

B.) New horizon

C.) Flash updates

D.) 60 periodic updates

E.) Poison reverse

Ans A C E

IGRP uses a composite metric made up of bandwidth and delay by default, it updates every 60 seconds and will trigger an update if the topology changes.

123 Where is the backup configuration file stored?

A.) RAM

B.) ROM

C.) Console

D.) NVRAM

Ans D

One location to store the backup configuration is NVRAM.

124 Identify the correct pair of Novell Ethernet encapsulation and Cisco terminology?

A.) Ethernet II, Snap

B.) Ethernet 802.3, Novell-Ether

C.) Ethernet SNAP, Arpa

D.) Ethernet 802.2, Snap

Ans B

The default IPX LAN encapsulation is Novell-Ether which is 802.3

125 Identify 3 characteristics regarding IP access-lists?

A.) Can be configured as a standard access-list

B.) Can be run from another router running IP

C.) Can be configured as a named access-list

D.) Are the same as IPX access-lists

E.) Can be configured as an extended access-list

Ans A C E

There are 3 types of IP access-lists; standard, extended and named. Named access-lists can be either standard or extended depending on how they are configured.

126 Identify 3 ways in which a router can be configured?

A.) TFTP

B.) Nvram

C.) Ping

D.) Console

E.) Trace

Ans A B D

Changes to the configuration can be entered via the console, a config stored in NVRAM or on a TFTP server. Trace and ping are tools to verify connectivity.

127 A traffic light is an example of what type of mechanism?

A.) Collision detection

B.) Flow control

C.) Sequence numbering

D.) Network management

Ans B

A Traffic light is an example of flow control.

128 Windowing is a type of?

A.) Negative acknowledgement

B.) Address resolution

C.) Layer transition mechanism

D.) Flow control

Ans D

Windowing allow the sender and receiver to dictate how much information that can be received prior to an acknowledgement. It is a form of flow control.

129 Identify the 2 types of access-list filters that control SAP traffic?

A.) Novell-ether

B.) Arpa

C.) Input-sap-filter

D.) Round-robin

E.) Output-sap-filter

Ans C E

SAP's can be blocked by 2 methods; inbound and outbound.

130 Identify the 3 guidelines for routers in the same autonomous system?

A.) Must be configured for IGRP or RIP

B.) Interconnected

C.) Assigned the same autonomous system number

D.) Configured for the same routing protocol

E.) Must be same model of router

Ans B C D

Autonomous system must be interconnected, assigned the same AS # and configured with the same routing protocol.

131 Identify the hardware component used to store buffers, tables, running-configuration etc?

A.) NVRAM

B.) ROM

C.) RAM

D.) Flash

Ans C

RAM is the dynamic memory area. ROM contains the boot strap code, NVRAM contains the startup-config and Flash contains the IOS.

132 Identify 3 UDP characteristics?

A.) Reliable communication protocol

B.) Applications that use UDP must incorporate reliability

C.) Connection-less oriented

D.) Incorporates no handshaking

Ans B C D

UPD is a layer 4 Transport protocol. It is connection-less because it does establish a connection therefore the 3 step handshake is not needed, it does NOT implement any flow control or acknowledgments. Any application that uses UDP must incorporate any needed reliability.

133 Identify the IPX standard access-list number range?

A.) 600 - 699

B.) 1000 - 1099

C.) 1 - 99

D.) 100 - 199

E.) 800 - 899

Ans E

IPX standard access-list range is 800-899.

134 Which OSI layer provides best effort end to end packet delivery?

A.) Data-Link

B.) Presentation

C.) Network

D.) Transport

E.) Physical

F.) Application

Ans C

Layer 3 the Network layer performs this function.

135 Identify the 2 methods to modify the routers boot sequence?

A.) Setup program

B.) Boot system commands

C.) RXBoot

D.) Config-register

Ans B D

'Boot system' command the 'config-register' are used to manipulate the boot sequence.

136 Identify the 3 pieces of hardware you would not install to prevent broadcasts?

A.) Switch

B.) Repeater

C.) Bridge

D.) Router

Ans A B C

Router are implemented not only to break up networks into smaller segments but they are used to block broadcasts.

137 Identify 2 features of PPP PAP authentication?

A.) Username and password is sent in clear text

B.) Authentication messages are sent periodically during the connection

C.) More secure than CHAP

D.) Remote node is control of authentication process

Ans A D

PPP PAP authentication sends the username and passwords in clear text and the remote node initiates the authentication process.

138 Identify the switching method that examines the destination MAC address as the frame is being received then begins forwarding the frame prior to receiving the entire frame?

A.) Fragment-free

B.) Store and Forward

C.) Cut-through

D.) Fast forward

Ans C

Cut through examines the destination MAC address and begins forwarding the frame prior to receiving the entire frame.

139 Identify 1 characteristic of RARP?

A.) IP to MAC address translation

B.) Connectionless delivery of packets

C.) Can be used to initiate remote O/S load sequence

D.) Generates error and control messages

Ans C

Reverse Address Resolution Protocol is used to obtain a layer 3 address if the MAC address is known which then facilitates the loading of the O/S.

140 Identify the protocol to test connectivity without configuring any layer 3 protocols?

A.) TCP

B.) Ping

C.) IP

D.) CDP

E.) Telnet

Ans D

CDP can be used to verify connectivity prior to any layer 3 protocols being configured.

141 LMI operates between the Frame Switch and what other device?

A.) CPE device

B.) Another Frame Switch

C.) X.25 switch

D.) Novell File Server

Ans A

LMI stands for local management interface. It operates between the Frame Relay switch and the customer equipment.

142 Identify IPX SAP and it's purpose?

A.) Sonet Access Pipe - interface to Sonet ring

B.) Service Advertising Protocol - advertise services

C.) Server Appletalk Protocol - appletalk directory services

D.) Service Access Point - identify upper layer protocols

Ans B

SAP is an Novell protocol to advertise services.

143 Identify the default values that make up IGRP's composite metric?

A.) Bandwidth

B.) Load

C.) Reliability

D.) MTU

E.) Delay

Ans A E

IGRP can be configured to use all 5 within it's metric. By default it uses bandwidth and delay.

144 Identify the default serial encapsulation?

A.) ISDN

B.) HDLC

C.) SDLC

D.) Frame Relay

E.) PPP

Ans B

The default serial encapsulation is HDLC.

145 Identify the purpose of ARP?

A.) Avoiding routing loops

B.) Determining a workstation's IP address

C.) Sending a directed broadcast

D.) Determining a workstation's MAC address

Ans D

ARP is used to find a devices MAC address given an IP address.

146 What is the purpose of the DLCI?

A.) Identifies the remote routers

B.) Contained with a 802.2 frame for routing purposes

C.) Used with PPP during authentication

D.) Identifies the PVC in a Frame Relay network

Ans D

DLCI stands for Data Link Connection Identifier. It identifies the local PVC.

147 Identify 3 characteristics of the Network layer (OSI layer 3)?

A.) Connection oriented

B.) Path determination

C.) Supports multiplexing

D.) Manages sessions

E.) Packet forwarding

Ans B C E

The network layer is responsible for routing which entails learning the paths, selecting the best path and forwarding the packet. Because it services multiple layer 4 protocols it multiplexes.

148 Identify 3 characteristics of switches?

A.) Increase available bandwidth

B.) Decrease broadcast traffic

C.) Support full duplex in a multipoint topology

D.) Make forwarding decision using MAC address

E.) Create collision domains

Ans A D E

Switches operate at layer 2. They increase bandwidth by reducing the number of devices sharing the media. They isolate collisions. Like a bridge they forward traffic based upon layer 2 address/ MAC address.

149 Which OSI layer handles physical address, network topology?

A.) Presentation

B.) Physical

C.) Transport

D.) Application

E.) Data-Link

F.) Network

Ans E

Layer 2 the Data-Link layer performs this function.

150 Identify 2 reasons for disabling CDP?

A.) If the router is not configured for RIP

B.) Save bandwidth by eliminating overhead

C.) If the router is configured for Appletalk

D.) When connected to a non-Cisco router

Ans B D

CDP can be disabled here are a couple of reasons. Connecting a Cisco router to a non-Cisco router. Don't want to exchange CDP information to save bandwidth.

Friday, August 29, 2008

Cobol Interview Questions

1.Name the divisions in a COBOL program.

Identification Division, Environment Division, Data Division, Procedure Division.

2.What are the different data types available in COBOL?

Alpha-numeric (X), alphabetic (A) and numeric (9).

3.What does the INITIALIZE verb do? –

Alphabetic, Alphanumeric fields & alphanumeric edited items are set to SPACES.

Numeric, Numeric edited items set to ZERO.

FILLER , OCCURS DEPENDING ON items left untouched.

4.What is 77 level used for ?

Elementary level item. Cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves.

5.What is 88 level used for ?

For condition names.

6.What is level 66 used for ?

For RENAMES clause.

7.What does the IS NUMERIC clause establish ?

IS NUMERIC can be used on alphanumeric items, signed numeric & packed decimal items and usigned numeric & packed decimal items. IS NUMERIC returns TRUE if the item only consists of 0-9. However, if the item being tested is a signed item, then it may contain 0-9, + and - .

8.How do you define a table/array in COBOL?

01 ARRAYS.

05 ARRAY1 PIC X(9) OCCURS 10 TIMES.

05 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX.

9.Can the OCCURS clause be at the 01 level?

No.

10.What is the difference between index and subscript?

Subscript refers to the array occurrence while index is the displacement (in no of bytes) from the beginning of the array. An index can only be modified using PERFORM, SEARCH & SET.

Need to have index for a table in order to use SEARCH, SEARCH ALL.

11.What is the difference between SEARCH and SEARCH ALL?

SEARCH - is a serial search.

SEARCH ALL - is a binary search & the table must be sorted ( ASCENDING/DESCENDING KEY clause to be used & data loaded in this order) before using SEARCH ALL.

12.What should be the sorting order for SEARCH ALL?

It can be either ASCENDING or DESCENDING. ASCENDING is default. If you want the search to be done on an array sorted in descending order, then while defining the array, you should give DESCENDING KEY clause. (You must load the table in the specified order).

13. What is binary search?

Search on a sorted array. Compare the item to be searched with the item at the center. If it matches, fine else repeat the process with the left half or the right half depending on where the item lies.

14. My program has an array defined to have 10 items. Due to a bug, I find that even if the program access the 11th item in this array, the program does not abend. What is wrong with it?

Must use compiler option SSRANGE if you want array bounds checking. Default is NOSSRANGE.

15.How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning.

Syntax:

SORT file-1 ON ASCENDING/DESCENDING KEY key....

USING file-2

GIVING file-3.

USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2

GIVING can be substituted by OUTPUT PROCEDURE IS para-1 THRU para-2.

file-1 is the sort workfile and must be described using SD entry in FILE SECTION.

file-2 is the input file for the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL.

file-3 is the outfile from the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL.

file-1, file-2 & file-3 should not be opened explicitly.

INPUT PROCEDURE is executed before the sort and records must be RELEASEd to the sort work file from the input procedure.

OUTPUT PROCEDURE is executed after all records have been sorted. Records from the sort work file must be RETURNed one at a time to the output procedure.

16.How do you define a sort file in JCL that runs the COBOL program?

Use the SORTWK01, SORTWK02,..... dd names in the step. Number of sort datasets depends on the volume of data being sorted, but a minimum of 3 is required.

17.What are the two ways of doing sorting in a COBOL program? Give the formats.

See question 16.

18.Give the format of USING and GIVING in SORT statement. What are the restrictions with it?

See question 16. Restrictions - Cannot massage records, canot select records to be sorted.

19.What is the difference between performing a SECTION and a PARAGRAPH?

Performing a SECTION will cause all the paragraphs that are part of the section, to be performed.

Performing a PARAGRAPH will cause only that paragraph to be performed.

20.What is the use of EVALUATE statement?

Evaluate is like a case statement and can be used to replace nested Ifs. The difference between EVALUATE and case is that no 'break' is required for EVALUATE i.e. control comes out of the EVALUATE as soon as one match is made.

21.What are the different forms of EVALUATE statement?

EVALUATE EVALUATE SQLCODE ALSO FILE-STATUS

WHEN A=B AND C=D WHEN 100 ALSO '00'

imperative stmt imperative stmt

WHEN (D+X)/Y = 4 WHEN -305 ALSO '32'

imperative stmt imperative stmt

WHEN OTHER WHEN OTHER

imperative stmt imperative stmt

END-EVALUATE END-EVALUATE

EVALUATE SQLCODE ALSO A=B EVALUATE SQLCODE ALSO TRUE

WHEN 100 ALSO TRUE WHEN 100 ALSO A=B

imperative stmt imperative stmt

WHEN -305 ALSO FALSE WHEN -305 ALSO (A/C=4)

imperative stmt imperative stmt

END-EVALUATE END-EVALUATE

22.How do you come out of an EVALUATE statement?

After the execution of one of the when clauses, the control is automatically passed on to the next sentence after the EVALUATE statement. There is no need of any extra code.

23.In an EVALUATE statement, can I give a complex condition on a when clause?

Yes.

24.What is a scope terminator? Give examples.

Scope terminator is used to mark the end of a verb e.g. EVALUATE, END-EVALUATE; IF, END-IF.

25.How do you do in-line PERFORM?

PERFORM ... ...

END PERFORM

26.When would you use in-line perform?

When the body of the perform will not be used in other paragraphs. If the body of the perform is a generic type of code (used from various other places in the program), it would be better to put the code in a separate para and use PERFORM paraname rather than in-line perform.

27. What is the difference between CONTINUE & NEXT SENTENCE ?

CONTINUE is like a null statement (do nothing) , while NEXT SENTENCE transfers control to the next sentence (!!) (A sentence is terminated by a period)

28.What does EXIT do ?

Does nothing ! If used, must be the only sentence within a paragraph.

29.Can I redefine an X(100) field with a field of X(200)?

Yes. Redefines just causes both fields to start at the same location. For example:

01 WS-TOP PIC X(1)

01 WS-TOP-RED REDEFINES WS-TOP PIC X(2).

If you MOVE '12' to WS-TOP-RED,

DISPLAY WS-TOP will show 1 while

DISPLAY WS-TOP-RED will show 12.

30.Can I redefine an X(200) field with a field of X(100) ?

Yes.

31.What do you do to resolve SOC-7 error?

Basically you need to correcting the offending data.

Many times the reason for SOC7 is an un-initialized numeric item. Examine that possibility first.

Many installations provide you a dump for run time abends ( it can be generated also by calling some subroutines or OS services thru assembly language). These dumps provide the offset of the last instruction at which the abend occurred. Examine the compilation output XREF listing to get the verb and the line number of the source code at this offset. Then you can look at the source code to find the bug. To get capture the runtime dumps, you will have to define some datasets (SYSABOUT etc ) in the JCL.

If none of these are helpful, use judgement and DISPLAY to localize the source of error.

Some installtion might have batch program debugging tools. Use them.

32.How is sign stored in Packed Decimal fields and Zoned Decimal fields?

Packed Decimal fields: Sign is stored as a hex value in the last nibble (4 bits ) of the storage.

Zoned Decimal fields: As a default, sign is over punched with the numeric value stored in the last bite.

33.How is sign stored in a comp-3 field?

It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C if your number is 101, hex 2C if your number is 102, hex 1D if the number is -101, hex 2D if the number is -102 etc...

34.How is sign stored in a COMP field ?

In the most significant bit. Bit is on if -ve, off if +ve.

35.What is the difference between COMP & COMP-3 ?

COMP is a binary storage format while COMP-3 is packed decimal format.

36.What is COMP-1? COMP-2?

COMP-1 - Single precision floating point. Uses 4 bytes.

COMP-2 - Double precision floating point. Uses 8 bytes.

37.How do you define a variable of COMP-1? COMP-2?

No picture clause to be given. Example 01 WS-VAR USAGE COMP-1.

38. How many bytes does a S9(7) COMP-3 field occupy ?

Will take 4 bytes. Sign is stored as hex value in the last nibble.

General formula is INT((n/2) + 1)), where n=7 in this example.

39.How many bytes does a S9(7) SIGN TRAILING SEPARATE field occupy ?

Will occupy 8 bytes (one extra byte for sign).

40.How many bytes will a S9(8) COMP field occupy ?

4 bytes.

41.What is the maximum value that can be stored in S9(8) COMP?

99999999

42. What is COMP SYNC?

Causes the item to be aligned on natural boundaries. Can be SYNCHRONIZED LEFT or RIGHT.

For binary data items, the address resolution is faster if they are located at word boundaries in the memory. For example, on main frame the memory word size is 4 bytes. This means that each word will start from an address divisible by 4. If my first variable is x(3) and next

one is s9(4) comp, then if you do not specify the SYNC clause, S9(4) COMP will start from byte 3 ( assuming that it starts from 0 ). If you specify SYNC, then the binary data item will start from address 4. You might see some wastage of memory, but the access to this

computational field is faster.

43. What is the maximum size of a 01 level item in COBOL I? in COBOL II?

In COBOL II: 16777215

44.How do you reference the following file formats from COBOL programs:

Fixed Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0 .

Fixed Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, do not use BLOCK CONTAINS

Variable Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, BLOCK CONTAINS 0. Do not code the 4 bytes for record length in FD ie JCL rec length will be max rec length in pgm + 4

Variable Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, do not use BLOCK CONTAINS. Do not code 4 bytes for record length in FD ie JCL rec length will be max rec length in pgm + 4.

ESDS VSAM file - Use ORGANISATION IS SEQUENTIAL.

KSDS VSAM file - Use ORGANISATION IS INDEXED, RECORD KEY IS, ALTERNATE RECORD KEY IS

RRDS File - Use ORGANISATION IS RELATIVE, RELATIVE KEY IS

Printer File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0. (Use RECFM=FBA in JCL DCB).

45.What are different file OPEN modes available in COBOL?

Open for INPUT, OUTPUT, I-O, EXTEND.

46.What is the mode in which you will OPEN a file for writing?

OUTPUT, EXTEND

47.In the JCL, how do you define the files referred to in a subroutine ?

Supply the DD cards just as you would for files referred to in the main program.

48.Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?

Can rewrite(record length must be same), but not delete.

49.What is file status 92?

Logic error. e.g., a file is opened for input and an attempt is made to write to it.

50.What is file status 39 ?

Mismatch in LRECL or BLOCKSIZE or RECFM between your COBOL pgm & the JCL (or the dataset label). You will get file status 39 on an OPEN.

51.What is Static,Dynamic linking ?

In static linking, the called subroutine is link-edited into the calling program , while in dynamic linking, the subroutine & the main program will exist as separate load modules. You choose static/dynamic linking by choosing either the DYNAM or NODYNAM link edit option. (Even if you choose NODYNAM, a CALL identifier (as opposed to a CALL literal), will translate to a DYNAMIC call).

A statically called subroutine will not be in its initial state the next time it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state.

52.What is AMODE(24), AMODE(31), RMODE(24) and RMODE(ANY)? ( applicable to only

MVS/ESA Enterprise Server).

These are compile/link edit options.

AMODE - Addressing mode. RMODE - Residency mode.

AMODE(24) - 24 bit addressing. AMODE(31) - 31 bit addressing. AMODE(ANY) - Either 24 bit or 31 bit addressing depending on RMODE.

RMODE(24) - Resides in virtual storage below 16 Meg line. Use this for 31 bit programs that call 24 bit programs. (OS/VS Cobol pgms use 24 bit addresses only).

RMODE(ANY) - Can reside above or below 16 Meg line.

53.What compiler option would you use for dynamic linking?

DYNAM.

54.What is SSRANGE, NOSSRANGE ?

These are compiler options w.r.t subscript out of range checking. NOSSRANGE is the default and if chosen, no run time error will be flagged if your index or subscript goes out of the permissible range.

55. How do you set a return code to the JCL from a COBOL program?

Move a value to RETURN-CODE register. RETURN-CODE should not be declared in your program.

56. How can you submit a job from COBOL programs?

Write JCL cards to a dataset with

//xxxxxxx SYSOUT=(A,INTRDR) where 'A' is output class, and dataset should be opened for output in the program. Define a 80 byte record layout for the file.

57.What are the differences between OS VS COBOL and VS COBOL II?

OS/VS Cobol pgms can only run in 24 bit addressing mode, VS Cobol II pgms can run either in 24 bit or 31 bit addressing modes.

Report writer is supported only in OS/VS Cobol.

USAGE IS POINTER is supported only in VS COBOL II.

Reference modification eg: WS-VAR(1:2) is supported only in VS COBOL II.

EVALUATE is supported only in VS COBOL II.

Scope terminators are supported only in VS COBOL II.

OS/VS Cobol follows ANSI 74 stds while VS COBOL II follows ANSI 85 stds.

Under CICS Calls between VS COBOL II programs are supported.

58.What are the steps you go through while creating a COBOL program executable?

DB2 precompiler (if embedded sql used), CICS translator (if CICS pgm), Cobol compiler, Link editor.

If DB2 program, create plan by binding the DBRMs.

59.Can you call an OS VS COBOL pgm from a VS COBOL II pgm ?

Tuesday, August 26, 2008

Javascript Interview Questions

What have you used JavaScript for?
Typical answers include form validations, user action confirmations, updating an Internet page dynamically and other such answers. I usually ask this question first just to get the candidate talking about JavaScript and see if they have in fact used JavaScript for something.

How do you access an element in an HTML document with JavaScript?
Give the element an ID attribute and then use JavaScript’s getElementById() function to access that element.

How do you determine how many characters are in a JavaScript string?
With the length property of the JavaScript string object.

What datatypes are supported by JavaScript?
Number, String, Undefined, null, Boolean. At a minimum, the candidate should identify Number and String.

How do you create a date in JavaScript?
With the Date object: new Date()

Where does JavaScript date object pull it’s date from?
From the client machine.

What does the isNaN function do?
Returns true is the value provided is not a numeric value and false if the number provided is a numeric value.

What is the difference between JavaScript and Java?
They are completely different languages.

How do you comment JavaScript code?
For single-line comments, begin the line with consecutive forward slashes (//). To comment a block of code, wrap it with /* code */.

What is the JavaScript concatenation operator?
The plus sign.

How do you call an external JavaScript file?
With the script tag, using the src attribute to reference the path of the JavaScript file.

How do you create a function in JavaScript?
Use the function statement.

How do you get the item selected in a dropdown select list?
With the selectedIndex property

How do you open a new window?
With window.open

How do you remove all options from a dropdown select list?
By setting the length property of the dropdown select list to 0.

Demonstrate the syntax for writing a FOR loop.
Need an answer similar to:
for (i=1;i<=LoopNumber;i++) { //do something } How do you determine the length of an array?
With the length property of the array object

How do you load a new URL in a browser?
With the location or href property of the window or document object.

What are the different usages of equal signs?
One (=) is for assignment. Two (==) is for equality. Three (===) is for strict comparison.

What is ++ used for
It is the increment operator. It adds one to a value.

What is a transient variable?
A transient variable is a variable that may not be serialized.

Which containers use a border Layout as their default layout?
The window, Frame and Dialog classes use a border layout as their default layout.

Why do threads block on I/O?
Threads block on I/O (that is enters the waiting state) so that other threads may execute while the I/O Operation is performed.

How are Observer and Observable used?
Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is implemented by objects that observe Observable objects.

What is synchronization and why is it important?
With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value. This often leads to significant errors.

Can a lock be acquired on a class?
Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object.

What's new with the stop(), suspend() and resume() methods in JDK 1.2?
The stop(), suspend() and resume() methods have been deprecated in JDK 1.2.

Is null a keyword?
The null value is not a keyword.


What is the preferred size of a component?
The preferred size of a component is the minimum component size that will allow the component to display normally.

What method is used to specify a container's layout?
The setLayout() method is used to specify a container's layout.

Which containers use a FlowLayout as their default layout?
The Panel and Applet classes use the FlowLayout as their default layout.

What state does a thread enter when it terminates its processing?
When a thread terminates its processing, it enters the dead state.

What is the Collections API?
The Collections API is a set of classes and interfaces that support operations on collections of objects.

Which characters may be used as the second character of an identifier, but not as the first character of an identifier?

The digits 0 through 9 may not be used as the first character of an identifier but they may be used after the first character of an identifier.

What is the List interface?
The List interface provides support for ordered collections of objects.

How does Java handle integer overflows and underflows?
It uses those low order bytes of the result that can fit into the size of the type allowed by the operation.

What is the Vector class?
The Vector class provides the capability to implement a growable array of objects

What modifiers may be used with an inner class that is a member of an outer class?
A (non-local) inner class may be declared as public, protected, private, static, final, or abstract.

What is an Iterator interface?
The Iterator interface is used to step through the elements of a Collection.

What is the difference between the >> and >>> operators?
The >> operator carries the sign bit when shifting right. The >>> zero-fills bits that have been shifted out.

Which method of the Component class is used to set the position and size of a component?
setBounds()

How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?
Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit patterns. UTF-16 uses 16-bit and larger bit patterns.

What is the difference between yielding and sleeping?
When a task invokes its yield() method, it returns to the ready state. When a task invokes its sleep() method, it returns to the waiting state.

Which java.util classes and interfaces support event handling?
The EventObject class and the EventListener interface support event processing.

Is sizeof a keyword?
The sizeof operator is not a keyword.

What are wrapper classes?
Wrapper classes are classes that allow primitive types to be accessed as objects.

Does garbage collection guarantee that a program will not run out of memory?
Garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection.

What restrictions are placed on the location of a package statement within a source code file?
A package statement must appear as the first line in a source code file (excluding blank lines and comments).

Can an object's finalize() method be invoked while it is reachable?
An object's finalize() method cannot be invoked by the garbage collector while the object is still reachable. However, an object's finalize() method may be invoked by other objects.

What is the immediate superclass of the Applet class?
Panel

What is the difference between preemptive scheduling and time slicing?
Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors.

Name three Component subclasses that support painting.
The Canvas, Frame, Panel, and Applet classes support painting.

What value does readLine() return when it has reached the end of a file?
The readLine() method returns null when it has reached the end of a file.

What is the immediate superclass of the Dialog class?
Window.

What is clipping?
Clipping is the process of confining paint operations to a limited area or shape.

Saturday, August 23, 2008

Bluetooth Interview Questions

What is Bluetooth?
A: Bluetooth is the name for a short-range radio frequency (RF) technology that operates at 2.4 GHz and is capable of transmitting voice and data. The effective range of Bluetooth devices is 32 feet (10 meters). Bluetooth transfers data at the rate of 1 Mbps, which is from three to eight times the average speed of parallel and serial ports, respectively.

Why is the technology called Bluetooth?
A: The heart of the Bluetooth brand identity is the name, which refers to the Danish king Harald "Bluetooth" Blaatand who unified Denmark and Norway. In the beginning of the Bluetooth wireless technology era, Bluetooth was aimed at unifying the telecom and computing industries.

What is it - a technology, a standard, an initiative, or a product?
A: Bluetooth wireless technology is a de facto standard, as well as a specification for small-form factor, low-cost, short range radio links between mobile PCs, mobile phones and other portable devices. The Bluetooth Special Interest Group is an industry group consisting of leaders in the telecommunications, computing, and networking industries that are driving development of the technology and bringing it to market.

How is Bluetooth used?
A: Bluetooth can be used to wirelessly synchronize and transfer data among devices. Bluetooth can be thought of as a cable replacement technology. Typical uses include automatically synchronizing contact and calendar information among desktop, notebook and palmtop computers without connecting cables. Bluetooth can also be used to access a network or the Internet with a notebook computer by connecting wirelessly to a cellular phone.

What is FCC and how does it relate to Bluetooth?
FCC is Federal Communication Commission, which issues licenses to the stations for specific frequencies. It also decides who is able to use which frequency for what purpose. Since Bluetooth is using unlicensed spectrum, FCC has no direct involvement with Bluetooth

What is FEC in Bluetooth?
Forward Error Correction is a method by which Bluetooth increases its noise immunity. FEC is a method that enables a receiver to not only detect, but also correct errors in a transmission

What is the future direction of the Bluetooth standard?
A: At this time, we anticipate the Bluetooth SIG to evolve the Bluetooth technology to provide greater bandwidth and distances, thus increasing the potential platforms and applications used in the emerging personal area networking marketplace

What is Bluetooth SIG?
Bluetooth Special Interest Group (SIG)

Bluetooth wireless technology is revolutionizing personal connectivity by providing freedom from wired connections. It is a specification for a small-form factor, low-cost radio solution providing links between mobile computers, mobile phones, other portable handheld devices and automobiles, as well as connectivity to the Internet. The Bluetooth SIG, comprised of leaders in the telecommunications, computing, automotive and consumer electronics industries, is driving development of the technology and bringing it to market. The Bluetooth SIG includes Promoter member companies Agere, Ericsson, IBM, Intel, Microsoft, Motorola, Nokia and Toshiba, and thousands of Associate and Adopter member companies. The Bluetooth SIG, Inc. headquarters are located in Overland Park, Kansas, U.S.A

Why is Bluetooth 2.0 better?
The main features of Bluetooth Core Specification Version 2.0 + EDR are:
• 3 times faster transmission speed (up to 10 times in certain cases)
• Lower power consumption through reduced duty cycle
• Simplification of multi-link scenarios due to more available bandwidth
• Backwards compatible to earlier versions
• Further improved BER (Bit Error Rate) performance

Name few applications of Bluetooth?
* Wireless control of and communication between a cell phone and a hands free headset or car kit. This is the most popular use.
* Wireless networking between PCs in a confined space and where little bandwidth is required.
* Wireless communications with PC input devices such as mouses and keyboards and output devices such as printers.
* Transfer of files between devices via OBEX.
* Transfer of contact details, calendar appointments, and reminders between devices via OBEX.
* Replacement of traditional wired serial communications in test equipment, GPS receivers and medical equipment.
* For remote controls where infrared was traditionally used.
* Sending small advertisements from Bluetooth enabled advertising hoardings to other, discoverable, Bluetooth devices.
* Wireless control of a games console, Nintendo’s Wii and Sony’s PlayStation 3 will both use Bluetooth technology for their wireless controllers.
* Sending commands and software to the upcoming LEGO Mindstorms NXT instead of infra red.

What kind of encryption will be used for Bluetooth security?
A: The Bluetooth specification 1.0 describes the link encryption algorithm as a stream cipher using 4 LFSR (linear feedback shift registers). The sum of the width of the LFSRs is 128, and the spec says "the effective key length is selectable between 8 and 128 bits". This arrangement allows Bluetooth to be used in countries with regulations limiting encryption strength, and "facilitate a future upgrade path for the security without the need for a costly redesign of the algorithms and encryption hardware" according to the Bluetooth specification. Key generation and authentication seems to be using the 8-round SAFER+ encryption algorithm. The information available suggests that Bluetooth security will be adequate for most purposes; but users with higher security requirements will need to employ stronger algorithms to ensure the security of their data.

How many devices can communicate concurrently?
A Bluetooth device playing the role of the “master” can communicate with up to 7 devices playing the role of the “slave”. This network of “group of up to 8 devices” (1 master + 7 slaves) is called a piconet. A piconet is an ad-hoc computer network of devices using Bluetooth technology protocols to allow one master device to interconnect with up to seven active slave devices (because a three-bit MAC address is used). Up to 255 further slave devices can be inactive, or parked, which the master device can bring into active status at any time.

What is Pairing?
Pairs of devices may establish a trusted relationship by learning (by user input) a shared secret known as a “passkey”. A device that wants to communicate only with a trusted device can cryptographically authenticate the identity of the other device. Trusted devices may also encrypt the data that they exchange over the air so that no one can listen in. The encryption can however be turned off and passkeys are stored on the device’s file system and not the Bluetooth chip itself. Since the Bluetooth address is permanent a pairing will be preserved even if the Bluetooth name is changed. Pairs can be deleted at any time by either device. Devices will generally require pairing or will prompt the owner before it allows a remote device to use any or most of its services. Some devices such as Sony Ericsson phones will usually accept OBEX business cards and notes without any pairing or prompts. Certain printers and access points will allow any device to use its services by default much like unsecured Wi-Fi networks.

How secure a Bluetooth device is?
Bluetooth uses the SAFER+ algorithm for authentication and key generation. The E0 stream cipher is used for encrypting packets. This makes eavesdropping on Bluetooth-enabled devices more difficult.

What are the problems with older versions (1.0 and 1.0 B)?
Versions 1.0 and 1.0 B had numerous problems and the various manufacturers had great difficulties in making their products interoperable. 1.0 and 1.0B also had mandatory Bluetooth Hardware Device Address (BD_ADDR) transmission in the handshaking process, rendering anonymity impossible at a protocol level, which was a major setback for services planned to be used in Bluetooth environments, such as Consumerism.

What are Different Classes in Bluetooth?
Bluetooth is a radio standard and communications protocol primarily designed for low power consumption, with a short range (power class dependent: 1 meter, 10 meters, 100 meters) based around low-cost transceiver microchip in each device.

Bluetooth lets these devices communicate with each other when they are in range. The devices use a radio communications system, so they do not have to be in line of sight of each other, and can even be in other rooms, so long as the received power is high enough.

What are some of the uses of Bluetooth?
Depending on the Bluetooth profiles included on the device, Bluetooth technology has the capability to wirelessly synchronize and transfer data among devices. The Bluetooth audio capabilities can be used for headset and hands free applications. The exact functionality provided by a Bluetooth enabled device depends on the Bluetooth profiles included.

How does Bluetooth fit in with WiFi?
The 802.11b (WiFi) standard is commonly used for wireless networking. Bluetooth is not a competitor with 802.11b, but rather a complement to it. While 802.11b is generally a replacement for wired local area networking, Bluetooth is more commonly used as a replacement for cables between individual devices. Bluetooth is designed to link devices within a very short range (up to 33 feet ). Bluetooth is part of the 802.15 standard.

What is the history of Bluetooth?
Bluetooth was initiated by Ericsson, IBM, Intel, Nokia and Toshiba in early 1998. These companies later formed a special interest group known as the Bluetooth SIG. The Bluetooth 1.0 specifications were released on July 26, 1999, but the technology has only recently become inexpensive enough for widespread use.

What is it - a technology, a standard, an initiative, or a product?
Bluetooth wireless technology is a de facto standard, as well as a specification for small-form factor, low-cost, short range radio links between mobile PCs, mobile phones and other portable devices. The Bluetooth Special Interest Group is an industry group consisting of leaders in the telecommunications, computing, and networking industries that are driving development of the technology and bringing it to market

What is the range of Bluetooth transmitter/receivers?
Bluetooth is designed for very low power use, and the transmission range will only be 10m, about 30ft. High-powered Bluetooth devices will enable ranges up to 100m (300ft). Considering the design philosophy behind Bluetooth, even the 10m range is adequate for the purposes Bluetooth is intended for. Later versions of the Bluetooth spec may allow longer ranges.

Is Bluetooth an IEEE standard, like IEEE 802.11 and Ethernet?
Being an IEEE standard will be a big plus to widespread adoption of Bluetooth, and IEEE 802.15 working group for personal area networks (PAN) announced that they will be adopting Bluetooth as the IEEE 802.15 standard.

What types of companies are likely to adopt or promote Bluetooth technology?
Companies likely to adopt this technology include, but are not limited to, software developers, network vendors, silicon vendors, peripheral and camera manufacturers, mobile PC and handheld device manufacturers, consumer electronics manufacturers and more.

What companies are involved in the Bluetooth initiative?
Global technology leaders Ericsson, Nokia, IBM, Intel and Toshiba founded the Bluetooth SIG in 1998. These companies are now supported by over 1,000 other organizations with a wide range of expertise, including Widcomm, Inc.

Are different brands of Bluetooth products compatible?
Yes. They have to. The Bluetooth Logo Certification Program requires Bluetooth products to interoperate with products manufactured by other vendors; those products that don’t interoperate will not be allowed to use the Bluetooth logo.

Is Bluetooth practical for use with mobile devices?
Yes. One concern for mobile computing users is power consumption. Bluetooth radios are very low power, drawing as little as 0.3mA in standby mode and 30mA during sustained data transmissions. Bluetooth radios alternate among power-saving modes in which device activity is lowered to maximize the mobile power supply.

What kind of encryption will be used for Bluetooth security?
The Bluetooth specification 1.0 describes the link encryption algorithm as a stream cipher using 4 LFSR (linear feedback shift registers). The sum of the width of the LFSRs is 128, and the spec says “the effective key length is selectable between 8 and 128 bits”. This arrangement allows Bluetooth to be used in countries with regulations limiting encryption strength, and “facilitate a future upgrade path for the security without the need for a costly redesign of the algorithms and encryption hardware” according to the Bluetooth specification. Key generation and authentication seems to be using the 8-round SAFER+ encryption algorithm. The information available suggests that Bluetooth security will be adequate for most purposes; but users with higher security requirements will need to employ stronger algorithms to ensure the security of their data.

What is the range of Bluetooth transmitter/receivers?
Bluetooth is designed for very low power use, and the transmission range will only be 10m, about 30ft. High-powered Bluetooth devices will enable ranges up to 100m (300ft). Considering the design philosophy behind Bluetooth, even the 10m range is adequate for the purposes Bluetooth is intended for. Later versions of the Bluetooth spec may allow longer ranges.

What is the data throughput speed of a Bluetooth connection?
Bluetooth transfers data at a rate of 721 Kbps, which is from three to eight times the average speed of parallel and serial ports, respectively. This bandwidth is capable of transmitting voice, data, video and still images

Will Bluetooth and Wireless LAN (WLAN) interfere with each other?
No, both Bluetooth and WLAN can co-exist. Since Bluetooth devices use Frequency Hopping and most WLANs use Direct Sequence Spreading techniques they each appear as background noise to the other and should not cause any perceivable performance issues.

Will other RF (Radio Frequency) devices interfere with Bluetooth Devices?
No. Bluetooth radios operate on the unlicensed 2.4 GHz (Industrial, Scientific and Medical) frequency band that is shared among other devices (microwave ovens, cordless phones, garage door openers, etc. ). Bluetooth radios switch frequencies at such a rapid pace (1,600 times per second) and the data packets are so small that interference from other RF sources is highly unlikely. Bluetooth is a robust communication system.

Will other RF (Radio Frequency) devices interfere with Bluetooth Devices?
No. Bluetooth radios operate on the unlicensed 2.4 GHz (Industrial, Scientific and Medical) frequency band that is shared among other devices (microwave ovens, cordless phones, garage door openers, etc. ). Bluetooth radios switch frequencies at such a rapid pace (1,600 times per second) and the data packets are so small that interference from other RF sources is highly unlikely. Bluetooth is a robust communication system.

What is Frequency-Hopping Spread Spectrum (FHSS)?
Frequency-Hopping Spread-Spectrum (FHSS) is a spread spectrum modulation scheme that uses a narrowband carrier that changes frequency in a pattern known to both transmitter and receiver. Properly synchronized, they maintain a single logical channel. To an unintended receiver, FHSS appears as short-duration impulse noise. More simply, the data is broken down into packets and transmitted to the receiver of other devices over numerous “hop frequencies” (79 total) in a pseudo random pattern. Only transmitters and receivers that are synchronized on the same hop frequency pattern will have access to the transmitted data. The transmitter switches hop frequencies 1,600 times per second to assure a high degree of data security

What is Frequency-Hopping Spread Spectrum (FHSS)?
Frequency-Hopping Spread-Spectrum (FHSS) is a spread spectrum modulation scheme that uses a narrowband carrier that changes frequency in a pattern known to both transmitter and receiver. Properly synchronized, they maintain a single logical channel. To an unintended receiver, FHSS appears as short-duration impulse noise. More simply, the data is broken down into packets and transmitted to the receiver of other devices over numerous “hop frequencies” (79 total) in a pseudo random pattern. Only transmitters and receivers that are synchronized on the same hop frequency pattern will have access to the transmitted data. The transmitter switches hop frequencies 1,600 times per second to assure a high degree of data security

How secure is a Bluetooth network?
Bluetooth is extremely secure in that it employs several layers of data encryption and user authentication measures. Bluetooth devices use a combination of the Personal Identification Number (PIN) and a Bluetooth address to identify other Bluetooth devices. Data encryption (i.e., 128-bit) can be used to further enhance the degree of Bluetooth security. The transmission scheme (FHSS) provides another level of security in itself. Instead of transmitting over one frequency within the 2.4 GHz band, Bluetooth radios use a fast frequency-hopping spread spectrum (FHSS) technique, allowing only synchronized receivers to access the transmitted data

What is the future direction of the Bluetooth standard?
At this time, we anticipate the Bluetooth SIG to evolve the Bluetooth technology to provide greater bandwidth and distances, thus increasing the potential platforms and applications used in the emerging personal area networking marketplace.

How is Bluetooth used?
Bluetooth can be used to wirelessly synchronize and transfer data among devices. Bluetooth can be thought of as a cable replacement technology. Typical uses include automatically synchronizing contact and calendar information among desktop, notebook and palmtop computers without connecting cables. Bluetooth can also be used to access a network or the Internet with a notebook computer by connecting wirelessly to a cellular phone.

Do you Know about OBEX Protocol?
IrOBEX (shortly OBEX) is a session protocol developed by the Infrared Data Association (IrDA) to exchange objects in a simple and spontaneous manner. OBEX, which provides the same basic functionality as HTTP but in a much lighter fashion, uses a client-server model and is independent of the transport mechanism and transport API, provided it realizes a reliable transport base. Along with the protocol itself, the “grammar” for OBEX conversations between devices, OBEX also provides a model for representing objects and operations. In addition, the OBEX protocol defines a folder-listing object, which is used to browse the contents of folders on remote device. In the first phase, RFCOMM is used as sole transport layer for OBEX.

What is Service Discovery Protocol?
Discovery services are crucial part of the Bluetooth framework. These services provide the basis for all the usage models. Using SDP, device information, services and the characteristics of the services can be queried and after that, a connection between two or more Bluetooth devices can be established. SDP is defined in the Service Discovery Protocol specification.

What is Link Manager Protocol?
The link manager protocol is responsible for link set-up between Bluetooth devices. This includes setting up of security functions like authentication and encryption by generating, exchanging and checking of link and encryption keys and the control and negotiation of baseband packet sizes. Furthermore it controls the power modes and duty cycles of the Bluetooth radio device, and the connection states of a Bluetooth unit in a piconet.

Is it possible to connect multiple Bluetooth hubs?
No, only one hub can be used at a time with a computer. USB or Serial devices can be added.

List some Technology characteristic of Bluetooth?
Omni directional,
Adaptive output power to minimize interference,
Support Synchronous & asynchronous services,
Fast Frequency Hopping to avoid interference,
Short data packets to maximize capacity during interface.

What is the total number of masters and slaves in a piconet?
1 Master and 7 Slaves.

Under what frequency range does Bluetooth work?
2.45 GHz is the frequency range.

What is the frequency range used for Bluetooth in Europe and United States?
2402 MHz to 2480 MHz are the frequency ranges used in USA and Europe

What is the frequency range used for Bluetooth in Japan?
2472 to 2497 MHz is the frequency range used for Bluetooth in Japan.

What is Piconet?
A collection of devices connected through Bluetooth technology in an ad hoc fashion.

What is a Bluetooth dongle?
A device that hangs outside of a computer, or phone to provide Bluetooth connection.

Why can Bluetooth equipment integrate easily in TCP/IP network?
Because Bluetooth uses wireless LAN standards IEEE for data transmission.

Which method is used for Data transfer?
Asynchronous Connectionless (ACL) is Data transfer method in Bluetooth

Give a generic description of Bluetooth?
Bluetooth is a low-cost, short-range (RF) links between mobile PCs, mobile phones and other portable devices. Bluetooth can transmit through solid, non-metal objects.
What are Bluetooth profiles?
A profile is a description of how to use a specification to implement a particular function. The International Standards Organization (ISO) first came up with the idea of profiles. In Bluetooth, there are several profiles available and they are arranged in a hierarchical fashion. For example, in order to use the headset profile, a device must also include the lower level profiles such as the serial port and general access profiles.

How does Bluetooth use frequency hopping for security?
Bluetooth picks a random frequency out of 79 and then hops around the range about 1600 times per second.

Why is Bluetooth called a cable replacement technology?
Bluetooth technology allows the creation of Personal Area Networks without cables or wires that are usual in home networks.

Thursday, August 21, 2008

Python Interview Questions

1How do I parcel out work among a bunch of worker threads?
Use the Queue module to create a queue containing a list of jobs. The Queue class maintains a list of objects with .put(obj) to add an item to the queue and .get() to return an item. The class will take care of the locking necessary to ensure that each job is handed out exactly once.
Here's a trivial example:
import threading, Queue, time

# The worker thread gets jobs off the queue. When the queue is empty, it
# assumes there will be no more work and exits.
# (Realistically workers will run until terminated.)
def worker ():
print 'Running worker'
time.sleep(0.1)
while True:
try:
arg = q.get(block=False)
except Queue.Empty:
print 'Worker', threading.currentThread(),
print 'queue empty'
break
else:
print 'Worker', threading.currentThread(),
print 'running with argument', arg
time.sleep(0.5)

# Create queue
q = Queue.Queue()

# Start a pool of 5 workers
for i in range(5):
t = threading.Thread(target=worker, name='worker %i' % (i+1))
t.start()

# Begin adding work to the queue
for i in range(50):
q.put(i)

# Give threads time to run
print 'Main thread sleeping'
time.sleep(5)

When run, this will produce the following output:

Running worker Running worker Running worker Running worker Running worker Main thread sleeping Worker running with argument 0 Worker running with argument 1 Worker running with argument 2 Worker running with argument 3 Worker running with argument 4 Worker running with argument 5 ...

2How do I delete a file? (And other file questions...)
Use os.remove(filename) or os.unlink(filename);

3How do I copy a file?
The shutil module contains a copyfile() function.

4.How do I modify a string in place?
You can't, because strings are immutable. If you need an object with this ability, try converting the string to a list or use the array module:

>>> s = "Hello, world"
>>> a = list(s)
>>>print a
['H', 'e', 'l', 'l', 'o', ',', ' ', 'w', 'o', 'r', 'l', 'd']
>>> a[7:] = list("there!")
>>>''.join(a)
'Hello, there!'


>>> import array
>>> a = array.array('c', s)
>>> print a
array('c', 'Hello, world')
>>> a[0] = 'y' ; print a
array('c', 'yello world')
>>> a.tostring()
'yello, world'

5. How do I use strings to call functions/methods?
There are various techniques.

* The best is to use a dictionary that maps strings to functions. The primary advantage of this technique is that the strings do not need to match the names of the functions. This is also the primary technique used to emulate a case construct:

def a():
pass

def b():
pass

dispatch = {'go': a, 'stop': b} # Note lack of parens for funcs

dispatch[get_input()]() # Note trailing parens to call function
*
Use the built-in function getattr():

import foo
getattr(foo, 'bar')()

Note that getattr() works on any object, including classes, class instances, modules, and so on.

This is used in several places in the standard library, like this:

class Foo:
def do_foo(self):
...
def do_bar(self):
...

f = getattr(foo_instance, 'do_' + opname)
f()

*
Use locals() or eval() to resolve the function name:

def myFunc():
print "hello"

fname = "myFunc"

f = locals()[fname]
f()

f = eval(fname)
f()

Note: Using eval() is slow and dangerous. If you don't have absolute control over the contents of the string, someone could pass a string that resulted in an arbitrary function being executed.

6. Is there an equivalent to Perl's chomp() for removing trailing newlines from strings?
Starting with Python 2.2, you can use S.rstrip("\r\n") to remove all occurences of any line terminator from the end of the string S without removing other trailing whitespace. If the string S represents more than one line, with several empty lines at the end, the line terminators for all the blank lines will be removed:

>>> lines = ("line 1 \r\n"
... "\r\n"
... "\r\n")
>>> lines.rstrip("\n\r")
"line 1 "

Since this is typically only desired when reading text one line at a time, using S.rstrip() this way works well.

For older versions of Python, There are two partial substitutes:

* If you want to remove all trailing whitespace, use the rstrip() method of string objects. This removes all trailing whitespace, not just a single newline.
* Otherwise, if there is only one line in the string S, use S.splitlines()[0].

7. Why does os.path.isdir() fail on NT shared directories?
The solution appears to be always append the "\" on the end of shared drives.

>>> import os
>>>os.path.isdir( '\\\\rorschach\\public')
0
>>>os.path.isdir( '\\\\rorschach\\public\\')
1

It helps to think of share points as being like drive letters. Example:

k: is not a directory
k:\ is a directory
k:\media is a directory
k:\media\ is not a directory

The same rules apply if you substitute "k:" with "\conkyfoo":

\\conky\foo is not a directory
\\conky\foo\ is a directory
\\conky\foo\media is a directory
\\conky\foo\media\ is not a directory

Web Python
Some host providers only let you run CGI scripts in a certain directory, often named cgi-bin. In this case all you have to do to run the script is to call it like this:

http://my_server.tld/cgi-bin/my_script.py

The script will have to be made executable by "others". Give it a 755 permission or check the executable boxes if there is a graphical FTP interface.

Some hosts let you run CGI scripts in any directory. In some of these hosts you don't have to do anything do configure the directories. In others you will have to add these lines to a file named .htaccess in the directory you want to run CGI scripts from:

Options +ExecCGI
AddHandler cgi-script .py

If the file does not exist create it. All directories below a directory with a .htaccess file will inherit the configurations. So if you want to be able to run CGI scripts from all directories create this file in the document root.

To run a script saved at the root:

http://my_server.tld/my_script.py

If it was saved in some directory:

http://my_server.tld/some_dir/some_subdir/my_script.py

Make sure all text files you upload to the server are uploaded as text (not binary), specially if you are in Windows, otherwise you will have problems.

8.How can my code discover the name of an object?
Generally speaking, it can't, because objects don't really have names. Essentially, assignment always binds a name to a value; The same is true of def and class statements, but in that case the value is a callable. Consider the following code:

class A:
pass

B = A

a = B()
b = a
print b
<__main__.a>
print a
<__main__.a>

Arguably the class has a name: even though it is bound to two names and invoked through the name B the created instance is still reported as an instance of class A. However, it is impossible to say whether the instance's name is a or b, since both names are bound to the same value.

Generally speaking it should not be necessary for your code to "know the names" of particular values. Unless you are deliberately writing introspective programs, this is usually an indication that a change of approach might be beneficial.

In comp.lang.python, Fredrik Lundh once gave an excellent analogy in answer to this question:

The same way as you get the name of that cat you found on your porch: the cat (object) itself cannot tell you its name, and it doesn't really care -- so the only way to find out what it's called is to ask all your neighbours (namespaces) if it's their cat (object)...

....and don't be surprised if you'll find that it's known by many names, or no name at all!

9. Is there an equivalent of C's "?:" ternary operator?
No.

10. How do I convert a number to a string?
To convert, e.g., the number 144 to the string '144', use the built-in function str(). If you want a hexadecimal or octal representation, use the built-in functions hex() or oct(). For fancy formatting, use the % operator on strings, e.g. "%04d" % 144 yields '0144' and "%.3f" % (1/3.0) yields '0.333'. See the library reference manual for details.

11How do I read (or write) binary data?
or complex data formats, it's best to use the struct module. It allows you to take a string containing binary data (usually numbers) and convert it to Python objects; and vice versa.

For example, the following code reads two 2-byte integers and one 4-byte integer in big-endian format from a file:

import struct

f = open(filename, "rb") # Open in binary mode for portability
s = f.read(8)
x, y, z = struct.unpack(">hhl", s)


The '>' in the format string forces big-endian data; the letter 'h' reads one "short integer" (2 bytes), and 'l' reads one "long integer" (4 bytes) from the string.

12.How do I run a subprocess with pipes connected to both input and output?
Use the popen2 module. For example:

import popen2
fromchild, tochild = popen2.popen2("command")
tochild.write("input\n")
tochild.flush()
output = fromchild.readline()

13.How can I mimic CGI form submission (METHOD=POST)?
I would like to retrieve web pages that are the result of POSTing a form. Is there existing code that would let me do this easily?

Yes. Here's a simple example that uses httplib:

#!/usr/local/bin/python

import httplib, sys, time

### build the query string
qs = "First=Josephine&MI=Q&Last=Public"

### connect and send the server a path
httpobj = httplib.HTTP('www.some-server.out-there', 80)
httpobj.putrequest('POST', '/cgi-bin/some-cgi-script')
### now generate the rest of the HTTP headers...
httpobj.putheader('Accept', '*/*')
httpobj.putheader('Connection', 'Keep-Alive')
httpobj.putheader('Content-type', 'application/x-www-form-urlencoded')
httpobj.putheader('Content-length', '%d' % len(qs))
httpobj.endheaders()
httpobj.send(qs)
### find out what the server said in response...
reply, msg, hdrs = httpobj.getreply()
if reply != 200:
sys.stdout.write(httpobj.getfile().read())

Note that in general for URL-encoded POST operations, query strings must be quoted by using urllib.quote(). For example to send name="Guy Steele, Jr.":

>>> from urllib import quote
>>> x = quote("Guy Steele, Jr.")
>>> x
'Guy%20Steele,%20Jr.'
>>> query_string = "name="+x
>>> query_string
'name=Guy%20Steele,%20Jr.'

14. How do I emulate os.kill() in Windows?
Use win32api:

def kill(pid):
"""kill function for Win32"""
import win32api
handle = win32api.OpenProcess(1, 0, pid)
return (0 != win32api.TerminateProcess(handle, 0))

15. How do I call a method defined in a base class from a derived class that overrides it?
If you're using new-style classes, use the built-in super() function:

class Derived(Base):
def meth (self):
super(Derived, self).meth()

If you're using classic classes: For a class definition such as class Derived(Base): ... you can call method meth() defined in Base (or one of Base's base classes) as Base.meth(self, arguments...). Here, Base.meth is an unbound method, so you need to provide the self argument.

16. How can I organize my code to make it easier to change the base class?
You could define an alias for the base class, assign the real base class to it before your class definition, and use the alias throughout your class. Then all you have to change is the value assigned to the alias. Incidentally, this trick is also handy if you want to decide dynamically (e.g. depending on availability of resources) which base class to use. Example:

BaseAlias =
class Derived(BaseAlias):
def meth(self):
BaseAlias.meth(self)

17. How do I create static class data and static class methods?
Static data (in the sense of C++ or Java) is easy; static methods (again in the sense of C++ or Java) are not supported directly.

For static data, simply define a class attribute. To assign a new value to the attribute, you have to explicitly use the class name in the assignment:

class C:
count = 0 # number of times C.__init__ called

def __init__(self):
C.count = C.count + 1

def getcount(self):
return C.count # or return self.count

c.count also refers to C.count for any c such that isinstance(c, C) holds, unless overridden by c itself or by some class on the base-class search path from c.__class__ back to C.

Caution: within a method of C, an assignment like self.count = 42 creates a new and unrelated instance vrbl named "count" in self's own dict. Rebinding of a class-static data name must always specify the class whether inside a method or not:

C.count = 314

Static methods are possible when you're using new-style classes:

class C:
def static(arg1, arg2, arg3):
# No 'self' parameter!
...
static = staticmethod(static)

However, a far more straightforward way to get the effect of a static method is via a simple module-level function:

def getcount():
return C.count

If your code is structured so as to define one class (or tightly related class hierarchy) per module, this supplies the desired encapsulation.

18. How can I overload constructors (or methods) in Python?
This answer actually applies to all methods, but the question usually comes up first in the context of constructors.

In C++ you'd write

class C {
C() { cout << "No arguments\n"; } C(int i) { cout << "Argument is " << i="None):">

19. How do I use Python for CGI?
On the Microsoft IIS server or on the Win95 MS Personal Web Server you set up Python in the same way that you would set up any other scripting engine.

Run regedt32 and go to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\ScriptMap

and enter the following line (making any specific changes that your system may need):

.py :REG_SZ: c:\\python.exe -u %s %s

This line will allow you to call your script with a simple reference like: http://yourserver/scripts/yourscript.py provided "scripts" is an "executable" directory for your server (which it usually is by default). The "-u" flag specifies unbuffered and binary mode for stdin - needed when working with binary data.

In addition, it is recommended that using ".py" may not be a good idea for the file extensions when used in this context (you might want to reserve *.py for support modules and use *.cgi or *.cgp for "main program" scripts).

In order to set up Internet Information Services 5 to use Python for CGI processing, please see the following links:

http://www.e-coli.net/pyiis_server.html (for Win2k Server) http://www.e-coli.net/pyiis.html (for Win2k pro)

Configuring Apache is much simpler. In the Apache configuration file httpd.conf, add the following line at the end of the file:

ScriptInterpreterSource Registry

Then, give your Python CGI-scripts the extension .py and put them in the cgi-bin directory

Friday, August 15, 2008

Oracle SQL*Plus Statements


100. What are the types of SQL statement?
Data Definition Language: CREATE, ALTER, DROP, TRUNCATE, REVOKE, NO AUDIT & COMMIT.

Data Manipulation Language: INSERT, UPDATE, DELETE, LOCK TABLE, EXPLAIN PLAN & SELECT.

Transactional Control: COMMIT & ROLLBACK

Session Control: ALTERSESSION & SET ROLE

System Control: ALTER SYSTEM.

101. What is a transaction?

Transaction is logical unit between two commits and commit and rollback.

102. What is difference between TRUNCATE & DELETE?

TRUNCATE commits after deleting entire table i.e., cannot be rolled back.

Database triggers do not fire on TRUNCATE

DELETE allows the filtered deletion. Deleted records can be rolled back or committed.

Database triggers fire on DELETE.

103. What is a join? Explain the different types of joins?

Join is a query, which retrieves related columns or rows from multiple tables.

Self Join - Joining the table with itself.

Equi Join - Joining two tables by equating two common columns.

Non-Equi Join - Joining two tables by equating two common columns.

Outer Join - Joining two tables in such a way that query can also retrieve rows that do not have corresponding join value in the other table.

104. What is the sub-query?

Sub-query is a query whose return values are used in filtering conditions of the main query.

105. What is correlated sub-query?

Correlated sub-query is a sub-query, which has reference to the main query.

106. Explain CONNECT BY PRIOR?

Retrieves rows in hierarchical order eg.

select empno, ename from emp where.

107. Difference between SUBSTR and INSTR?

INSTR (String1, String2 (n, (m)),

INSTR returns the position of the m-th occurrence of the string 2 in string1. The search begins from nth position of string1.

SUBSTR (String1 n, m)

SUBSTR returns a character string of size m in string1, starting from n-th position of string1.

108. Explain UNION, MINUS, UNION ALL and INTERSECT?

INTERSECT - returns all distinct rows selected by both queries.

MINUS - returns all distinct rows selected by the first query but not by the second.

UNION - returns all distinct rows selected by either query

UNION ALL - returns all rows selected by either query, including all duplicates.

109. What is ROWID?

ROWID is a pseudo column attached to each row of a table. It is 18 characters long, blockno, rownumber are the components of ROWID.

110. What is the fastest way of accessing a row in a table?

Using ROWID.

CONSTRAINTS

111. What is an integrity constraint?

Integrity constraint is a rule that restricts values to a column in a table.

112. What is referential integrity constraint?

Maintaining data integrity through a set of rules that restrict the values of one or more columns of the tables based on the values of primary key or unique key of the referenced table.

113. What is the usage of SAVEPOINTS?

SAVEPOINTS are used to subdivide a transaction into smaller parts. It enables rolling back part of a transaction. Maximum of five save points are allowed.

114. What is ON DELETE CASCADE?

When ON DELETE CASCADE is specified Oracle maintains referential integrity by automatically removing dependent foreign key values if a referenced primary or unique key value is removed.

115. What are the data types allowed in a table?

CHAR, VARCHAR2, NUMBER, DATE, RAW, LONG and LONG RAW.

116. What is difference between CHAR and VARCHAR2? What is the maximum SIZE allowed for each type?

CHAR pads blank spaces to the maximum length.

VARCHAR2 does not pad blank spaces.

For CHAR the maximum length is 255 and 2000 for VARCHAR2.

117. How many LONG columns are allowed in a table? Is it possible to use LONG columns in WHERE clause or ORDER BY?

Only one LONG column is allowed. It is not possible to use LONG column in WHERE or ORDER BY clause.

118. What are the pre-requisites to modify datatype of a column and to add a column with NOT NULL constraint?

- To modify the datatype of a column the column must be empty.

- To add a column with NOT NULL constrain, the table must be empty.

119. Where the integrity constraints are stored in data dictionary?

The integrity constraints are stored in USER_CONSTRAINTS.

120. How will you activate/deactivate integrity constraints?

The integrity constraints can be enabled or disabled by ALTER TABLE ENABLE CONSTRAINT / DISABLE CONSTRAINT.

121. If unique key constraint on DATE column is created, will it validate the rows that are inserted with SYSDATE?

It won't, Because SYSDATE format contains time attached with it.

122. What is a database link?

Database link is a named path through which a remote database can be accessed.

123. How to access the current value and next value from a sequence? Is it possible to access the current value in a session before accessing next value?

Sequence name CURRVAL, sequence name NEXTVAL. It is not possible. Only if you access next value in the session, current value can be accessed.

124. What is CYCLE/NO CYCLE in a Sequence?

CYCLE specifies that the sequence continue to generate values after reaching either maximum or minimum value. After pan-ascending sequence reaches its maximum value, it generates its minimum value. After a descending sequence reaches its minimum, it generates its maximum.

NO CYCLE specifies that the sequence cannot generate more values after reaching its maximum or minimum value.

125. What are the advantages of VIEW?

- To protect some of the columns of a table from other users.

- To hide complexity of a query.

- To hide complexity of calculations.

126. Can a view be updated/inserted/deleted? If Yes - under what conditions?

A View can be updated/deleted/inserted if it has only one base table if the view is based on columns from one or more tables then insert, update and delete is not possible.

127. If a view on a single base table is manipulated will the changes be reflected on the base table?

If changes are made to the tables and these tables are the base tables of a view, then the changes will be reference on the view.

Oracle Database Logical & Physical Architecture


64. What is Database Buffers?

Database buffers are cache in the SGA used to hold the data blocks that are read from the data segments in the database such as tables, indexes and clusters DB_BLOCK_BUFFERS parameter in INIT.ORA decides the size.

65. What is dictionary cache?

Dictionary cache is information about the database objects stored in a data dictionary table.

66. What is meant by recursive hints?

Number of times processes repeatedly query the dictionary table is called recursive hints. It is due to the data dictionary cache is too small. By increasing the SHARED_POOL_SIZE parameter we can optimize the size of data dictionary cache.

67. What is redo log buffer?

Changes made to the records are written to the on-line redo log files. So that they can be used in roll forward operations during database recoveries. Before writing them into the redo log files, they will first brought to redo log buffers in SGA and LGWR will write into files frequently. LOG_BUFFER parameter will decide the size.

68. How will you swap objects into a different table space for an existing database?

- Export the user

- Perform import using the command imp system/manager file=export.dmp indexfile=newrite.sql. This will create all definitions into newfile.sql.

- Drop necessary objects.

- Run the script newfile.sql after altering the tablespaces.

- Import from the backup for the necessary objects.

69. List the Optional Flexible Architecture (OFA) of Oracle database? How can we organize the tablespaces in Oracle database to have maximum performance?

SYSTEM - Data dictionary tables.

DATA - Standard operational tables.

DATA2- Static tables used for standard operations

INDEXES - Indexes for Standard operational tables.

INDEXES1 - Indexes of static tables used for standard operations.

TOOLS - Tools table.

TOOLS1 - Indexes for tools table.

RBS - Standard Operations Rollback Segments,

RBS1,RBS2 - Additional/Special Rollback segments.

TEMP - Temporary purpose tablespace

TEMP_USER - Temporary tablespace for users.

USERS - User tablespace.

70. How will you force database to use particular rollback segment?

SET TRANSACTION USE ROLLBACK SEGMENT rbs_name.

71. What is meant by free extent?

A free extent is a collection of continuous free blocks in tablespace. When a segment is dropped its extents are reallocated and are marked as free.

72.Which parameter in Storage clause will reduce number of rows per block?

PCTFREE parameter

Row size also reduces no of rows per block.

73. What is the significance of having storage clause?

We can plan the storage for a table as how much initial extents are required, how much can be extended next, how much % should leave free for managing row updating, etc.,

74. How does Space allocation table place within a block?

Each block contains entries as follows

Fixed block header

Variable block header

Row Header, row date (multiple rows may exists)

PCTEREE (% of free space for row updating in future)

75. What is the role of PCTFREE parameter is storage clause?

This is used to reserve certain amount of space in a block for expansion of rows.

76. What is the OPTIMAL parameter?

It is used to set the optimal length of a rollback segment.

77. What is the functionality of SYSTEM table space?

To manage the database level transactions such as modifications of the data dictionary table that record information about the free space usage.

78. How will you create multiple rollback segments in a database?

- Create a database, which implicitly creates a SYSTEM rollback segment in a SYSTEM tablespace.

- Create a second rollback segment name R0 in the SYSTEM tablespace.

- Make new rollback segment available (after shutdown, modify init.ora file and start database)

- Create other tablespaces (RBS) for rollback segments.

- Deactivate rollback segment R0 and activate the newly created rollback segments.

79. How the space utilization takes place within rollback segments?

It will try to fit the transaction in a cyclic fashion to all existing extents. Once it found an extent is in use then it forced to acquire a new extent (number of extents is based on the optimal size)

80. Why query fails sometimes?

Rollback segment dynamically extent to handle larger transactions entry loads.

A single transaction may wipeout all available free space in the rollback segment tablespace. This prevents other user using rollback segments.

81. How will you monitor the space allocation?

By querying DBA_SEGMENT table/view

82. How will you monitor rollback segment status?

Querying the DBA_ROLLBACK_SEGS view

IN USE - Rollback Segment is on-line.

AVAILABLE - Rollback Segment available but not on-line.

OFF-LINE - Rollback Segment off-line

INVALID - Rollback Segment Dropped.

NEEDS RECOVERY - Contains data but need recovery or corrupted.

PARTLY AVAILABLE - Contains data from an unresolved transaction involving a

distributed database.

83. List the sequence of events when a large transaction that exceeds beyond its optimal value when an entry wraps and causes the rollback segment to expand into another extend.

Transaction Begins.

An entry is made in the RES header for new transactions entry

Transaction acquires blocks in an extent of RBS

The entry attempts to wrap into second extent. None is available, so that the RBS must extent.

The RBS checks to see if it is part of its OPTIMAL size.

RBS chooses its oldest inactive segment.

Oldest inactive segment is eliminated.

RBS extents

The data dictionary tables for space management are updated.

Transaction Completes.

84. How can we plan storage for very large tables?

Limit the number of extents in the table

Separate table from its indexes.

Allocate sufficient temporary storage.

85. How will you estimate the space required by a non-clustered tables?

Calculate the total header size

Calculate the available data space per data block

Calculate the combined column lengths of the average row

Calculate the total average row size.

Calculate the average number rows that can fit in a block

Calculate the number of blocks and bytes required for the table.

After arriving the calculation, add 10 % additional space to calculate the initial extent size for a working table.

86. It is possible to use raw devices as data files and what are the advantages over file system files?

Yes.

The advantages over file system files are that I/O will be improved because Oracle is bye-passing the kernel which writing into disk. Disk corruption will be very less.

87. What is a Control file?

Database's overall physical architecture is maintained in a file called control file. It will be used to maintain internal consistency and guide recovery operations. Multiple copies of control files are advisable.

88. How to implement the multiple control files for an existing database?

Shutdown the database

Copy one of the existing controlfile to new location

Edit Config ora file by adding new control filename

Restart the database.

89. What is redo log file mirroring? How can be achieved?

Process of having a copy of redo log files is called mirroring.

This can be achieved by creating group of log files together, so that LGWR will automatically writes them to all the members of the current on-line redo log group. If any one group fails then database automatically switch over to next group. It degrades performance.

90. What is advantage of having disk shadowing / mirroring?

Shadow set of disks save as a backup in the event of disk failure. In most operating systems if any disk failure occurs it automatically switchover to place of failed disk.

Improved performance because most OS support volume shadowing can direct file I/O request to use the shadow set of files instead of the main set of files. This reduces I/O load on the main set of disks.

91. What is use of rollback segments in Oracle database?

They allow the database to maintain read consistency between multiple transactions.

92. What is a rollback segment entry?

It is the set of before image data blocks that contain rows that are modified by a transaction.

Each rollback segment entry must be completed within one rollback segment.

A single rollback segment can have multiple rollback segment entries.

93. What is hit ratio?

It is a measure of well the data cache buffer is handling requests for data.

Hit Ratio = (Logical Reads - Physical Reads - Hits Misses)/ Logical Reads.

94. When will be a segment released?

When Segment is dropped.

When Shrink (RBS only)

When truncated (TRUNCATE used with drop storage option)

95. What are disadvantages of having raw devices?

We should depend on export/import utility for backup/recovery (fully reliable)

The tar command cannot be used for physical file backup, instead we can use dd command, which is less flexible and has limited recoveries.

96. List the factors that can affect the accuracy of the estimations?

- The space used transaction entries and deleted records, does not become free immediately after completion due to delayed cleanout.

- Trailing nulls and length bytes are not stored.

- Inserts of, updates to and deletes of rows as well as columns larger than a single data block, can cause fragmentation a chained row pieces.

Database Security & Administration

97. What is user Account in Oracle database?

A user account is not a physical structure in database but it is having important relationship to the objects in the database and will be having certain privileges.

98. How will you enforce security using stored procedures?

Don't grant user access directly to tables within the application.

Instead grant the ability to access the procedures that access the tables.

When procedure executed it will execute the privilege of procedures owner. Users cannot access tables except via the procedure.

99. What are the dictionary tables used to monitor a database space?

DBA_FREE_SPACE

DBA_SEGMENTS

DBA_DATA_FILES.

Oracle Memory Management


59. What is SGA?

The System Global Area in an Oracle database is the area in memory to facilitate the transfer of information between users. It holds the most recently requested structural information between users. It holds the most recently requested structural information about the database. The structure is database buffers, dictionary cache, redo log buffer and shared pool area.

60. What is a shared pool?

The data dictionary cache is stored in an area in SGA called the shared pool. This will allow sharing of parsed SQL statements among concurrent users.

61. What is mean by Program Global Area (PGA)?

It is area in memory that is used by a single Oracle user process.

62. What is a data segment?

Data segment are the physical areas within a database block in which the data associated with tables and clusters are stored.

63. What are the factors causing the reparsing of SQL statements in SGA?

Due to insufficient shared pool size.

Monitor the ratio of the reloads takes place while executing SQL statements. If the ratio is greater than 1 then increase the SHARED_POOL_SIZE.

Oracle Data Base Administration


51. What is a database instance? Explain.

A database instance (Server) is a set of memory structure and background processes that access a set of database files. The processes can be shared by all of the users.

The memory structure that is used to store the most queried data from database. This helps up to improve database performance by decreasing the amount of I/O performed against data file.

52. What is Parallel Server?

Multiple instances accessing the same database (only in multi-CPU environments)

53. What is a schema?

The set of objects owned by user account is called the schema.

54. What is an index? How it is implemented in Oracle database?

An index is a database structure used by the server to have direct access of a row in a table. An index is automatically created when a unique of primary key constraint clause is specified in create table command

55. What are clusters?

Group of tables physically stored together because they share common columns and are often used together is called cluster.

56. What is a cluster key?

The related columns of the tables are called the cluster key. The cluster key is indexed using a cluster index and its value is stored only once for multiple tables in the cluster.

57. What are the basic element of base configuration of an Oracle database?

It consists of

one or more data files.

one or more control files.

two or more redo log files.

The Database contains

multiple users/schemas

one or more rollback segments

one or more tablespaces

Data dictionary tables

User objects (table,indexes,views etc.,)

The server that access the database consists of

SGA (Database buffer, Dictionary Cache Buffers, Redo log buffers, Shared SQL pool)

SMON (System MONito)

PMON (Process MONitor)

LGWR (LoG Write)

DBWR (Data Base Write)

ARCH (ARCHiver)

CKPT (Check Point)

RECO

Dispatcher

User Process with associated PGS

58. What is a deadlock? Explain.

Two processes waiting to update the rows of a table, which are locked by other processes then deadlock arises.

In a database environment this will often happen because of not issuing the proper row lock commands. Poor design of front-end application may cause this situation and the performance of server will reduce drastically.

These locks will be released automatically when a commit/rollback operation performed or any one of this processes being killed externally.

Oracle Concepts and Architecture Database StructuresOracle Concepts and Architecture Database Structures


1. What are the components of physical database structure of Oracle database?

Oracle database is comprised of three types of files. One or more datafiles, two are more redo log files, and one or more control files.

2. What are the components of logical database structure of Oracle database?

There are tablespaces and database's schema objects.

3. What is a tablespace?

A database is divided into Logical Storage Unit called tablespaces. A tablespace is used to grouped related logical structures together.

4. What is SYSTEM tablespace and when is it created?

Every Oracle database contains a tablespace named SYSTEM, which is automatically created when the database is created. The SYSTEM tablespace always contains the data dictionary tables for the entire database.

5. Explain the relationship among database, tablespace and data file.

Each databases logically divided into one or more tablespaces one or more data files are explicitly created for each tablespace.

6. What is schema?

A schema is collection of database objects of a user.

7. What are Schema Objects?

Schema objects are the logical structures that directly refer to the database's data. Schema objects include tables, views, sequences, synonyms, indexes, clusters, database triggers, procedures, functions packages and database links.

8. Can objects of the same schema reside in different tablespaces?

Yes.

9. Can a tablespace hold objects from different schemes?

Yes.

10. What is Oracle table?

A table is the basic unit of data storage in an Oracle database. The tables of a database hold all of the user accessible data. Table data is stored in rows and columns.

11. What is an Oracle view?

A view is a virtual table. Every view has a query attached to it. (The query is a SELECT statement that identifies the columns and rows of the table(s) the view uses.)

12. Do a view contain data?

Views do not contain or store data.

13. Can a view based on another view?

Yes.

14. What are the advantages of views?

- Provide an additional level of table security, by restricting access to a predetermined set of rows and columns of a table.

- Hide data complexity.

- Simplify commands for the user.

- Present the data in a different perspective from that of the base table.

- Store complex queries.

15. What is an Oracle sequence?

A sequence generates a serial list of unique numbers for numerical columns of a database's tables.

16. What is a synonym?

A synonym is an alias for a table, view, sequence or program unit.

17. What are the types of synonyms?

There are two types of synonyms private and public.

18. What is a private synonym?

Only its owner can access a private synonym.

19. What is a public synonym?

Any database user can access a public synonym.

20. What are synonyms used for?

- Mask the real name and owner of an object.

- Provide public access to an object

- Provide location transparency for tables, views or program units of a remote database.

- Simplify the SQL statements for database users.

21. What is an Oracle index?

An index is an optional structure associated with a table to have direct access to rows, which can be created to increase the performance of data retrieval. Index can be created on one or more columns of a table.

22. How are the index updates?

Indexes are automatically maintained and used by Oracle. Changes to table data are automatically incorporated into all relevant indexes.

23. What are clusters?

Clusters are groups of one or more tables physically stores together to share common columns and are often used together.

24. What is cluster key?

The related columns of the tables in a cluster are called the cluster key.

25. What is index cluster?

A cluster with an index on the cluster key.

26. What is hash cluster?

A row is stored in a hash cluster based on the result of applying a hash function to the row's cluster key value. All rows with the same hash key value are stores together on disk.

27. When can hash cluster used?

Hash clusters are better choice when a table is often queried with equality queries. For such queries the specified cluster key value is hashed. The resulting hash key value points directly to the area on disk that stores the specified rows.

28. What is database link?

A database link is a named object that describes a "path" from one database to another.

29. What are the types of database links?

Private database link, public database link & network database link.

30. What is private database link?

Private database link is created on behalf of a specific user. A private database link can be used only when the owner of the link specifies a global object name in a SQL statement or in the definition of the owner's views or procedures.

31. What is public database link?

Public database link is created for the special user group PUBLIC. A public database link can be used when any user in the associated database specifies a global object name in a SQL statement or object definition.

32. What is network database link?

Network database link is created and managed by a network domain service. A network database link can be used when any user of any database in the network specifies a global object name in a SQL statement or object definition.

33. What is data block?

Oracle database's data is stored in data blocks. One data block corresponds to a specific number of bytes of physical database space on disk.

34. How to define data block size?

A data block size is specified for each Oracle database when the database is created. A database users and allocated free database space in Oracle data blocks. Block size is specified in init.ora file and cannot be changed latter.

35. What is row chaining?

In circumstances, all of the data for a row in a table may not be able to fit in the same data block. When this occurs, the data for the row is stored in a chain of data block (one or more) reserved for that segment.

36. What is an extent?

An extent is a specific number of contiguous data blocks, obtained in a single allocation and used to store a specific type of information.

37. What is a segment?

A segment is a set of extents allocated for a certain logical structure.

38. What are the different types of segments?

Data segment, index segment, rollback segment and temporary segment.

39. What is a data segment?

Each non-clustered table has a data segment. All of the table's data is stored in the extents of its data segment. Each cluster has a data segment. The data of every table in the cluster is stored in the cluster's data segment.

40. What is an index segment?

Each index has an index segment that stores all of its data.

41. What is rollback segment?

A database contains one or more rollback segments to temporarily store "undo" information.

42. What are the uses of rollback segment?

To generate read-consistent database information during database recovery and to rollback uncommitted transactions by the users.

43. What is a temporary segment?

Temporary segments are created by Oracle when a SQL statement needs a temporary work area to complete execution. When the statement finishes execution, the temporary segment extents are released to the system for future use.

44. What is a datafile?

Every Oracle database has one or more physical data files. A database's data files contain all the database data. The data of logical database structures such as tables and indexes is physically stored in the data files allocated for a database.

45. What are the characteristics of data files?

A data file can be associated with only one database. Once created a data file can't change size. One or more data files form a logical unit of database storage called a tablespace.

46. What is a redo log?

The set of redo log files for a database is collectively known as the database redo log.

47. What is the function of redo log?

The primary function of the redo log is to record all changes made to data.

48. What is the use of redo log information?

The information in a redo log file is used only to recover the database from a system or media failure prevents database data from being written to a database's data files.

49. What does a control file contains?

- Database name

- Names and locations of a database's files and redolog files.

- Time stamp of database creation.

50. What is the use of control file?

When an instance of an Oracle database is started, its control file is used to identify the database and redo log files that must be opened for database operation to proceed. It is also used in database recovery.


Software Testing

Software Testing

Software testing is the process of checking software, to verify that it satisfies its requirements and to detect errors.

Software testing is an empirical investigation conducted to provide stakeholders with information about the quality of the product or service under test, with respect to the context in which it is intended to operate. This includes, but is not limited to, the process of executing a program or application with the intent of finding software bugs.

Quality is not an absolute; it is value to some person. With that in mind, testing can never completely establish the correctness of arbitrary computer software; testing furnishes a criticism or comparison that compares the state and behaviour of the product against a specification. An important point is that software testing should be distinguished from the separate discipline of Software Quality Assurance (S.Q.A.), which encompasses all business process areas, not just testing.

Over its existence, computer software has continued to grow in complexity and size. Every software product has a target audience. For example, the audience for video game software is completely different from banking software. Therefore, when an organization develops or otherwise invests in a software product, it presumably must assess whether the software product will be acceptable to its end users, its target audience, its purchasers, and other stakeholders. Software testing is the process of attempting to make this assessment.

A study conducted by NIST in 2002 reports that software bugs cost the U.S. economy $59.5 billion annually. More than a third of this cost could be avoided if better software testing was performed.

Scope
A primary purpose for testing is to detect software failures so that defects may be uncovered and corrected. This is a non-trivial pursuit. Testing cannot establish that a product functions properly under all conditions but can only establish that it does not function properly under specific conditions.] The scope of software testing often includes examination of code as well as execution of that code in various environments and conditions as well as examining the quality aspects of code: does it do what it is supposed to do and do what it needs to do. In the current culture of software development, a testing organization may be separate from the development team. There are various roles for testing team members. Information derived from software testing may be used to correct the process by which software is developed.


Defects and failures
The software faults occur through the following process. A programmer makes an error (mistake), which results in a defect (fault, bug) in the software source code. If this defect is executed, in certain situations the system will produce wrong results, causing a failure.] Not all defects will necessarily result in failures. For example, defects in dead code will never result in failures. A defect can turn into a failure when the environment is changed. Examples of these changes in environment include the software being run on a new hardware platform, alterations in source data or interacting with different software.] A single defect may result in a wide range of failure symptoms.


Input combinations and preconditions
A problem with software testing is that testing under all combinations of inputs and preconditions (initial state) is not feasible, even with a simple product.]] This means that the number of defects in a software product can be very large and defects that occur infrequently are difficult to find in testing. More significantly, parafunctional dimensions of quality (how it is supposed to be versus what it is supposed to do) -- for example, usability, scalability, performance, compatibility, reliability -- can be highly subjective; something that constitutes sufficient value to one person may be intolerable to another.


Static vs. dynamic testing
There are many approaches to software testing. Reviews, walkthroughs or inspections are considered as static testing, whereas actually executing programmed code with a given set of test cases is referred to as dynamic testing.


Software verification and validation
Software testing is used in association with verification and validation:]

Verification: Have we built the software right (i.e., does it match the specification)?
Validation: Have we built the right software (i.e., is this what the customer wants)?

The software testing team
Software testing can be done by software testers. Until the 1950s the term "software tester" was used generally, but later it was also seen as a separate profession. Regarding the periods and the different goals in software testing] there have been established different roles: test lead/manager, test designer, tester, test automater/automation developer, and test administrator.


Software Quality Assurance (SQA)
Thought controversial], software testing may be viewed as an important part of the software quality assurance (SQA) process.[citation needed] In SQA, software process specialists and auditors take a broader view on software and its development. They examine and change the software engineering process itself to reduce the amount of faults that end up in defect rate. What constitutes an acceptable defect rate depends on the nature of the software. An arcade video game designed to simulate flying an airplane would presumably have a much higher tolerance for defects than mission critical software such as that used to control the functions of an airliner. Although there are close links with SQA, testing departments often exist independently, and there may be no SQA function in some companies.


History
The separation of debugging from testing was initially introduced by Glenford J. Myers in 1979.[8] Although his attention was on breakage testing, it illustrated the desire of the software engineering community to separate fundamental development activities, such as debugging, from that of verification. Dr. Dave Gelperin and Dr. William C. Hetzel classified in 1988 the phases and goals in software testing in the following stages:[9]

Until 1956 - Debugging oriented0]
1957-1978 - Demonstration oriented
1979-1982 - Destruction oriented
1983-1987 - Evaluation oriented
1988-2000 - Prevention oriented

Testing methods
Software testing methods are traditionally divided into black box testing and white box testing. These two approaches are used to describe the point of view that a test engineer takes when designing test cases.


Black box testing
Black box testing treats the software as a black-box without any understanding of internal behavior. It aims to test the functionality according to the requirements. Thus, the tester inputs data and only sees the output from the test object. This level of testing usually requires thorough test cases to be provided to the tester who then can simply verify that for a given input, the output value (or behavior), is the same as the expected value specified in the test case. Black box testing methods include: equivalence partitioning, boundary value analysis, all-pairs testing, fuzz testing, model-based testing, traceability matrix etc.


White box testing
White box testing, however, is when the tester has access to the internal data structures, code, and algorithms.


Types of white box testing
The following types of white box testing exist:

code coverage - creating tests to satisfy some criteria of code coverage. For example, the test designer can create tests to cause all statements in the program to be executed at least once.
mutation testing methods.
fault injection methods.
static testing - White box testing includes all static testing.

Code completeness evaluation
White box testing methods can also be used to evaluate the completeness of a test suite that was created with black box testing methods. This allows the software team to examine parts of a system that are rarely tested and ensures that the most important function points have been tested.

Two common forms of code coverage are:

function coverage, which reports on functions executed
and statement coverage, which reports on the number of lines executed to complete the test.
They both return a coverage metric, measured as a percentage.


Grey Box Testing
In recent years the term grey box testing has come into common usage. This involves having access to internal data structures and algorithms for purposes of designing the test cases, but testing at the user, or black-box level.

Manipulating input data and formatting output do not qualify as grey-box because the input and output are clearly outside of the black-box we are calling the software under test. This is particularly important when conducting integration testing between two modules of code written by two different developers, where only the interfaces are exposed for test. Grey box testing may also include reverse engineering to determine, for instance, boundary values.


Non Functional Software Testing
Special methods exist to test non-functional aspects of software.

Performance testing checks to see if the software can handle large quantities of data or users.
Usability testing is needed to check if the user interface is easy to use and understand.
Security testing is essential for software which processes confidential data and to prevent system intrusion by hackers.
internationalization and localization is needed to test these aspects of software, for which a pseudolocalization method can be used.

Testing process
A common practice of software testing is performed by an independent group of testers after the functionality is developed before it is shipped to the customer. This practice often results in the testing phase being used as project buffer to compensate for project delays, thereby compromising the time devoted to testing.8] Another practice is to start software testing at the same moment the project starts and it is a continuous process until the project finishes.9]

In counterpoint, some emerging software disciplines such as extreme programming and the agile software development movement, adhere to a "test-driven software development" model. In this process unit tests are written first, by the software engineers (often with pair programming in the extreme programming methodology). Of course these tests fail initially; as they are expected to. Then as code is written it passes incrementally larger portions of the test suites. The test suites are continuously updated as new failure conditions and corner cases are discovered, and they are integrated with any regression tests that are developed. Unit tests are maintained along with the rest of the software source code and generally integrated into the build process (with inherently interactive tests being relegated to a partially manual build acceptance process).

Testing can be done on the following levels:

Unit testing tests the minimal software component, or module. Each unit (basic component) of the software is tested to verify that the detailed design for the unit has been correctly implemented. In an object-oriented environment, this is usually at the class level, and the minimal unit tests include the constructors and destructors.0]
Integration testing exposes defects in the interfaces and interaction between integrated components (modules). Progressively larger groups of tested software components corresponding to elements of the architectural design are integrated and tested until the software works as a system.
System testing tests a completely integrated system to verify that it meets its requirements.
System integration testing verifies that a system is integrated to any external or third party systems defined in the system requirements.[citation needed]
Before shipping the final version of software, alpha and beta testing are often done additionally:

Alpha testing is simulated or actual operational testing by potential users/customers or an independent test team at the developers' site. Alpha testing is often employed for off-the-shelf software as a form of internal acceptance testing, before the software goes to beta testing.[citation needed]
Beta testing comes after alpha testing. Versions of the software, known as beta versions, are released to a limited audience outside of the programming team. The software is released to groups of people so that further testing can ensure the product has few faults or bugs. Sometimes, beta versions are made available to the open public to increase the feedback field to a maximal number of future users.[citation needed]
Finally, acceptance testing can be conducted by the end-user, customer, or client to validate whether or not to accept the product. Acceptance testing may be performed as part of the hand-off process between any two phases of development.[citation needed]


Regression testing
Main article: Regression testing
After modifying software, either for a change in functionality or to fix defects, a regression test re-runs previously passing tests on the modified software to ensure that the modifications haven't unintentionally caused a regression of previous functionality. Regression testing can be performed at any or all of the above test levels. These regression tests are often automated.

More specific forms of regression testing are known as sanity testing, when quickly checking for bizarre behaviour, and smoke testing when testing for basic functionality.


Finding faults early
It is commonly believed that the earlier a defect is found the cheaper it is to fix it. The following table shows the cost of fixing the defect depending on the stage it was found. For example, if a problem in requirements is found only post-release, then it would cost 10-100 times more to fix it comparing to the cost if the same fault was already found by the requirements review.

Time Introduced Time Detected
Requirements Architecture Construction System Test Post-Release
Requirements 1 3 5-10 10 10-100
Architecture - 1 10 15 25-100
Construction - - 1 10 10-25


Measuring software testing
Usually, quality is constrained to such topics as correctness, completeness, security,[citation needed] but can also include more technical requirements as described under the ISO standard ISO 9126, such as capability, reliability, efficiency, portability, maintainability, compatibility, and usability.

There are a number of common software measures, often called "metrics", which are used to measure the state of the software or the adequacy of the testing.

Test case
A test case is a software testing document, which consists of event, action, input, output, expected result, and actual result. Clinically defined a test case is an input and an expected result. This can be as pragmatic as 'for condition x your derived result is y', whereas other test cases described in more detail the input scenario and what results might be expected. It can occasionally be a series of steps (but often steps are contained in a separate test procedure that can be exercised against multiple test cases, as a matter of economy) but with one expected result or expected outcome. The optional fields are a test case ID, test step or order of execution number, related requirement(s), depth, test category, author, and check boxes for whether the test is automatable and has been automated. Larger test cases may also contain prerequisite states or steps, and descriptions. A test case should also contain a place for the actual result. These steps can be stored in a word processor document, spreadsheet, database, or other common repository. In a database system, you may also be able to see past test results and who generated the results and the system configuration used to generate those results. These past results would usually be stored in a separate table.


Test script
The test script is the combination of a test case, test procedure, and test data. Initially the term was derived from the product of work created by automated regression test tools. Today, test scripts can be manual, automated, or a combination of both.


Test suite
The most common term for a collection of test cases is a test suite. The test suite often also contains more detailed instructions or goals for each collection of test cases. It definitely contains a section where the tester identifies the system configuration used during testing. A group of test cases may also contain prerequisite states or steps, and descriptions of the following tests.


Test plan
A test specification is called a test plan. The developers are well aware what test plans will be executed and this information is made available to the developers. This makes the developers more cautious when developing their code. This ensures that the developers code is not passed through any surprise test case or test plans.


Test harness
The software, tools, samples of data input and output, and configurations are all referred to collectively as a test harness.


A sample testing cycle
Although variations exist between organizations, there is a typical cycle for testing:

Requirements analysis: Testing should begin in the requirements phase of the software development life cycle. During the design phase, testers work with developers in determining what aspects of a design are testable and with what parameters those tests work.
Test planning: Test strategy, test plan, testbed creation. A lot of activities will be carried out during testing, so that a plan is needed.
Test development: Test procedures, test scenarios, test cases, test scripts to use in testing software.
Test execution: Testers execute the software based on the plans and tests and report any errors found to the development team.
Test reporting: Once testing is completed, testers generate metrics and make final reports on their test effort and whether or not the software tested is ready for release.
Test result analysis: Or Defect Analysis, is done by the development team usually along with the client, in order to decide what defects should be treated, fixed, rejected (i.e. found software working properly) or deferred to be dealt with at a later time.
Retesting the resolved defects. Once a defect has been dealt with by the development team, it is retested by the testing team.
Regression testing: It is common to have a small test program built of a subset of tests, for each integration of new, modified or fixed software, in order to ensure that the latest delivery has not ruined anything, and that the software product as a whole is still working correctly.

Controversy
Main article: Software testing controversies
Some of the major controversies include:

What constitutes responsible software testing? - Members of the "context-driven" school of testing believe that there are no "best practices" of testing, but rather that testing is a set of skills that allow the tester to select or invent testing practices to suit each unique situation. 8]
Agile vs. traditional - Should testers learn to work under conditions of uncertainty and constant change or should they aim at process "maturity"? The agile testing movement has received growing popularity since 2006 mainly in commercial circles 9], whereas government and military software providers are slow to embrace this methodology, and mostly still hold to CMM.0]
Exploratory vs. scripted - Should tests be designed at the same time as they are executed or should they be designed beforehand?
Manual vs. automated - Some writers believe that test automation is so expensive relative to its value that it should be used sparingly. Others, such as advocates of agile development, recommend automating 100% of all tests.
Software design vs. software implementation - Should testing be carried out only at the end or throughout the whole process?
Who watches the watchmen? - The idea is that any form of observation is also an interaction, that the act of testing can also affect that which is being tested.

Certification
Several certification programs exist to support the professional aspirations of software testers and quality assurance specialists. No certification currently offered actually requires the applicant to demonstrate the ability to test software. No certification is based on a widely accepted body of knowledge. This has led some to declare that the testing field is not ready for certification. Certification itself cannot measure an individual's productivity, their skill, or practical knowledge, and cannot guarantee their competence, or professionalism as a tester.


Software testing certification types
Certifications can be grouped into: exam-based and education-based.

Exam-based certifications: For these there is the need to pass an exam, which can also be learned by self-study: e.g. for ISTQB or QAI.
Education-based certifications: Education based software testing certifications are instructor-led sessions, where each course has to be passed, e.g. IIST (International Institute for Software Testing).

Testing certifications
Certified Software Tester (CSTE) offered by the Quality Assurance Institute (QAI)
Certified Software Test Professional (CSTP) offered by the International Institute for Software Testing8]
[[CSTP (TM)]] (Australian Version) offered by K. J. Ross & Associates9]
CATe offered by the International Institute for Software Testing0]
ISEB offered by the Information Systems Examinations Board
Certified Tester, Foundation Level (CTFL) offered by the International Software Testing Qualification Board
Certified Tester, Advanced Level (CTAL) offered by the International Software Testing Qualification Board
CBTS offered by the Brazilian Certification of Software Testing (ALATS)

Quality assurance certifications
CSQE offered by the American Society for Quality (ASQ)
CSQA offered by the Quality Assurance Institute (QAI)

See also
Dynamic program analysis
Formal verification
Reverse Semantic Traceability
Static code analysis
GUI software testing
Web testing

Software Testing Interview Questions

Software Testing Interview Questions

Q: What if the application has functionality that wasn't
in the requirements?
A: It may take serious effort to determine if an application has significant
unexpected or hidden functionality, which it would indicate deeper problems in
the software development process. If the functionality isn't necessary to the
purpose of the application, it should be removed, as it may have unknown
impacts or dependencies that were not taken into account by the designer or the
customer.
If not removed, design information will be needed to determine added testing
needs or regression testing needs. Management should be made aware of any
significant added risks as a result of the unexpected functionality. If the
functionality only affects areas, such as minor improvements in the user
interface, it may not be a significant risk.

Q: How can software QA processes be implemented
without stifling productivity?
A: Implement QA processes slowly over time. Use consensus to reach
agreement on processes and adjust and experiment as an organization grows
and matures. Productivity will be improved instead of stifled. Problem prevention
will lessen the need for problem detection. Panics and burnout will decrease and
there will be improved focus and less wasted effort. At the same time, attempts
should be made to keep processes simple and efficient, minimize paperwork,
promote computer-based processes and automated tracking and reporting,
minimize time required in meetings and promote training as part of the QA
process. However, no one, especially talented technical types, like bureaucracy
and in the short run things may slow down a bit. A typical scenario would be that
more days of planning and development will be needed, but less time will be
required for late-night bug fixing and calming of irate customers.

Q: What if an organization is growing so fast that fixed
QA processes are impossible?
A: This is a common problem in the software industry, especially in new
technology areas. There is no easy solution in this situation, other than... · Hire good people (i.e. hire Rob Davis) · Ruthlessly prioritize quality issues and maintain focus on the customer; · Everyone in the organization should be clear on what quality means to the customer.
Q: How is testing affected by object-oriented designs?

A: A well-engineered object-oriented design can make it easier to trace from
code to internal design to functional design to requirements. While there will be
little affect on black box testing (where an understanding of the internal design of
the application is unnecessary), white-box testing can be oriented to the
application's objects. If the application was well designed this can simplify test
design.

Q: Why do you recommended that we test during the
design phase? A: Because testing during the design phase can prevent defects later on. I
recommend we verify three things... 1. Verify the design is good, efficient, compact, testable and maintainable. 2. Verify the design meets the requirements and is complete (specifies all
relationships between modules, how to pass data, what happens in
exceptional circumstances, starting state of each module and how to
guarantee the state of each module). 3. Verify the design incorporates enough memory, I/O devices and quick
enough runtime for the final product.

Q: What is software quality assurance?
A: Software Quality Assurance (SWQA) when Rob Davis does it is oriented to
*prevention*. It involves the entire software development process. Prevention is
monitoring and improving the process, making sure any agreed-upon standards and procedures are followed and ensuring problems are found and dealt with. Software Testing, when performed by Rob Davis, is also oriented to *detection*. Testing involves the operation of a system or application under controlled conditions and evaluating the results. Organizations vary considerably in how they assign responsibility for QA and testing. Sometimes they are the comined responsibility of one group or individual. Also common are project teams, which include a mix of test engineers, testers and developers who work closely together, with overall QA processes montored by project managers. It depends on what best fits your organization's size and business structure. Rob Davis can provide QA and/or SWQA. This document details some aspects of how he can provide
software testing/QA service.
Q: What is quality assurance?
A: Quality Assurance ensures all parties concerned with the project adhere to the
process and procedures, standards and templates and test readiness reviews.
Rob Davis' QA service depends on the customers and projects. A lot will depend on team
leads or managers, feedback to developers and communications among customers,
managers, developers' test engineers and testers.

Q: Processes and procedures - why follow them?
A: Detailed and well-written processes and procedures ensure the correct steps are being executed to facilitate a successful completion of a task. They also ensure a
process is repeatable. Once Rob Davis has learned and reviewed customer's business
processes and procedures, he will follow them. He will also recommend improvements
and/or additions. Q: Standards and templates - what is supposed to be in a
document? A: All documents should be written to a certain standard and template. Standards and
templates maintain document uniformity. It also helps in learning where information is
located, making it easier for a user to find what they want. Lastly, with standards and
templates, information will not be accidentally omitted from a document. Once Rob Davis
has learned and reviewed your standards and templates, he will use them. He will also
recommend improvements and/or additions.

Q: What are the different levels of testing?

A: Rob Davis has expertise in testing at all testing levels listed in the these FAQs. At each test level, he documents the results. Each level of testing is either considered black or white box testing.

Q: What is black box testing?
A: Black box testing is functional testing, not based on any knowledge of internal
software design or code. Black box testing is based on requirements and functionality.
Q: What is white box testing?

A: White box testing is based on knowledge of the internal logic of an application's code.
Tests are based on coverage of code statements, branches, paths and conditions.

Q: What is unit testing? A: Unit testing is the first level of dynamic testing and is first the responsibility of
developers and then that of the test engineers. Unit testing is performed after the
expected test results are met or differences are explainable/acceptable.

Q: What is parallel/audit testing?

A: Parallel/audit testing is testing where the user reconciles the output of the new system to the output of the current system to verify the new system performs the operations
correctly.

Q: What is functional testing?

A: Functional testing is black-box type of testing geared to functional requirements of an
application. Test engineers should perform functional testing.

Q: What is usability testing?

A: Usability testing is testing for 'user-friendliness'. Clearly this is subjective and depends
on the targeted end-user or customer. User interviews, surveys, video recording of user
sessions and other techniques can be used. Test engineers are needed, because
programmers and developers are usually not appropriate as usability testers. Q: What is incremental integration testing? A: Incremental integration testing is continuous testing of an application as new
functionality is recommended. This may require that various aspects of an application's
functionality are independent enough to work separately, before all parts of the program
are completed, or that test drivers are developed as needed. This type of testing may be
performed by programmers, software engineers, or test engineers.
Q: What is integration testing?

A: Upon completion of unit testing, integration testing begins. Integration testing is black
box testing. The purpose of integration testing is to ensure distinct components of the
application still work in accordance to customer requirements. Test cases are developed
with the express purpose of exercising the interfaces between the components. This
activity is carried out by the test team. Integration testing is considered complete, when
actual results and expected results are either in line or differences are
explainable/acceptable based on client input.

Q: What is system testing?
A: System testing is black box testing, performed by the Test Team, and at the start of
the system testing the complete system is configured in a controlled environment. The
purpose of system testing is to validate an application's accuracy and completeness in
performing the functions as designed. System testing simulates real life scenarios that
occur in a "simulated real life" test environment and test all functions of the system that
are required in real life. System testing is deemed complete when actual results and
expected results are either in line or differences are explainable or acceptable, based on
client input.
Upon completion of integration testing, system testing is started. Before system testing,
all unit and integration test results are reviewed by SWQA to ensure all problems have
been resolved. For a higher level of testing it is important to understand unresolved
problems that originate at unit and integration test levels.

Q: What is end-to-end testing?

A: End-to-end testing is similar to system testing, the *macro* end of the test
scale; it is the testing a complete application in a situation that mimics real life
use, such as interacting with a database, using network communication, or
interacting with other hardware, application, or system.

Q: What is regression testing?
A: The objective of regression testing is to ensure the software remains intact. A
baseline set of data and scripts is maintained and executed to verify that
changes introduced during the release have not "undone" any previous code.
Expected results from the baseline are compared to results of the software under
test. All discrepancies are highlighted and accounted for, before testing proceeds
to the next level.
Q: What is sanity testing?

A: Sanity testing is a cursory testing; it is performed whenever a cursory testing
is sufficient to prove the application is functioning according to specifications.
This level of testing is a subset of regression testing. It normally includes a set of
core tests of basic GUI functionality to demonstrate connectivity to the database,
application servers, printers, etc.

Q: What is performance testing?

A: Performance testing verifies loads, volumes and response times, as defined
by requirements. Although performance testing is a part of system testing, it can
be regarded as a distinct level of testing.

Q: What is load testing?

A: Load testing is testing an application under heavy loads, such as the testing of
a web site under a range of loads to determine at what point the system
response time will degrade or fail.

Q: What is installation testing?

A: Installation testing is the testing of a full, partial, or upgrade install/uninstall
process. The installation test is conducted with the objective of demonstrating
production readiness. This test includes the inventory of configuration items,
performed by the application's System Administration, the evaluation of data
readiness, and dynamic tests focused on basic system functionality. Following
installation testing, a sanity test is performed when necessary. Q: What is security/penetration testing? A: Security/penetration testing is testing how well the system is protected against
unauthorized internal or external access, or willful damage. This type of testing
usually requires sophisticated testing techniques. Q: What is recovery/error testing? A: Recovery/error testing is testing how well a system recovers from crashes,
hardware failures, or other catastrophic problems.
Q: What is compatibility testing?
A: Compatibility testing is testing how well software performs in a particular
hardware, software, operating system, or network environment.

Q: What is comparison testing? A: Comparison testing is testing that compares software weaknesses and
strengths to those of competitors' products.

Q: What is acceptance testing? A: Acceptance testing is black box testing that gives the client/customer/project
manager the opportunity to verify the system functionality and usability prior to
the system being released to production. The acceptance test is the
responsibility of the client/customer or project manager, however, it is conducted
with the full support of the project team. The test team also works with the
client/customer/project manager to develop the acceptance criteria.

Q: What is alpha testing? A: Alpha testing is testing of an application when development is nearing
completion. Minor design changes can still be made as a result of alpha testing.
Alpha testing is typically performed by end-users or others, not programmers,
software engineers, or test engineers.

Q: What is beta testing? A: Beta testing is testing an application when development and testing are
essentially completed and final bugs and problems need to be found before the
final release. Beta testing is typically performed by end-users or others, not
programmers, software engineers, or test engineers.

Q: What testing roles are standard on most testing
projects? A: Depending on the organization, the following roles are more or less standard
on most testing projects: Testers, Test Engineers, Test/QA Team Lead, Test/QA
Manager, System Administrator, Database Administrator, Technical Analyst, Test
Build Manager and Test Configuration Manager. Depending on the project, one
person may wear more than one hat. For instance, Test Engineers may also
wear the hat of Technical Analyst, Test Build Manager and Test Configuration
Manager.
Q: What is a Test/QA Team Lead?

A: The Test/QA Team Lead coordinates the testing activity, communicates
testing status to management and manages the test team.

Q: What is a Test Engineer?

A: A Test Engineer is an engineer who specializes in testing. Test engineers
create test cases, procedures, scripts and generate data. They execute test
procedures and scripts, analyze standards of measurements, evaluate results of
system/integration/regression testing. They also... · Speed up the work of your development staff; · Reduce your risk of legal liability; · Give you the evidence that your software is correct and operates
properly; · Improve problem tracking and reporting; · Maximize the value of your software; · Maximize the value of the devices that use it; · Assure the successful launch of your product by discovering bugs and
design flaws, before users get discouraged, before shareholders loose
their cool and before employees get bogged down; · Help the work of your development staff, so the development team can
devote its time to build up your product; · Promote continual improvement; · Provide documentation required by FDA, FAA, other regulatory agencies
and your customers; · Save money by discovering defects 'early' in the design process, before
failures occur in production, or in the field; · Save the reputation of your company by discovering bugs and design
flaws; before bugs and design flaws damage the reputation of your
company.

Q: What is a Test Build Manager?
A: Test Build Managers deliver current software versions to the test environment,
install the application's software and apply software patches, to both the
application and the operating system, set-up, maintain and back up test
environment hardware. Depending on the project, one person may wear more
than one hat. For instance, a Test Engineer may also wear the hat of a Test Build
Manager.
Q: What is a System Administrator?

A: Test Build Managers, System Administrators, Database Administrators deliver
current software versions to the test environment, install the application's
software and apply software patches, to both the application and the operating
system, set-up, maintain and back up test environment hardware. Depending on
the project, one person may wear more than one hat. For instance, a Test
Engineer may also wear the hat of a System Administrator.

Q: What is a Database Administrator?

A: Database Administrators, Test Build Managers, and System Administrators
deliver current software versions to the test environment, install the application's
software and apply software patches, to both the application and the operating
system, set-up, maintain and back up test environment hardware. Depending on
the project, one person may wear more than one hat. For instance, a Test
Engineer may also wear the hat of a Database Administrator.

Q: What is a Technical Analyst?

A: Technical Analysts perform test assessments and validate system/functional
test requirements. Depending on the project, one person may wear more than
one hat. For instance, Test Engineers may also wear the hat of a Technical
Analyst.

Q: What is a Test Configuration Manager?
A: Test Configuration Managers maintain test environments, scripts, software
and test data. Depending on the project, one person may wear more than one
hat. For instance, Test Engineers may also wear the hat of a Test Configuration
Manager.

Q: What is a test schedule?
A: The test schedule is a schedule that identifies all tasks required for a
successful testing effort, a schedule of all test activities and resource
requirements.

Q: What is software testing methodology?

A: One software testing methodology is a three step process of... 1. Creating a test strategy; 2. Creating a test plan/design; and 3. Executing tests. This methodology can be used and molded to your organization's needs. Rob
Davis believes that using this methodology is important in the development and
ongoing maintenance of his customers' applications.

Q: What is the general testing process? A: The general testing process is the creation of a test strategy (which
sometimes includes the creation of test cases), creation of a test plan/design
(which usually includes test cases and test procedures) and the execution of
tests.

Q: How do you create a test strategy? A: The test strategy is a formal description of how a software product will be
tested. A test strategy is developed for all levels of testing, as required. The test
team analyzes the requirements, writes the test strategy and reviews the plan
with the project team. The test plan may include test cases, conditions, the test
environment, a list of related tasks, pass/fail criteria and risk assessment.

Inputs for this process: · A description of the required hardware and software components,
including test tools. This information comes from the test environment,
including test tool data. · A description of roles and responsibilities of the resources required for
the test and schedule constraints. This information comes from man-
hours and schedules. · Testing methodology. This is based on known standards. · Functional and technical requirements of the application. This
information comes from requirements, change request, technical and
functional design documents. · Requirements that the system can not provide, e.g. system limitations. Outputs for this process: · An approved and signed off test strategy document, test plan, including
test cases. · Testing issues requiring resolution. Usually this requires additional
negotiation at the project management level.
How do you create a test plan/design?

A: Test scenarios and/or cases are prepared by reviewing functional
requirements of the release and preparing logical groups of functions that can be
further broken into test procedures. Test procedures define test conditions, data
to be used for testing and expected results, including database updates, file
outputs, report results. Generally speaking... · Test cases and scenarios are designed to represent both typical and
unusual situations that may occur in the application. · Test engineers define unit test requirements and unit test cases. Test
engineers also execute unit test cases. · It is the test team who, with assistance of developers and clients,
develops test cases and scenarios for integration and system testing. · Test scenarios are executed through the use of test procedures or
scripts. · Test procedures or scripts define a series of steps necessary to perform
one or more test scenarios. · Test procedures or scripts include the specific data that will be used for
testing the process or transaction. · Test procedures or scripts may cover multiple test scenarios. · Test scripts are mapped back to the requirements and traceability
matrices are used to ensure each test is within scope. · Test data is captured and base lined, prior to testing. This data serves as
the foundation for unit and system testing and used to exercise system
functionality in a controlled environment. · Some output data is also base-lined for future comparison. Base-lined
data is used to support future application maintenance via regression
testing. · A pre-test meeting is held to assess the readiness of the application and
the environment and data to be tested. A test readiness document is
created to indicate the status of the entrance criteria of the release. Inputs for this process: · Approved Test Strategy Document. · Test tools, or automated test tools, if applicable. · Previously developed scripts, if applicable. · Test documentation problems uncovered as a result of testing. · A good understanding of software complexity and module path coverage,
derived from general and detailed design documents, e.g. software
design document, source code and software complexity data. Outputs for this process: · Approved documents of test scenarios, test cases, test conditions and
test data. · Reports of software design issues, given to software developers for
correction.
Q: How do you execute tests? A: Execution of tests is completed by following the test documents in a
methodical manner. As each test procedure is performed, an entry is recorded in
a test execution log to note the execution of the procedure and whether or not
the test procedure uncovered any defects. Checkpoint meetings are held
throughout the execution phase. Checkpoint meetings are held daily, if required,
to address and discuss testing issues, status and activities. · The output from the execution of test procedures is known as test
results. Test results are evaluated by test engineers to determine
whether the expected results have been obtained. All
discrepancies/anomalies are logged and discussed with the software
team lead, hardware test lead, programmers, software engineers and
documented for further investigation and resolution. Every company has
a different process for logging and reporting bugs/defects uncovered
during testing. · A pass/fail criteria is used to determine the severity of a problem, and
results are recorded in a test summary report. The severity of a problem,
found during system testing, is defined in accordance to the customer's
risk assessment and recorded in their selected tracking tool. · Proposed fixes are delivered to the testing environment, based on the
severity of the problem. Fixes are regression tested and flawless fixes
are migrated to a new baseline. Following completion of the test,
members of the test team prepare a summary report. The summary
report is reviewed by the Project Manager, Software QA (SWQA)
Manager and/or Test Team Lead. · After a particular level of testing has been certified, it is the responsibility
of the Configuration Manager to coordinate the migration of the release
software components to the next test level, as documented in the
Configuration Management Plan. The software is only migrated to the
production environment after the Project Manager's formal acceptance. · The test team reviews test document problems identified during testing,
and update documents where appropriate. Inputs for this process: · Approved test documents, e.g. Test Plan, Test Cases, Test Procedures. · Test tools, including automated test tools, if applicable. · Developed scripts. · Changes to the design, i.e. Change Request Documents. · Test data. · Availability of the test team and project team. · General and Detailed Design Documents, i.e. Requirements Document,
Software Design Document. · A software that has been migrated to the test environment, i.e. unit
tested code, via the Configuration/Build Manager. · Test Readiness Document. · Document Updates. Outputs for this process: Log and summary of the test results. Usually this is part of the Test Report. This needs to be approved and signed-off with revised testing
deliverables. · Changes to the code, also known as test fixes. · Test document problems uncovered as a result of testing. Examples are
Requirements document and Design Document problems. · Reports on software design issues, given to software developers for
correction. Examples are bug reports on code issues. · Formal record of test incidents, usually part of problem tracking. · Base-lined package, also known as tested source and object code, ready
for migration to the next level.

Manual Testing Interview Questions

Manual Testing Interview Questions

What makes a good test engineer?
A good test engineer has a 'test to break' attitude, an ability to take the point of view of the customer, a strong desire for quality, and an attention to detail. Tact and diplomacy are useful in maintaining a cooperative relationship with developers, and an ability to communicate with both technical (developers) and non-technical (customers, management) people is useful. Previous software development experience can be helpful as it provides a deeper understanding of the software development process, gives the tester an appreciation for the developers' point of view, and reduce the learning curve in automated test tool programming. Judgment skills are needed to assess high-risk areas of an application on which to focus testing efforts when time is limited.
What makes a good Software QA engineer?
The same qualities a good tester has are useful for a QA engineer. Additionally, they must be able to understand the entire software development process and how it can fit into the business approach and goals of the organization. Communication skills and the ability to understand various sides of issues are important. In organizations in the early stages of implementing QA processes, patience and diplomacy are especially needed. An ability to find problems as well as to see 'what's missing' is important for inspections and reviews.
What makes a good QA or Test manager?
A good QA, test, or QA/Test(combined) manager should:
• be familiar with the software development process
• be able to maintain enthusiasm of their team and promote a positive atmosphere, despite
• what is a somewhat 'negative' process (e.g., looking for or preventing problems)
• be able to promote teamwork to increase productivity
• be able to promote cooperation between software, test, and QA engineers
• have the diplomatic skills needed to promote improvements in QA processes
• have the ability to withstand pressures and say 'no' to other managers when quality is insufficient or QA processes are not being adhered to
• have people judgement skills for hiring and keeping skilled personnel
• be able to communicate with technical and non-technical people, engineers, managers, and customers.
• be able to run meetings and keep them focused
What's the role of documentation in QA?
Critical. (Note that documentation can be electronic, not necessarily paper.) QA practices should be documented such that they are repeatable. Specifications, designs, business rules, inspection reports, configurations, code changes, test plans, test cases, bug reports, user manuals, etc. should all be documented. There should ideally be a system for easily finding and obtaining documents and determining what documentation will have a particular piece of information. Change management for documentation should be used if possible.
What's the big deal about 'requirements'?
One of the most reliable methods of insuring problems, or failure, in a complex software project is to have poorly documented requirements specifications. Requirements are the details describing an application's externally-perceived functionality and properties. Requirements should be clear, complete, reasonably detailed, cohesive, attainable, and testable. A non-testable requirement would be, for example, 'user-friendly' (too subjective). A testable requirement would be something like 'the user must enter their previously-assigned password to access the application'. Determining and organizing requirements details in a useful and efficient way can be a difficult effort; different methods are available depending on the particular project. Many books are available that describe various approaches to this task. (See the Bookstore section's 'Software Requirements Engineering' category for books on Software Requirements.)
Care should be taken to involve ALL of a project's significant 'customers' in the requirements process. 'Customers' could be in-house personnel or out, and could include end-users, customer acceptance testers, customer contract officers, customer management, future software maintenance engineers, salespeople, etc. Anyone who could later derail the project if their expectations aren't met should be included if possible.
Organizations vary considerably in their handling of requirements specifications. Ideally, the requirements are spelled out in a document with statements such as 'The product shall.....'. 'Design' specifications should not be confused with 'requirements'; design specifications should be traceable back to the requirements.
In some organizations requirements may end up in high level project plans, functional specification documents, in design documents, or in other documents at various levels of detail. No matter what they are called, some type of documentation with detailed requirements will be needed by testers in order to properly plan and execute tests. Without such documentation, there will be no clear-cut way to determine if a software application is performing correctly.
'Agile' methods such as XP use methods requiring close interaction and cooperation between programmers and customers/end-users to iteratively develop requirements. The programmer uses 'Test first' development to first create automated unit testing code, which essentially embodies the requirements.
What steps are needed to develop and run software tests?
The following are some of the steps to consider:
• Obtain requirements, functional design, and internal design specifications and other necessary documents
• Obtain budget and schedule requirements
• Determine project-related personnel and their responsibilities, reporting requirements, required standards and processes (such as release processes, change processes, etc.)
• Identify application's higher-risk aspects, set priorities, and determine scope and limitations of tests
• Determine test approaches and methods - unit, integration, functional, system, load, usability tests, etc.
• Determine test environment requirements (hardware, software, communications, etc.)
• Determine testware requirements (record/playback tools, coverage analyzers, test tracking, problem/bug tracking, etc.)
• Determine test input data requirements
• Identify tasks, those responsible for tasks, and labor requirements
• Set schedule estimates, timelines, milestones
• Determine input equivalence classes, boundary value analyses, error classes
• Prepare test plan document and have needed reviews/approvals
• Write test cases
• Have needed reviews/inspections/approvals of test cases
• Prepare test environment and testware, obtain needed user manuals/reference documents/configuration guides/installation guides, set up test tracking processes, set up logging and archiving processes, set up or obtain test input data
• Obtain and install software releases
• Perform tests
• Evaluate and report results
• Track problems/bugs and fixes
• Retest as needed
• Maintain and update test plans, test cases, test environment, and testware through life cycle
What's a 'test plan'?
A software project test plan is a document that describes the objectives, scope, approach, and focus of a software testing effort. The process of preparing a test plan is a useful way to think through the efforts needed to validate the acceptability of a software product. The completed document will help people outside the test group understand the 'why' and 'how' of product validation. It should be thorough enough to be useful but not so thorough that no one outside the test group will read it. The following are some of the items that might be included in a test plan, depending on the particular project:
• Title
• Identification of software including version/release numbers
• Revision history of document including authors, dates, approvals
• Table of Contents
• Purpose of document, intended audience
• Objective of testing effort
• Software product overview
• Relevant related document list, such as requirements, design documents, other test plans, etc.
• Relevant standards or legal requirements
• Traceability requirements
• Relevant naming conventions and identifier conventions
• Overall software project organization and personnel/contact-info/responsibilties
• Test organization and personnel/contact-info/responsibilities
• Assumptions and dependencies
• Project risk analysis
• Testing priorities and focus
• Scope and limitations of testing
• Test outline - a decomposition of the test approach by test type, feature, functionality, process, system, module, etc. as applicable
• Outline of data input equivalence classes, boundary value analysis, error classes
• Test environment - hardware, operating systems, other required software, data configurations, interfaces to other systems
• Test environment validity analysis - differences between the test and production systems and their impact on test validity.
• Test environment setup and configuration issues
• Software migration processes
• Software CM processes
• Test data setup requirements
• Database setup requirements
• Outline of system-logging/error-logging/other capabilities, and tools such as screen capture software, that will be used to help describe and report bugs
• Discussion of any specialized software or hardware tools that will be used by testers to help track the cause or source of bugs
• Test automation - justification and overview
• Test tools to be used, including versions, patches, etc.
• Test script/test code maintenance processes and version control
• Problem tracking and resolution - tools and processes
• Project test metrics to be used
• Reporting requirements and testing deliverables
• Software entrance and exit criteria
• Initial sanity testing period and criteria
• Test suspension and restart criteria
• Personnel allocation
• Personnel pre-training needs
• Test site/location
• Outside test organizations to be utilized and their purpose, responsibilties, deliverables, contact persons, and coordination issues
• Relevant proprietary, classified, security, and licensing issues.
• Open issues
• Appendix - glossary, acronyms, etc.
What's a 'test case'?
• A test case is a document that describes an input, action, or event and an expected response, to determine if a feature of an application is working correctly. A test case should contain particulars such as test case identifier, test case name, objective, test conditions/setup, input data requirements, steps, and expected results.
• Note that the process of developing test cases can help find problems in the requirements or design of an application, since it requires completely thinking through the operation of the application. For this reason, it's useful to prepare test cases early in the development cycle if possible.
What should be done after a bug is found?
The bug needs to be communicated and assigned to developers that can fix it. After the problem is resolved, fixes should be re-tested, and determinations made regarding requirements for regression testing to check that fixes didn't create problems elsewhere. If a problem-tracking system is in place, it should encapsulate these processes. A variety of commercial problem-tracking/management software tools are available (see the 'Tools' section for web resources with listings of such tools). The following are items to consider in the tracking process:
• Complete information such that developers can understand the bug, get an idea of it's severity, and reproduce it if necessary.
• Bug identifier (number, ID, etc.)
• Current bug status (e.g., 'Released for Retest', 'New', etc.)
• The application name or identifier and version
• The function, module, feature, object, screen, etc. where the bug occurred
• Environment specifics, system, platform, relevant hardware specifics
• Test case name/number/identifier
• One-line bug description
• Full bug description
• Description of steps needed to reproduce the bug if not covered by a test case or if the developer doesn't have easy access to the test case/test script/test tool
• Names and/or descriptions of file/data/messages/etc. used in test
• File excerpts/error messages/log file excerpts/screen shots/test tool logs that would be helpful in finding the cause of the problem
• Severity estimate (a 5-level range such as 1-5 or 'critical'-to-'low' is common)
• Was the bug reproducible?
• Tester name
• Test date
• Bug reporting date
• Name of developer/group/organization the problem is assigned to
• Description of problem cause
• Description of fix
• Code section/file/module/class/method that was fixed
• Date of fix
• Application version that contains the fix
• Tester responsible for retest
• Retest date
• Retest results
• Regression testing requirements
• Tester responsible for regression tests
• Regression testing results
A reporting or tracking process should enable notification of appropriate personnel at various stages. For instance, testers need to know when retesting is needed, developers need to know when bugs are found and how to get the needed information, and reporting/summary capabilities are needed for managers.
What is 'configuration management'?
Configuration management covers the processes used to control, coordinate, and track: code, requirements, documentation, problems, change requests, designs, tools/compilers/libraries/patches, changes made to them, and who makes the changes. (See the 'Tools' section for web resources with listings of configuration management tools. Also see the Bookstore section's 'Configuration Management' category for useful books with more information.)
What if the software is so buggy it can't really be tested at all?
The best bet in this situation is for the testers to go through the process of reporting whatever bugs or blocking-type problems initially show up, with the focus being on critical bugs. Since this type of problem can severely affect schedules, and indicates deeper problems in the software development process (such as insufficient unit testing or insufficient integration testing, poor design, improper build or release procedures, etc.) managers should be notified, and provided with some documentation as evidence of the problem.
How can it be known when to stop testing?
This can be difficult to determine. Many modern software applications are so complex, and run in such an interdependent environment, that complete testing can never be done. Common factors in deciding when to stop are:
• Deadlines (release deadlines, testing deadlines, etc.)
• Test cases completed with certain percentage passed
• Test budget depleted
• Coverage of code/functionality/requirements reaches a specified point
• Bug rate falls below a certain level
• Beta or alpha testing period ends
What if there isn't enough time for thorough testing?
Use risk analysis to determine where testing should be focused.
Since it's rarely possible to test every possible aspect of an application, every possible combination of events, every dependency, or everything that could go wrong, risk analysis is appropriate to most software development projects. This requires judgement skills, common sense, and experience. (If warranted, formal methods are also available.) Considerations can include:
• Which functionality is most important to the project's intended purpose?
• Which functionality is most visible to the user?
• Which functionality has the largest safety impact?
• Which functionality has the largest financial impact on users?
• Which aspects of the application are most important to the customer?
• Which aspects of the application can be tested early in the development cycle?
• Which parts of the code are most complex, and thus most subject to errors?
• Which parts of the application were developed in rush or panic mode?
• Which aspects of similar/related previous projects caused problems?
• Which aspects of similar/related previous projects had large maintenance expenses?
• Which parts of the requirements and design are unclear or poorly thought out?
• What do the developers think are the highest-risk aspects of the application?
• What kinds of problems would cause the worst publicity?
• What kinds of problems would cause the most customer service complaints?
• What kinds of tests could easily cover multiple functionalities?
• Which tests will have the best high-risk-coverage to time-required ratio?
What if the project isn't big enough to justify extensive testing?
Consider the impact of project errors, not the size of the project. However, if extensive testing is still not justified, risk analysis is again needed and the same considerations as described previously in 'What if there isn't enough time for thorough testing?' apply. The tester might then do ad hoc testing, or write up a limited test plan based on the risk analysis.
What can be done if requirements are changing continuously?
A common problem and a major headache.
• Work with the project's stakeholders early on to understand how requirements might change so that alternate test plans and strategies can be worked out in advance, if possible.
• It's helpful if the application's initial design allows for some adaptability so that later changes do not require redoing the application from scratch.
• If the code is well-commented and well-documented this makes changes easier for the developers.
• Use rapid prototyping whenever possible to help customers feel sure of their requirements and minimize changes.
• The project's initial schedule should allow for some extra time commensurate with the possibility of changes.
• Try to move new requirements to a 'Phase 2' version of an application, while using the original requirements for the 'Phase 1' version.
• Negotiate to allow only easily-implemented new requirements into the project, while moving more difficult new requirements into future versions of the application.
• Be sure that customers and management understand the scheduling impacts, inherent risks, and costs of significant requirements changes. Then let management or the customers (not the developers or testers) decide if the changes are warranted - after all, that's their job.
• Balance the effort put into setting up automated testing with the expected effort required to re-do them to deal with changes.
• Try to design some flexibility into automated test scripts.
• Focus initial automated testing on application aspects that are most likely to remain unchanged.
• Devote appropriate effort to risk analysis of changes to minimize regression testing needs.
• Design some flexibility into test cases (this is not easily done; the best bet might be to minimize the detail in the test cases, or set up only higher-level generic-type test plans)
• Focus less on detailed test plans and test cases and more on ad hoc testing (with an understanding of the added risk that this entails).
What if the application has functionality that wasn't in the requirements?
It may take serious effort to determine if an application has significant unexpected or hidden functionality, and it would indicate deeper problems in the software development process. If the functionality isn't necessary to the purpose of the application, it should be removed, as it may have unknown impacts or dependencies that were not taken into account by the designer or the customer. If not removed, design information will be needed to determine added testing needs or regression testing needs. Management should be made aware of any significant added risks as a result of the unexpected functionality. If the functionality only effects areas such as minor improvements in the user interface, for example, it may not be a significant risk.
How can Software QA processes be implemented without stifling productivity?
By implementing QA processes slowly over time, using consensus to reach agreement on processes, and adjusting and experimenting as an organization grows and matures, productivity will be improved instead of stifled. Problem prevention will lessen the need for problem detection, panics and burn-out will decrease, and there will be improved focus and less wasted effort. At the same time, attempts should be made to keep processes simple and efficient, minimize paperwork, promote computer-based processes and automated tracking and reporting, minimize time required in meetings, and promote training as part of the QA process. However, no one - especially talented technical types - likes rules or bureacracy, and in the short run things may slow down a bit. A typical scenario would be that more days of planning and development will be needed, but less time will be required for late-night bug-fixing and calming of irate customers.
What if an organization is growing so fast that fixed QA processes are impossible?
This is a common problem in the software industry, especially in new technology areas. There is no easy solution in this situation, other than:
• Hire good people
• Management should 'ruthlessly prioritize' quality issues and maintain focus on the customer
• Everyone in the organization should be clear on what 'quality' means to the customer
How does a client/server environment affect testing?
Client/server applications can be quite complex due to the multiple dependencies among clients, data communications, hardware, and servers. Thus testing requirements can be extensive. When time is limited (as it usually is) the focus should be on integration and system testing. Additionally, load/stress/performance testing may be useful in determining client/server application limitations and capabilities. There are commercial tools to assist with such testing. (See the 'Tools' section for web resources with listings that include these kinds of test tools.)
How can World Wide Web sites be tested?
Web sites are essentially client/server applications - with web servers and 'browser' clients. Consideration should be given to the interactions between html pages, TCP/IP communications, Internet connections, firewalls, applications that run in web pages (such as applets, javascript, plug-in applications), and applications that run on the server side (such as cgi scripts, database interfaces, logging applications, dynamic page generators, asp, etc.). Additionally, there are a wide variety of servers and browsers, various versions of each, small but sometimes significant differences between them, variations in connection speeds, rapidly changing technologies, and multiple standards and protocols. The end result is that testing for web sites can become a major ongoing effort. Other considerations might include:
• What are the expected loads on the server (e.g., number of hits per unit time?), and what kind of performance is required under such loads (such as web server response time, database query response times). What kinds of tools will be needed for performance testing (such as web load testing tools, other tools already in house that can be adapted, web robot downloading tools, etc.)?
• Who is the target audience? What kind of browsers will they be using? What kind of connection speeds will they by using? Are they intra- organization (thus with likely high connection speeds and similar browsers) or Internet-wide (thus with a wide variety of connection speeds and browser types)?
• What kind of performance is expected on the client side (e.g., how fast should pages appear, how fast should animations, applets, etc. load and run)?
• Will down time for server and content maintenance/upgrades be allowed? how much?
• What kinds of security (firewalls, encryptions, passwords, etc.) will be required and what is it expected to do? How can it be tested?
• How reliable are the site's Internet connections required to be? And how does that affect backup system or redundant connection requirements and testing?
• What processes will be required to manage updates to the web site's content, and what are the requirements for maintaining, tracking, and controlling page content, graphics, links, etc.?
• Which HTML specification will be adhered to? How strictly? What variations will be allowed for targeted browsers?
• Will there be any standards or requirements for page appearance and/or graphics throughout a site or parts of a site??
• How will internal and external links be validated and updated? how often?
• Can testing be done on the production system, or will a separate test system be required? How are browser caching, variations in browser option settings, dial-up connection variabilities, and real-world internet 'traffic congestion' problems to be accounted for in testing?
• How extensive or customized are the server logging and reporting requirements; are they considered an integral part of the system and do they require testing?
• How are cgi programs, applets, javascripts, ActiveX components, etc. to be maintained, tracked, controlled, and tested?
Some sources of site security information include the Usenet newsgroup 'comp.security.announce' and links concerning web site security in the 'Other Resources' section.
Some usability guidelines to consider - these are subjective and may or may not apply to a given situation (Note: more information on usability testing issues can be found in articles about web site usability in the 'Other Resources' section):
• Pages should be 3-5 screens max unless content is tightly focused on a single topic. If larger, provide internal links within the page.
• The page layouts and design elements should be consistent throughout a site, so that it's clear to the user that they're still within a site.
• Pages should be as browser-independent as possible, or pages should be provided or generated based on the browser-type.
• All pages should have links external to the page; there should be no dead-end pages.
• The page owner, revision date, and a link to a contact person or organization should be included on each page.
Many new web site test tools have appeared in the recent years and more than 280 of them are listed in the 'Web Test Tools' section.
How is testing affected by object-oriented designs?
Well-engineered object-oriented design can make it easier to trace from code to internal design to functional design to requirements. While there will be little affect on black box testing (where an understanding of the internal design of the application is unnecessary), white-box testing can be oriented to the application's objects. If the application was well-designed this can simplify test design.
What is Extreme Programming and what's it got to do with testing?
Extreme Programming (XP) is a software development approach for small teams on risk-prone projects with unstable requirements. It was created by Kent Beck who described the approach in his book 'Extreme Programming Explained' (See the Softwareqatest.com Books page.). Testing ('extreme testing') is a core aspect of Extreme Programming. Programmers are expected to write unit and functional test code first - before the application is developed. Test code is under source control along with the rest of the code. Customers are expected to be an integral part of the project team and to help develope scenarios for acceptance/black box testing. Acceptance tests are preferably automated, and are modified and rerun for each of the frequent development iterations. QA and test personnel are also required to be an integral part of the project team. Detailed requirements documentation is not used, and frequent re-scheduling, re-estimating, and re-prioritizing is expected. For more info see the XP-related listings in the Softwareqatest.com 'Other Resources' section.
What is 'Software Quality Assurance'?
Software QA involves the entire software development PROCESS - monitoring and improving the process, making sure that any agreed-upon standards and procedures are followed, and ensuring that problems are found and dealt with. It is oriented to 'prevention'. (See the Bookstore section's 'Software QA' category for a list of useful books on Software Quality Assurance.)
What is 'Software Testing'?
Testing involves operation of a system or application under controlled conditions and evaluating the results (eg, 'if the user is in interface A of the application while using hardware B, and does C, then D should happen'). The controlled conditions should include both normal and abnormal conditions. Testing should intentionally attempt to make things go wrong to determine if things happen when they shouldn't or things don't happen when they should. It is oriented to 'detection'. (See the Bookstore section's 'Software Testing' category for a list of useful books on Software Testing.)
• Organizations vary considerably in how they assign responsibility for QA and testing. Sometimes they're the combined responsibility of one group or individual. Also common are project teams that include a mix of testers and developers who work closely together, with overall QA processes monitored by project managers. It will depend on what best fits an organization's size and business structure.
What are some recent major computer system failures caused by software bugs?
• A major U.S. retailer was reportedly hit with a large government fine in October of 2003 due to web site errors that enabled customers to view one anothers' online orders.
• News stories in the fall of 2003 stated that a manufacturing company recalled all their transportation products in order to fix a software problem causing instability in certain circumstances. The company found and reported the bug itself and initiated the recall procedure in which a software upgrade fixed the problems.
• In August of 2003 a U.S. court ruled that a lawsuit against a large online brokerage company could proceed; the lawsuit reportedly involved claims that the company was not fixing system problems that sometimes resulted in failed stock trades, based on the experiences of 4 plaintiffs during an 8-month period. A previous lower court's ruling that "...six miscues out of more than 400 trades does not indicate negligence." was invalidated.
• In April of 2003 it was announced that the largest student loan company in the U.S. made a software error in calculating the monthly payments on 800,000 loans. Although borrowers were to be notified of an increase in their required payments, the company will still reportedly lose $8 million in interest. The error was uncovered when borrowers began reporting inconsistencies in their bills.
• News reports in February of 2003 revealed that the U.S. Treasury Department mailed 50,000 Social Security checks without any beneficiary names. A spokesperson indicated that the missing names were due to an error in a software change. Replacement checks were subsequently mailed out with the problem corrected, and recipients were then able to cash their Social Security checks.
• In March of 2002 it was reported that software bugs in Britain's national tax system resulted in more than 100,000 erroneous tax overcharges. The problem was partly attibuted to the difficulty of testing the integration of multiple systems.
• A newspaper columnist reported in July 2001 that a serious flaw was found in off-the-shelf software that had long been used in systems for tracking certain U.S. nuclear materials. The same software had been recently donated to another country to be used in tracking their own nuclear materials, and it was not until scientists in that country discovered the problem, and shared the information, that U.S. officials became aware of the problems.
• According to newspaper stories in mid-2001, a major systems development contractor was fired and sued over problems with a large retirement plan management system. According to the reports, the client claimed that system deliveries were late, the software had excessive defects, and it caused other systems to crash.
• In January of 2001 newspapers reported that a major European railroad was hit by the aftereffects of the Y2K bug. The company found that many of their newer trains would not run due to their inability to recognize the date '31/12/2000'; the trains were started by altering the control system's date settings.
• News reports in September of 2000 told of a software vendor settling a lawsuit with a large mortgage lender; the vendor had reportedly delivered an online mortgage processing system that did not meet specifications, was delivered late, and didn't work.
• In early 2000, major problems were reported with a new computer system in a large suburban U.S. public school district with 100,000+ students; problems included 10,000 erroneous report cards and students left stranded by failed class registration systems; the district's CIO was fired. The school district decided to reinstate it's original 25-year old system for at least a year until the bugs were worked out of the new system by the software vendors.
• In October of 1999 the $125 million NASA Mars Climate Orbiter spacecraft was believed to be lost in space due to a simple data conversion error. It was determined that spacecraft software used certain data in English units that should have been in metric units. Among other tasks, the orbiter was to serve as a communications relay for the Mars Polar Lander mission, which failed for unknown reasons in December 1999. Several investigating panels were convened to determine the process failures that allowed the error to go undetected.
• Bugs in software supporting a large commercial high-speed data network affected 70,000 business customers over a period of 8 days in August of 1999. Among those affected was the electronic trading system of the largest U.S. futures exchange, which was shut down for most of a week as a result of the outages.
• In April of 1999 a software bug caused the failure of a $1.2 billion U.S. military satellite launch, the costliest unmanned accident in the history of Cape Canaveral launches. The failure was the latest in a string of launch failures, triggering a complete military and industry review of U.S. space launch programs, including software integration and testing processes. Congressional oversight hearings were requested.
• A small town in Illinois in the U.S. received an unusually large monthly electric bill of $7 million in March of 1999. This was about 700 times larger than its normal bill. It turned out to be due to bugs in new software that had been purchased by the local power company to deal with Y2K software issues.
• In early 1999 a major computer game company recalled all copies of a popular new product due to software problems. The company made a public apology for releasing a product before it was ready.
Why is it often hard for management to get serious about quality assurance?
Solving problems is a high-visibility process; preventing problems is low-visibility. This is illustrated by an old parable:
In ancient China there was a family of healers, one of whom was known throughout the land and employed as a physician to a great lord. The physician was asked which of his family was the most skillful healer. He replied,
"I tend to the sick and dying with drastic and dramatic treatments, and on occasion someone is cured and my name gets out among the lords."
"My elder brother cures sickness when it just begins to take root, and his skills are known among the local peasants and neighbors."
"My eldest brother is able to sense the spirit of sickness and eradicate it before it takes form. His name is unknown outside our home."
Why does software have bugs?
• miscommunication or no communication - as to specifics of what an application should or shouldn't do (the application's requirements).
• software complexity - the complexity of current software applications can be difficult to comprehend for anyone without experience in modern-day software development. Windows-type interfaces, client-server and distributed applications, data communications, enormous relational databases, and sheer size of applications have all contributed to the exponential growth in software/system complexity. And the use of object-oriented techniques can complicate instead of simplify a project unless it is well-engineered.
• programming errors - programmers, like anyone else, can make mistakes.
• changing requirements (whether documented or undocumented) - the customer may not understand the effects of changes, or may understand and request them anyway - redesign, rescheduling of engineers, effects on other projects, work already completed that may have to be redone or thrown out, hardware requirements that may be affected, etc. If there are many minor changes or any major changes, known and unknown dependencies among parts of the project are likely to interact and cause problems, and the complexity of coordinating changes may result in errors. Enthusiasm of engineering staff may be affected. In some fast-changing business environments, continuously modified requirements may be a fact of life. In this case, management must understand the resulting risks, and QA and test engineers must adapt and plan for continuous extensive testing to keep the inevitable bugs from running out of control - see 'What can be done if requirements are changing continuously?' in Part 2 of the FAQ.
• time pressures - scheduling of software projects is difficult at best, often requiring a lot of guesswork. When deadlines loom and the crunch comes, mistakes will be made.
• egos - people prefer to say things like:
'no problem'
'piece of cake'
'I can whip that out in a few hours'
'it should be easy to update that old code'
instead of:
'that adds a lot of complexity and we could end up
making a lot of mistakes'
'we have no idea if we can do that; we'll wing it'
'I can't estimate how long it will take, until I
take a close look at it'
'we can't figure out what that old spaghetti code
did in the first place'

If there are too many unrealistic 'no problem's', the result is bugs.

• poorly documented code - it's tough to maintain and modify code that is badly written or poorly documented; the result is bugs. In many organizations management provides no incentive for programmers to document their code or write clear, understandable, maintainable code. In fact, it's usually the opposite: they get points mostly for quickly turning out code, and there's job security if nobody else can understand it ('if it was hard to write, it should be hard to read').
• software development tools - visual tools, class libraries, compilers, scripting tools, etc. often introduce their own bugs or are poorly documented, resulting in added bugs.
How can new Software QA processes be introduced in an existing organization?
• A lot depends on the size of the organization and the risks involved. For large organizations with high-risk (in terms of lives or property) projects, serious management buy-in is required and a formalized QA process is necessary.
• Where the risk is lower, management and organizational buy-in and QA implementation may be a slower, step-at-a-time process. QA processes should be balanced with productivity so as to keep bureaucracy from getting out of hand.
• For small groups or projects, a more ad-hoc process may be appropriate, depending on the type of customers and projects. A lot will depend on team leads or managers, feedback to developers, and ensuring adequate communications among customers, managers, developers, and testers.
• The most value for effort will be in (a) requirements management processes, with a goal of clear, complete, testable requirement specifications embodied in requirements or design documentation and (b) design inspections and code inspections.
What is verification? validation?
Verification typically involves reviews and meetings to evaluate documents, plans, code, requirements, and specifications. This can be done with checklists, issues lists, walkthroughs, and inspection meetings. Validation typically involves actual testing and takes place after verifications are completed. The term 'IV & V' refers to Independent Verification and Validation.
What is a 'walkthrough'?
A 'walkthrough' is an informal meeting for evaluation or informational purposes. Little or no preparation is usually required.
What's an 'inspection'?
An inspection is more formalized than a 'walkthrough', typically with 3-8 people including a moderator, reader, and a recorder to take notes. The subject of the inspection is typically a document such as a requirements spec or a test plan, and the purpose is to find problems and see what's missing, not to fix anything. Attendees should prepare for this type of meeting by reading thru the document; most problems will be found during this preparation. The result of the inspection meeting should be a written report. Thorough preparation for inspections is difficult, painstaking work, but is one of the most cost effective methods of ensuring quality. Employees who are most skilled at inspections are like the 'eldest brother' in the parable in 'Why is it often hard for management to get serious about quality assurance?'. Their skill may have low visibility but they are extremely valuable to any software development organization, since bug prevention is far more cost-effective than bug detection.
What kinds of testing should be considered?
• Black box testing - not based on any knowledge of internal design or code. Tests are based on requirements and functionality.
• White box testing - based on knowledge of the internal logic of an application's code. Tests are based on coverage of code statements, branches, paths, conditions.
• unit testing - the most 'micro' scale of testing; to test particular functions or code modules. Typically done by the programmer and not by testers, as it requires detailed knowledge of the internal program design and code. Not always easily done unless the application has a well-designed architecture with tight code; may require developing test driver modules or test harnesses.
• incremental integration testing - continuous testing of an application as new functionality is added; requires that various aspects of an application's functionality be independent enough to work separately before all parts of the program are completed, or that test drivers be developed as needed; done by programmers or by testers.
• integration testing - testing of combined parts of an application to determine if they function together correctly. The 'parts' can be code modules, individual applications, client and server applications on a network, etc. This type of testing is especially relevant to client/server and distributed systems.
• functional testing - black-box type testing geared to functional requirements of an application; this type of testing should be done by testers. This doesn't mean that the programmers shouldn't check that their code works before releasing it (which of course applies to any stage of testing.)
• system testing - black-box type testing that is based on overall requirements specifications; covers all combined parts of a system.
• end-to-end testing - similar to system testing; the 'macro' end of the test scale; involves testing of a complete application environment in a situation that mimics real-world use, such as interacting with a database, using network communications, or interacting with other hardware, applications, or systems if appropriate.
• sanity testing or smoke testing - typically an initial testing effort to determine if a new software version is performing well enough to accept it for a major testing effort. For example, if the new software is crashing systems every 5 minutes, bogging down systems to a crawl, or corrupting databases, the software may not be in a 'sane' enough condition to warrant further testing in its current state.
• regression testing - re-testing after fixes or modifications of the software or its environment. It can be difficult to determine how much re-testing is needed, especially near the end of the development cycle. Automated testing tools can be especially useful for this type of testing.
• acceptance testing - final testing based on specifications of the end-user or customer, or based on use by end-users/customers over some limited period of time.
• load testing - testing an application under heavy loads, such as testing of a web site under a range of loads to determine at what point the system's response time degrades or fails.
• stress testing - term often used interchangeably with 'load' and 'performance' testing. Also used to describe such tests as system functional testing while under unusually heavy loads, heavy repetition of certain actions or inputs, input of large numerical values, large complex queries to a database system, etc.
• performance testing - term often used interchangeably with 'stress' and 'load' testing. Ideally 'performance' testing (and any other 'type' of testing) is defined in requirements documentation or QA or Test Plans.
• usability testing - testing for 'user-friendliness'. Clearly this is subjective, and will depend on the targeted end-user or customer. User interviews, surveys, video recording of user sessions, and other techniques can be used. Programmers and testers are usually not appropriate as usability testers.
• install/uninstall testing - testing of full, partial, or upgrade install/uninstall processes.
• recovery testing - testing how well a system recovers from crashes, hardware failures, or other catastrophic problems.
• security testing - testing how well the system protects against unauthorized internal or external access, willful damage, etc; may require sophisticated testing techniques.
• compatability testing - testing how well software performs in a particular hardware/software/operating system/network/etc. environment.
• exploratory testing - often taken to mean a creative, informal software test that is not based on formal test plans or test cases; testers may be learning the software as they test it.
• ad-hoc testing - similar to exploratory testing, but often taken to mean that the testers have significant understanding of the software before testing it.
• user acceptance testing - determining if software is satisfactory to an end-user or customer.
• comparison testing - comparing software weaknesses and strengths to competing products.
• alpha testing - testing of an application when development is nearing completion; minor design changes may still be made as a result of such testing. Typically done by end-users or others, not by programmers or testers.
• beta testing - testing when development and testing are essentially completed and final bugs and problems need to be found before final release. Typically done by end-users or others, not by programmers or testers.
• mutation testing - a method for determining if a set of test data or test cases is useful, by deliberately introducing various code changes ('bugs') and retesting with the original test data/cases to determine if the 'bugs' are detected. Proper implementation requires large computational resources.
What are 5 common problems in the software development process?
• poor requirements - if requirements are unclear, incomplete, too general, or not testable, there will be problems.
• unrealistic schedule - if too much work is crammed in too little time, problems are inevitable.
• inadequate testing - no one will know whether or not the program is any good until the customer complains or systems crash.
• featuritis - requests to pile on new features after development is underway; extremely common.
• miscommunication - if developers don't know what's needed or customer's have erroneous expectations, problems are guaranteed.
What are 5 common solutions to software development problems?
• solid requirements - clear, complete, detailed, cohesive, attainable, testable requirements that are agreed to by all players. Use prototypes to help nail down requirements.
• realistic schedules - allow adequate time for planning, design, testing, bug fixing, re-testing, changes, and documentation; personnel should be able to complete the project without burning out.
• adequate testing - start testing early on, re-test after fixes or changes, plan for adequate time for testing and bug-fixing.
• stick to initial requirements as much as possible - be prepared to defend against changes and additions once development has begun, and be prepared to explain consequences. If changes are necessary, they should be adequately reflected in related schedule changes. If possible, use rapid prototyping during the design phase so that customers can see what to expect. This will provide them a higher comfort level with their requirements decisions and minimize changes later on.
• communication - require walkthroughs and inspections when appropriate; make extensive use of group communication tools - e-mail, groupware, networked bug-tracking tools and change management tools, intranet capabilities, etc.; insure that documentation is available and up-to-date - preferably electronic, not paper; promote teamwork and cooperation; use protoypes early on so that customers' expectations are clarified.
What is software 'quality'?
Quality software is reasonably bug-free, delivered on time and within budget, meets requirements and/or expectations, and is maintainable. However, quality is obviously a subjective term. It will depend on who the 'customer' is and their overall influence in the scheme of things. A wide-angle view of the 'customers' of a software development project might include end-users, customer acceptance testers, customer contract officers, customer management, the development organization's management/accountants/testers/salespeople, future software maintenance engineers, stockholders, magazine columnists, etc. Each type of 'customer' will have their own slant on 'quality' - the accounting department might define quality in terms of profits while an end-user might define quality as user-friendly and bug-free.
What is 'good code'?
'Good code' is code that works, is bug free, and is readable and maintainable. Some organizations have coding 'standards' that all developers are supposed to adhere to, but everyone has different ideas about what's best, or what is too many or too few rules. There are also various theories and metrics, such as McCabe Complexity metrics. It should be kept in mind that excessive use of standards and rules can stifle productivity and creativity. 'Peer reviews', 'buddy checks' code analysis tools, etc. can be used to check for problems and enforce standards.

For C and C++ coding, here are some typical ideas to consider in setting rules/standards; these may or may not apply to a particular situation:
• minimize or eliminate use of global variables.
• use descriptive function and method names - use both upper and lower case, avoid abbreviations, use as many characters as necessary to be adequately descriptive (use of more than 20 characters is not out of line); be consistent in naming conventions.
• use descriptive variable names - use both upper and lower case, avoid abbreviations, use as many characters as necessary to be adequately descriptive (use of more than 20 characters is not out of line); be consistent in naming conventions.
• function and method sizes should be minimized; less than 100 lines of code is good, less than 50 lines is preferable.
• function descriptions should be clearly spelled out in comments preceding a function's code.
• organize code for readability.
• use whitespace generously - vertically and horizontally
• each line of code should contain 70 characters max.
• one code statement per line.
• coding style should be consistent throught a program (eg, use of brackets, indentations, naming conventions, etc.)
• in adding comments, err on the side of too many rather than too few comments; a common rule of thumb is that there should be at least as many lines of comments (including header blocks) as lines of code.
• no matter how small, an application should include documentaion of the overall program function and flow (even a few paragraphs is better than nothing); or if possible a separate flow chart and detailed program documentation.
• make extensive use of error handling procedures and status and error logging.
• for C++, to minimize complexity and increase maintainability, avoid too many levels of inheritance in class heirarchies (relative to the size and complexity of the application). Minimize use of multiple inheritance, and minimize use of operator overloading (note that the Java programming language eliminates multiple inheritance and operator overloading.)
• for C++, keep class methods small, less than 50 lines of code per method is preferable.
• for C++, make liberal use of exception handlers
What is 'good design'?
'Design' could refer to many things, but often refers to 'functional design' or 'internal design'. Good internal design is indicated by software code whose overall structure is clear, understandable, easily modifiable, and maintainable; is robust with sufficient error-handling and status logging capability; and works correctly when implemented. Good functional design is indicated by an application whose functionality can be traced back to customer and end-user requirements. (See further discussion of functional and internal design in 'What's the big deal about requirements?' in FAQ #2.) For programs that have a user interface, it's often a good idea to assume that the end user will have little computer knowledge and may not read a user manual or even the on-line help; some common rules-of-thumb include:
• the program should act in a way that least surprises the user
• it should always be evident to the user what can be done next and how to exit
• the program shouldn't let the users do something stupid without warning them.
What is SEI? CMM? ISO? IEEE? ANSI? Will it help?
• SEI = 'Software Engineering Institute' at Carnegie-Mellon University; initiated by the U.S. Defense Department to help improve software development processes.
• CMM = 'Capability Maturity Model', developed by the SEI. It's a model of 5 levels of organizational 'maturity' that determine effectiveness in delivering quality software. It is geared to large organizations such as large U.S. Defense Department contractors. However, many of the QA processes involved are appropriate to any organization, and if reasonably applied can be helpful. Organizations can receive CMM ratings by undergoing assessments by qualified auditors.

Level 1 - characterized by chaos, periodic panics, and heroic efforts required by individuals to successfully complete projects. Few if any processes in place; successes may not be repeatable.

Level 2 - software project tracking, requirements management, realistic planning, and configuration management processes are in place; successful practices can be repeated.

Level 3 - standard software development and maintenance processes are integrated throughout an organization; a Software Engineering Process Group is is in place to oversee software processes, and training programs are used to ensure understanding and compliance.

Level 4 - metrics are used to track productivity, processes, and products. Project performance is predictable, and quality is consistently high.

Level 5 - the focus is on continouous process improvement. The impact of new processes and technologies can be predicted and effectively implemented when required.

Perspective on CMM ratings: During 1997-2001, 1018 organizations were assessed. Of those, 27% were rated at Level 1, 39% at 2, 23% at 3, 6% at 4, and 5% at 5. (For ratings during the period 1992-96, 62% were at Level 1, 23% at 2, 13% at 3, 2% at 4, and
0.4% at 5.) The median size of organizations was 100 software engineering/maintenance personnel; 32% of organizations were U.S. federal contractors or agencies. For those rated at
Level 1, the most problematical key process area was in Software Quality Assurance.

• ISO = 'International Organisation for Standardization' - The ISO 9001:2000 standard (which replaces the previous standard of 1994) concerns quality systems that are assessed by outside auditors, and it applies to many kinds of production and manufacturing organizations, not just software. It covers documentation, design, development, production, testing, installation, servicing, and other processes. The full set of standards consists of: (a)Q9001-2000 - Quality Management Systems: Requirements; (b)Q9000-2000 - Quality Management Systems: Fundamentals and Vocabulary; (c)Q9004-2000 - Quality Management Systems: Guidelines for Performance Improvements. To be ISO 9001 certified, a third-party auditor assesses an organization, and certification is typically good for about 3 years, after which a complete reassessment is required. Note that ISO certification does not necessarily indicate quality products - it indicates only that documented processes are followed. Also see http://www.iso.ch/ for the latest information. In the U.S. the standards can be purchased via the ASQ web site at http://e-standards.asq.org/

• IEEE = 'Institute of Electrical and Electronics Engineers' - among other things, creates standards such as 'IEEE Standard for Software Test Documentation' (IEEE/ANSI Standard 829), 'IEEE Standard of Software Unit Testing (IEEE/ANSI Standard 1008), 'IEEE Standard for Software Quality Assurance Plans' (IEEE/ANSI Standard 730), and others.

• ANSI = 'American National Standards Institute', the primary industrial standards body in the U.S.; publishes some software-related standards in conjunction with the IEEE and ASQ (American Society for Quality).

• Other software development process assessment methods besides CMM and ISO 9000 include SPICE, Trillium, TickIT. and Bootstrap.
What is the 'software life cycle'?
The life cycle begins when an application is first conceived and ends when it is no longer in use. It includes aspects such as initial concept, requirements analysis, functional design, internal design, documentation planning, test planning, coding, document preparation, integration, testing, maintenance, updates, retesting, phase-out, and other aspects.
Will automated testing tools make testing easier?
• Possibly. For small projects, the time needed to learn and implement them may not be worth it. For larger projects, or on-going long-term projects they can be valuable.
• A common type of automated tool is the 'record/playback' type. For example, a tester could click through all combinations of menu choices, dialog box choices, buttons, etc. in an application GUI and have them 'recorded' and the results logged by a tool. The 'recording' is typically in the form of text based on a scripting language that is interpretable by the testing tool. If new buttons are added, or some underlying code in the application is changed, etc. the application might then be retested by just 'playing back' the 'recorded' actions, and comparing the logging results to check effects of the changes. The problem with such tools is that if there are continual changes to the system being tested, the 'recordings' may have to be changed so much that it becomes very time-consuming to continuously update the scripts. Additionally, interpretation and analysis of results (screens, data, logs, etc.) can be a difficult task. Note that there are record/playback tools for text-based interfaces also, and for all types of platforms.
• Other automated tools can include:
code analyzers - monitor code complexity, adherence to standards, etc.
coverage analyzers - these tools check which parts of the code have been exercised by a test, and may be oriented to code statement coverage, condition coverage, path coverage, etc.
memory analyzers - such as bounds-checkers and leak detectors.
load/performance test tools - for testing client/server and web applications under various load
levels.
web test tools - to check that links are valid, HTML code usage is correct, client-side and server-side programs work, a web site's interactions are secure.

other tools - for test case management, documentation management, bug reporting, and configuration management.