Showing posts with label Unit 5. Show all posts
Showing posts with label Unit 5. Show all posts

Thursday, August 21, 2014

CS2305 - PROGRAMMING PARADIGM

1. How can a subclass call a method or a constructor defined in a superclass?
Use the following syntax: super.myMethod(); To call a constructor of the superclass, just write super(); in the first line of the subclass’s constructor.

2. What’s the difference between a queue and a stack?
Stacks works by last-in-first-out rule (LIFO), while queues use the FIFO rule.

3. You can create an abstract class that contains only abstract methods. On the other hand, you can create an interface that declares the same methods. So can you use abstract classes instead of interfaces?
Sometimes. But your class may be a descendent of another class and in this case the interface is your only option.

4. What comes to mind when you hear about a young generation in Java?
Garbage collection.

5. What comes to mind when someone mentions a shallow copy in Java?
Object cloning.

6. If you’re overriding the method equals() of an object, which other method you might also consider?
hashCode()

Thursday, March 27, 2014

operating system

1. Explain the various types of computer systems. 
Mainframe systems
Desktop systems
Multiprocessor systems
Distributed systems
Clustered systems
Real-time systems
Handheld systems
2. Explain how protection is provided for the hardware resources by the operating system. 
Dual mode operation
I/O protection with diagram
Memory protection with diagram
CPU protection
3. What are the system components of an operating system and explain them? 
Process management
Main-memory management
File management
I/O management
Secondary storage management
Networking
Protection system
Command-interpreter system
4. Write about the various system calls. 
Process control
File management
Device management
Information maintenance
Communication
5. What are the various process scheduling concepts 
Scheduling queues with diagram
Queueing diagram
Schedulers

Context switch with diagram
6. Explain about interprocess communication. 
Message-passing system
Naming
Direct communication
Indirect communication
Synchronization
Buffering
7. Give an overview about threads. 
Thread definition
Motivation
Diagram
Benefits
User and kernel threads
8. Explain in detail about the threading issues. 
The fork and exec system calls
Cancellation
Signal handling
Threads pools
Thread-specific data
9. Write about the various CPU scheduling algorithms. 
First-come, first-served scheduling
Shortest-job-first scheduling
Priority Scheduling
Round-robin scheduling
Multilevel queue scheduling
Multilevel feedback queue scheduling
10.Write notes about multiple-processor scheduling and real-time scheduling. 
Homogeneous systems
Load sharing
Self-scheduling
Resource reservation
Priority inversion
Priority inheritance protocol
Dispatch latency with diagram
11.What is critical section problem and explain two process solutions and multiple process solutions? 
Critical section problem definition
Two process solutions
Algorithm 1, 2 & 3
Multiple-process solution with algorithm
12.Explain what semaphores are, their usage, implementation given to avoid busy waiting and binary semaphores.
Semaphore definition
Usage for mutual exclusion and process synchronization
Implementation to avoid spinlock using block and wakeup
Binary semaphores
13.Explain the classic problems of synchronization. 
The bounded-buffer problem with structure
The readers-writers problem with structure
The dining-philosophers problem with structure
14.Write about critical regions and monitors. 
Critical region definition
Implementation of the conditional-region construct
Monitor definition
Syntax of monitor
Schematic view of monitors
Monitor with condition variables
Monitor solution to dining-philosopher problem
15.Give a detailed description about deadlocks and its characterization 
Deadlock definition
Deadlock conditions
Mutual exclusion
Hold and wait
No pre-emption
Circular wait
Resource allocation graph
16.Explain about the methods used to prevent deadlocks 
Ensure that at least one of the following does not hold
Mutual exclusion
Hold and wait
No pre-emption
Circular wait
17.Write in detail about deadlock avoidance. 
Safe state and safe sequence
Diagram for safe, unsafe & deadlock states
Resource-allocation graph algorithm
18.Explain the Banker's algorithm for deadlock avoidance. 
Deadlock avoidance definition
Data structures used

Safety algorithm
Resource request algorithm
19.Give an account about deadlock detection. 
Single instance of each resource type
Wait-for graph
Several instances of a resource type
Detection-algorithm usage
20.What are the methods involved in recovery from deadlocks? 
Process termination
Resource pre-emption
21.Explain about contiguous memory allocation. 
Contiguous allocation
Memory protection with diagram
Memory allocation
First fit
Best fit
Worst fit
Fragmentation
22.Give the basic concepts about paging. 
Paging definition
Basic method-page, frame, page table, page number & page offset
Paging hardware diagram
TLB with diagram
Protection-protection bits & valid-invalid bits

Wednesday, March 26, 2014

Operating System

91.How can the index blocks be implemented in the indexed allocation scheme? 
The index block can be implemented as follows 
a. Linked scheme 
b. Multilevel scheme 
c. Combined scheme 

92.Define rotational latency and disk bandwidth. 
Rotational latency is the additional time waiting for the disk to rotate the desired sector to the disk head. The disk bandwidth is the total number of bytes transferred, divided by the time between the first request for service and the completion of the last transfer. 

93.How free-space is managed using bit vector implementation? 
The free-space list is implemented as a bit map or bit vector. Each block is represented by 1 bit. If the block is free, the bit is 1; if the block is allocated, the bit is 0. 

94.Define buffering. 
A buffer is a memory area that stores data while they are transferred between two devices or between a device and an application. Buffering is done for three reasons 
a. To cope with a speed mismatch between the producer and consumer of a data stream 
b. To adapt between devices that have different data transfer sizes 
c. To support copy semantics for application I/O 


95.Define caching. 
A cache is a region of fast memory that holds copies of data. Access to the cached copy is more efficient than access to the original. Caching and buffering are distinct functions, but sometimes a region of memory can be used for both purposes. 

Tuesday, March 25, 2014

Operating System

81.What are the various layers of a file system? 
The file system is composed of many different levels. Each level in the design uses the feature of the lower levels to create new features for use by higher levels. 
• Application programs 
• Logical file system 
• File-organization module 
• Basic file system 
• I/O control 
• Devices 

82.What are the structures used in file-system implementation? 
Several on-disk and in-memory structures are used to implement a file system 
a. On-disk structure include 
· Boot control block 
· Partition block 
· Directory structure used to organize the files 

· File control block (FCB) 
b. In-memory structure include 
· In-memory partition table 
· In-memory directory structure 
· System-wide open file table 
· Per-process open table 

83.What are the functions of virtual file system (VFS)? 
It has two functions 
a. It separates file-system-generic operations from their implementation defining a clean VFS interface. It allows transparent access to different types of file systems mounted locally. 
b. VFS is based on a file representation structure, called a vnode. It contains a numerical value for a network-wide unique file .The kernel maintains one vnode structure for each active file or directory. 

84.Define seek time and latency time. 
The time taken by the head to move to the appropriate cylinder or track is called seek time. Once the head is at right track, it must wait until the desired block rotates under the read-write head. This delay is latency time. 

85.What are the allocation methods of a disk space? 
Three major methods of allocating disk space which are widely in use are 
a. Contiguous allocation 
b. Linked allocation 

c. Indexed allocation 

Saturday, March 15, 2014

Computer Network

 16. Define substitution & transposition encryption?
.           Substitution: A character level encryption in which each character is replaced by another character in the set.
Transposition: A Character level encryption in which the characters retain their plaintext but the position of the character changes.

17. Define CGI?
.           CGI is a standard for communication between HTTP servers and executable programs. It is used in crating dynamic documents.

18. What are the requests messages support SNMP and explain it?
·         GET
·         SET
The former is used to retrieve a piece of state from some node and the latter is used to store a new piece of state in some node.

19. Define PGP?
            Pretty Good Privacy is used to provide security for electronic mail. It provides authentication, confidentiality, data integrity, and non repudiation.

20. Define SSH?

            Secure Shell is used to provide a remote login, and used to remotely execute commands and transfer files and also provide strong client/server authentication / message integrity.

Friday, March 14, 2014

Computer Network

6. What is the purpose of Domain Name System?
Domain Name System can map a name to an address and conversely an address to name.

7. Discuss the three main division of the domain name space.
Domain name space is divided into three different sections: generic domains, country domains & inverse domain.
Generic domain: Define registered hosts according to their generic behavior, uses generic suffixes.
Country domain: Uses two characters to identify a country as the last suffix.
Inverse domain: Finds the domain name given the IP address.

8. Discuss the TCP connections needed in FTP.
FTP establishes two connections between the hosts. One connection is used for data transfer, the other for control information. The control connection uses very simple rules of communication. The data connection needs more complex rules due to the variety of data types transferred.

9. Discuss the basic model of FTP.
The client has three components: the user interface, the client control process, and the client data transfer process. The server has two components: the server control process and the server data transfer process. The control connection is made between the control processes. The data connection is made between the data transfer processes.

10. Name four factors needed for a secure network?
 Privacy: The sender and the receiver expect confidentiality.
Authentication: The receiver is sure of the sender’s identity and that an imposter has not sent the message.
Integrity: The data must arrive at the receiver exactly as it was sent.

Non-Reputation: The receiver must able to prove that a received message came from a specific sender. 

Thursday, March 13, 2014

Computer Network

1. What is the function of SMTP?
The TCP/IP protocol supports electronic mail on the Internet is called Simple Mail Transfer (SMTP). It is a system for sending messages to other computer users based
on e-mail addresses. SMTP provides mail exchange between users on the same or different computers.

2. What is the difference between a user agent (UA) and a mail transfer agent (MTA)?
            The UA prepares the message, creates the envelope, and puts the message in the envelope. The MTA transfers the mail across the Internet.

3. How does MIME enhance SMTP?
            MIME is a supplementary protocol that allows non-ASCII data to be sent through SMTP. MIME transforms non-ASCII data at the sender site to NVT ASCII data and deliverers it to the client SMTP to be sent through the Internet. The server SMTP at the receiving side receives the NVT ASCII data and delivers it to MIME to be transformed back to the original data.

4. Why is an application such as POP needed for electronic messaging?
Workstations interact with the SMTP host, which receives the mail on behalf of every host in the organization, to retrieve messages by using a client-server protocol such as Post Office Protocol, version 3(POP3). Although POP3 is used to download messages from the server, the SMTP client still needed on the desktop to forward messages from the workstation user to its SMTP mail server.

 5. Give the format of HTTP request message?

Friday, February 28, 2014

Computer Network

11. How is a secret key different from public key?
In secret key, the same key is used by both parties. The sender uses this key and an encryption algorithm to encrypt data; the receiver uses the same key and the corresponding decryption algorithm to decrypt the data. In public key, there are two keys: a private key and a public key. The private key is kept by the receiver. The public key is announced to the public.

12. What is a digital signature?
Digital signature is a method to authenticate the sender of a message. It is similar to that of signing transactions documents when you do business with a bank. In network transactions, you can create an equivalent of an electronic or digital signature by the way you send data.

13. What are the advantages & disadvantages of public key encryption?
Advantages:
a) Remove the restriction of a shared secret key between two entities. Here each entity can create a pair of keys, keep the private one, and publicly distribute the other one.
 b) The no. of keys needed is reduced tremendously. For one million users to communicate, only two million keys are needed.
Disadvantage:
If you use large numbers the method to be effective. Calculating the cipher text using the long keys takes a lot of time. So it is not recommended for large amounts of text.

14. What are the advantages & disadvantages of secret key encryption?
Advantage:
Secret Key algorithms are efficient: it takes less time to encrypt a message. The reason is that the key is usually smaller. So it is used to encrypt or decrypt long messages.
Disadvantages:
a) Each pair of users must have a secret key. If N people in world want to use this method, there needs to be N (N-1)/2 secret keys. For one million people to communicate, a half-billion secret keys are needed.
b) The distribution of the keys between two parties can be difficult.

15. Define permutation.
            Permutation is transposition in bit level. 
Straight permutation: The no. of bits in the input and output are preserved.
Compressed permutation: The no. of bits is reduced (some of the bits are dropped).

Expanded permutation: The no. of bits is increased (some bits are repeated).