Friday, July 31, 2015

Computer Networking Questions

1. If a computer on the network shares resources for others to use, it is called ____

a. Server
b. Client
c. Mainframe
Answer : a

2. Terminators are used in ______ topology.

a. Bus
b. Star
Answer : a

3. In _____ topology, if a computer’s network cable is broken, whole network goes down.
a. Bus
b. Star
Answer : a

4. For large networks, _______ topology is used.

a. Bus
b. Star
c. Ring
Answer : b

5. ISO stands for
a. International Standard Organization
b. International Student Organization
c. Integrated Services Organization
Answer : a

6. ISO OSI model is used in
a. Stand alone PC
b. Network environment
Answer : b

7. Network cable lies on _____ layer
a. Application
b. Network
c. Physical

8. ____ layer decides which physical pathway the data should take.
a. Application
b. Network
c. Physical
Answer : c

9. ISDN is an example of ______ network

a. Circuit switched
b. Packet switched
Answer : a

10. X.25 is an example of ______ network

a. Circuit switched
b. Packet switched
Answer : b

11. _____________ allows LAN users to share computer programs and data.

a. Communication server
b. Print server
c. File server
Answer : c

12. Print server uses ________ which is a buffer that holds data before it is send to the printer.
a. Queue
b. Spool
c. Node
Answer : b

13. A standalone program that has been modified to work on a LAN by including concurrency controls such as file and record locking is an example of____
a. LAN intrinsic software
b. LAN aware software
c. Groupware
d. LAN ignorant software
Answer : a

14. The ______ portion of LAN management software restricts access, records user activities and audit data etc.
a. Configuration management
b. Security management
c. Performance management
Answer : b

15. What is the max cable length of STP?
a. 100 ft
b. 200 ft
c. 100 m
d. 200 m
Answer : d

16. What is the max data capacity of STP?
a. 10 mbps
b. 100 mbps
c. 1000 mbps
d. 10000 mbps
Answer : b

17. Which connector STP uses?
a. BNC
b. RJ-11
c. RJ-45
d. RJ-69
Answer : c

18. What is the central device in star topology?
a. STP server
b. Hub/switch
c. PDC
d. Router
Answer : b

19. What is max data capacity for optical fiber cable?

a. 10 mbps
b. 100 mbps
c. 1000 mbps
d. 10000 mbps
Answer : c

20. Which of the following architecture uses CSMA/CD access method?
a. ARCnet
b. Ethernet
Answer : b

Thursday, July 30, 2015

Operating System Questions

1. An example of a distributed OS is

a.) Amoeba

b.) Unix 

c.) Microsoft DOS

d.) Multics

Ans.: a.)

2. In process management, Round-Robin is essentially the pre-emptive mechanism of

a.) FILO

b.) FIFO

c.) SSF

d.) LTF

Ans.: b.)

3. Which of the following treats hardware as a file system

a.) DOS

b.) UNIX

c.) Windows NT

d.) Linux



Ans.: b.)

4.) Find the pre-emptive scheduling algorithm from the following

a.) Round robin technique

b.) Priority based 

c.) Shortest job first

d.) Shortest job next

Ans.: a.) 

5.) The directory found in most UNIX systems is

a.) waitpid

b.) brk

c.) unmap

d.)usr

Ans.: d.)

6.) The storage replacement strategy program placed in the largest hole in memory is

a.)Best fit

b.) First fit

c.) Worst fit

d.) Conference fit

Ans.: c.)

7. Banker's algorithm is used for

a.) Deadlock recovery

b.) Deadlock avoidance

c.) Deadlock prevention

d.) Deadlock comparison

Ans.: b.)

8.) Peer hole optimization is an example of

a.) Local optimization

b.) Laptop optimization

c.) Data flow analysis

d.) Constant folding

Ans.: d.)

9.) A software used to create job queue is

a.) Linkage editor

b.) Interpreter

c.) Caller

d.) Spooler

Ans.: d.)

10.) Loading an OS from secondary memory to primary memory

a.) Compiling

b.) Booting

c.) Refreshing

d.) Recovering

Ans.: b.)

11.) A page fault 

a.) is an error specific page.

b.) is an acess to the page not currently in memory.

c.) occur when a page program occur in a page memory.

d.) pages used in previous page referencee.

Ans.: b.)

12.) Moving process from main memory to disk is called 

a.) Caching

b.) Swapping

c.) Termination

d.) Interruption

Ans.: b.)

13.) Windows is 

a.) Real time

b.) Multi-user

c.) Multi-structured

d.) Pre-emptive

Ans.: d.)

14.) The page replacement policy that suffers from belady's anamoly is 

a.) LRV

b.) FIFO

c.) LFU

d.) OPTIMAL

Ans.: b.)

15.) Cache memory is 

a.) High speed register

b.)Low speed RAM

c.) Non-Volatile ram

d.)High speed RAM

Ans.: d.)

Wednesday, July 29, 2015

Garbage collector

Garbage collector frees the programmer from worrying about
(A) memory leaks (B) dangering references
(C) creating new objects (D) recursion

Correct answer is B

UNIX and OS Important material for UGC NET Computer Science Exam

1. The data structure used by UNIX to maintain file identification is
Ans.: inode
Explanation: Every file has a separate inode and unique inode number.

2. What does the command 'wc' perform in unix?

Ans.: It performs word count.
Side note: 'wc-c' counts number of characters in a file.
'wc-l' counts lines in a file.

3. What meant by redirection?

Ans.: It is used to direct the flow of data to the file or from the file for input or output of another file.


 4. Difference between absolute path and relative path
Ans.: Absolute path: Exact path from root directory.
Relative path: Relative to current path.



 5. How to make a new file system in unix?
Ans.: 'mkfs' command is used to create a new file system.


6. NICE command is used to

Ans.: Set priority of a process
(Range: 0-39)

7. Use of FINGER command is

Ans.: To display information about all the users logged in.

8. ps command shows

Ans.: The process status of all the process current;y running on the system.

9. Which command is used to restrict incoming message?
Ans.: 'mesg'

10. What is the work of 'diff' and 'grep' commands

Ans.: 'diff' It tells the changes to be made to make the file identical.
'grep' It is a pattern search command.



11. What is the difference between multiprocessing and multitasking?
Ans.: Multiprocessing means the capacity of an OS to use more than one CPU in a single computer system.
Multitasking is the simultaneous execution of more than one program by switching between those program.

12. What is meant by process spawning?
Ans.: When the operating system at the explicit request of another process creates a new process is called as process spawning.

13. What is a kernel in OS?
Ans.: It is heart or core or nucleus of an operating system which is stored permanently in main memory.

14. What is a binary semaphore?
Ans.: Binary semaphor15. What is the term thrashing means?
Ans.: It is a situation in virtual memory where the processor spends most of its time swapping pages, instead of executing instructions resulting due to inordinate number of page faults.

16. What is the difference between turnaround time and response time?
Ans.: The interval between the submission of a job and its completion is called turnaround time.
The interval between the submission of request and first response to that request.

17. What is mounting in OS?
Ans.: The technique of combining two different file systems together.

18. When can a deadlock occur?
Ans.: 1. Mutual exclusion: Only one process can hold a resource at any point of time.

2. Hold and wait: A process must hold a resource and wait for another resource.

3. No pre-emption: No resource can be removed from a process holding it.

4. Circular wait: A cycle of processes exist such that each process holds atleast one resource and waits for another resource.

Note: All the four conditions should satisfy to ensure a deadlock to occur.

Also called as Hoffman's conditions.


19. Techniques to avoid deadlock?
Ans.: Prevention
Avoidance
Recovery
Detection

20. What is compaction?
Ans.: The technique of merging together all the free locations of memory into a single large memory block.
This technique works only when relocation is dynamic in nature.
es are extensively used to implement mutual exclusion and synchronize concurrent processes.
They take only two possible values '0' and '1'.



DISCRETE STRUCTURES

DISCRETE STRUCTURES
Q. A relation R in {1,2,3,4,5,6} is given by {(1,2),(2,3),(3,4),(4,4),(4,5)}. This relation is :
(A) reflexive
(B) symmetric
(C) transitive
(D) not reflexive, not symmetric, and not transitive

Ans:- D
Explanation:-
i) Reflexive : A relation R on a set A is reflexive if aRa for every a ϵ A, that is, if (a,a) ϵ R for every a ϵ A.
In the above relation, since the set contains the six elements 1,2,3,4,5 and 6. A relation R on A is reflexive if it contains the six pairs (1,1),(2,2),(3,3),(4,4),(5,5) and (6,6). Since the relation only contains (4,4) and not the rest, it is not reflexive.
ii) Symmetric : A relation R on a set A is symmetric if whenever aRb then bRa, that is if whenever (a,b) ϵ R then (b,a) ϵ R. R is not symmetric if there exists a,b ϵ A such that (a,b) ϵ R but (b,a) does not belong to R.
The above relation is not symmetric because (1,2) ϵ R but (2,1) does not belong to R. The same argument holds good for (2,3),(3,4) and (4,5) as well. So, the relation is not symmetric.
iii) Transitive: A relation R on a set A is transitive if whenever aRb and bRc then aRc, that is, whenever (a,b),(b,c) ϵ R then (a,c) ϵ R. The above relation is not transitive because (1,2), (2,3) ϵ R but (1,3) does not belong to R.
S, the above relation is not reflexive, not symmetric, and not transitive.

Monday, July 27, 2015

DBMS Questions



1. What is DBMS?

It is a collection of programs that helps the user to create and maintain a database.


2. What is database system?
 It is a combination of database and DBMS software.

3. Merits of DBMS:
 Control redundancy.
Restrict unauthorized access 
Allow multiple user interfaces
Enforce integrity constraints
Provide backup and recovery.

4.What are the levels of  Levels of abstraction?


 Physical level: The lowest level abstraction that describes how data is stored.

Logical level: Middle level of abstraction Which describes what data are stored and what is the relationship among the data
View level: Highest level of abstraction that describes only part of the database.

5. Two types of integrity rules
 Entity Integrity: Primary key cannot be NULL
Referential Integrity: Foreign key can either be NULL or should be a primary key of another relation.

6. What is the difference between physical data independence and logical data independence?
 Physical data independence: Modification in physical level should not affect logical level
Logical data independence: Modification in logical level should affect view level.

7. What is SDL?
 SDL means Storage Definition Language
It specifies internal schema and also mapping between two schemas.

8. What is a DML compiler?
 It helps to translate DML statements in the query language into low level instruction that is understood by the query evaluation engine.

9. What is relational algebra?
It is a procedural query language. 
It is a set of operations that take one or two relations as input and produce a new relation.

10. What is transparent DBMS?
 It is the DBMS that keeps its physical structure hidden from user.

11. If a relation is in 2NF, then
Every non-prime attribute is fully functionally dependent on each relation key.

12. The data type created by data abstraction process is called as
Class

13. An entity instance is a single occurence of 
An entity type

14. A relation which is in BCNF is always in which NF
3NF

15. 2-phase locking protocol suffers from
Deadlocks

16. Time stamp protocol suffers from
Frequent aborts, cascading rollbacks

17. In generalization, the difference between members of an entity is
Maximized.

18. Some of the commonly used Aggregate functions are
SUM, AVG, COUNT

19. A locked file can be 
* Modified by users with correct password
* Used to hide sensitive information.

20. A recursive foreign key 
References its own relation.

Data Structures solved question and answers

1. What is Data structure?

Ans.: The logical or mathematical representation of data.
It is way of organizing data that considers the data stored and also their relationship with each other.

2. Applications of data structures in computer science
Ans.: Compiler design
DBMS
Artificial intelligence
Statistical analysis
Numerical analysis
Graphics
Operating system
Simulation

3. What is the minimum number of queue needed to implement priority queue?


 Ans.: Two
Explanation: One queue for actual storing of data and another queue for storing priorities.

4. Arithmetic expressions cam be evaluated using
Ans.: Polish and reverse polish notations.

5. Methods used to store sequential files
Ans.: Straight merging
Polyphase sort
Distribution of initial runs.
Natural merging

6. How many different trees possible with 7 nodes. 
Ans.: 121
Explanation: 2^n-n
2^7-7=128-7=121

7. Which is the condition that occurs when two distinct key values are mapped to the same memory location.
Ans.: Collision


8. Simplest file structure is

Ans.: Sequential file structure

9. What is computational procedure
Ans.: An algorithm that does not terminate.
Example: Operating System

10. 8 queens problem can be solved by
Ans.: Backtracking method.

11. Which is the memory address of the first element of the array.
Base address.

12. Stack is also called as
Push down list.

13. A descending heap is also called as
Max heap

14. A linked list with no nodes is called as
Empty list or null list.

15. A strictly binary tree with n leaves have how many nodes.
2n-1 nodes



16. Which is the most commonly used hash functions to compute hash address.

Division method

17. Which graph shows basic blocks and the success of relationships
Flow graph

18.  Commonly used language processors are
Compilers
Interpreters
Assembler

19. In queue, the end from which data is inserted is called as
Rear

20. Through linked list, we can implement
Stack, queue, graph

21. Number of arcs incident to a node is called as
Predecessor

22. Methods of graph traversal
Depth First Search(DFS)
Breadth First Search(BFS)

23. Representation of two dimensional array in memory is called as
Row-major and column-major

24. A heap allows very efficient implementation of 
Priority queue

25. The shortest path in weighted graph or network is found out using
Dijkastra's algorithm
Kruskal algorithm

26. The smallest element of a array is called as
Lower bound.