Web Tech./DS/OS/Java/Oracle/C++ Test Set 1

1)   From the following options indicate a correct association of the PROMPT, HEAD and RCPT commands with protocols where they are used?

Answer  Explanation 


PROMPT- This command is used in FTP
HEAD-used in HTTP asks for the response identical to the one that would correspond to a GET request but without the response body.
RCPT- used by SMTP. It is used to establish the return address or return path.

2)   Assume that an HTML form is designed to purchase the furniture. All the items required are being checked. After selecting the items the payment details are entered and the submit button is pressed. From the following options which one would you prefer to send the data to the server. Assume that all the security is handled.

a. Only POST
b. Only GET
c. Either of GET or POST
d. Neither GET nor POST
Answer  Explanation 

ANSWER: Either of GET or POST

For sending the data to the server either of them can be used.

3)   What does error 404 or Not Found error while accessing a URL mean?

a. The server could not find the requested URL
b. Requested HTML file is not available
c. The path to the interpreter of the script is not valid
d. The requested HTML file does not have sufficient permissions
Answer  Explanation 

ANSWER: The server could not find the requested URL

When we send a URL request it sends a request back to us but it may happen that the server may not find that URL that time it sends us error 404 or not found.

4)   In a Javascript Application what function can be used to send messages to users requesting for an text input?

a. Display()
b. Alert()
c. GetOutput()
d. Prompt()
Answer  Explanation 

ANSWER: Prompt()

This function is used when we want to input text in javascript.

5)   If you want to align text to the right side of an block element in a cascading style sheet (CSS) then which of the following property would you use?

a. Right align
b. Justify
c. Left align
d. Text align
Answer  Explanation 

ANSWER: Text align

The text align will be used according to the syntax of CSS.

6)   What are the minimum number of queues required to implement the priority queue?

a. 3
b. 2
c. 1
d. 5
Answer  Explanation 


Out of the 2 queues 1 queue is used for storing actual data and the other queue is used for storing priority data.

7)   From the following which data structure is used to perform recursion?

b. Stack
c. Binary Trees
d. Query
Answer  Explanation 


It has a LIFO property which helps it to remember the caller which helps it to return when the function returns.

8)   See the following C declaration
struct v
int n;
float a;
struct v * x[10];

Define x as

a. An array which has the same name as a program name
b. A structure with 10 elments in it
c. An array, where each element is a pointer to a structure of type node
d. A structure of 3 fields and an array of 10 elements
Answer  Explanation 

ANSWER: An array, where each element is a pointer to a structure of type node

x is an array denoted by x[10] having 10 elements which are pointers indicated by the symbol * to structure of type node is defined by struct node.

9)   Which is the major data structure used in RDBMS?

a. Trees
b. Stacks
c. Graph
d. Array
Answer  Explanation 


Array of structures is used majorly in RDBMS so that the data is maintained properly.

10)   By using which method sorting is not possible?

a. Insertion
b. Selection
c. Deletion
d. Exchange
Answer  Explanation 

ANSWER: Deletion

Deletion means removing so we cannot sort anything by using deletion.

11)    Which is the final form of testing used in the COTS software?

a. Beta testing
b. Module testing
c. Integration testing
d. Unit testing
Answer  Explanation 

ANSWER: Beta testing

This testing is used when a commercial software is released to a selected set of clients.

12)   From the following ________ is a type of abstraction?

a. Data
b. Design
c. Testing
d. All of the above
Answer  Explanation 


Data is a type of abstraction as we tend to search a lot of data during our research.

13)   A particular design is said to be a good design only when

a. Strongly cohesive and weakly coupled
b. Strongly cohesive
c. Weakly coupled
d. Strongly coupled and weakly cohesive
Answer  Explanation 

ANSWER: Strongly cohesive and weakly coupled

The main aim of a good design should be to maximize the interaction within a module and minimize the interaction between modules.

14)   What are the main factors that have to be kept in mind while planning for a software development?

a. People, Problem, Product, Process
b. Performance, Product, People
c. People, Problem, Productivity
d. Problem, Productivity,Portability
Answer  Explanation 

ANSWER: People, Problem, Product, Process

These are the main factors that are considered while planning for a software development.

15)   Which of the following is of importance in a software development life cycle?

a. Planning
b. Designing
c. Testing
d. Requirement gathering
Answer  Explanation 

ANSWER: Planning

This stage is important because unless we plan we cannot go ahead and this may disrupt or interrupt the development.

16)   From the following hardware where would the swap space reside?

a. RAM
b. ROM
c. Disk
d. On-chip cache
Answer  Explanation 


It resides in the disk as it is a part of the processor which makes it easy for swapping.

17)   Which of the following helps a system call to invoke?

a. Polling
b. A software interrupt
c. Call function
d. Queues
Answer  Explanation 

ANSWER: A software interrupt

Whenever a software is run which means it interrupts and the system call gets invoked.

18)   What is known as a race condition?

a. When a deadlock occurs
b. When it has a starvation and not a deadlock
c. When the result of a computation depends on the speed of the processes involved
d. When it cannot have a subroutine call.
Answer  Explanation 

ANSWER: When the result of a computation depends on the speed of the processes involved

A race condition generally occurs when two or more operations are being performed together. A simple example of a race condition can be a light switch.

19)   From the following statements which one is not a valid deadlock prevention scheme?

a. Number the resources uniquely and never request a lower numbered resource than the last one
b. Release all the resources before requesting for a new resource
c. Request all the resources before execution
d. Never request a resource after releasing any resources
Answer  Explanation 

ANSWER: Never request a resource after releasing any resources

The deadlock prevention has 4 methods to mutual exclusion,hold and wait,no preemption,circular wait.

20)   What is page cannibalizing?

a. Page swapping or Page replacements
b. Adding timestamps to the page
c. Avoiding page replacements
d. All the above
Answer  Explanation 

ANSWER: Page swapping or Page replacements

Page swapping is where data is being exchanged between the hard disk and RAM.

21)   Does the java.lang package need to be imported anytime?

a. Yes
b. No

Answer  Explanation 


No because it is by default loaded internally by the JVM

22)   Which environment variables are to be set on the machine in order to run the java programs?

a. java.util package
b. Classpath and Path
c. java.lang
d. java.util.io
Answer  Explanation 

ANSWER: Classpath and Path

If the classpath and the path are not set the java programs cannot run as expected.

23)   In which package do we have the gc() method?

a. java.lang package
b. java.util package
c. java.awt package
d. java.io package
Answer  Explanation 

ANSWER: java.lang package

The gc() method runs the garbage collector.

24)   By using which of the following method can the suspend thread be revived?

a. suspend() method
b. start() method
c. resume() method
d. end() method
Answer  Explanation 

ANSWER: resume() method

The resume()method is the method which is used to revive a thread which was suspended using the suspend() method.

25)   For using JDBC applications which of the following driver is preferable and efficient?

a. Type 1 driver
b. Type 2 driver
c. Type 3 driver
d. Type 4 driver
Answer  Explanation 

ANSWER: Type 4 driver

This driver is a pure java driver and it communicates with the vendors database with the help of a socket connection