Você está na página 1de 307

Section - I

Quantitative Aptitude (Arithmetic)

1. Four prime numbers are written in ascending order of their magnitudes the product of
the first three is 385 and that of the last three is 1001. The largest given prime number is

a. 11

b. 13

c. 17

d. 19

2. Mahavir deposited in the bank from Monday to Saturday the amounts of Rs. 87.80, Rs.
203.63, Rs. 3677.98, Rs. 92899.01, Rs. 66 and Rs. 554945.19 respectively. Find his total
deposit for this week

a. Rs. 651879.61

b. Rs. 652779.61

c. Rs. 650879.51

d. Rs. 655889.71

3. Amar deposited in Vijay Bank Rs. 259206.16 on Monday. Rs. 201890.48 on Tuesday, Rs.
284.16 on Wednesday. He withdrew Rs. 50000.00 on Thursday. He again deposited Rs.
230.01 on Friday and Rs. 72.62 on Saturday. Find his total balance in the bank for this week

a. Rs. 501783.43

b. Rs. 501683.43

c. Rs. 511693.43
d. Rs. 511683.43

4. I was born on October 17, 1927. How old I was on Jan. 26, 1978?

a. 49 years and 101 days

b. 50 years and 100 days

c. 50 years and 101 days

d. 50 years and 103 days

5. Find the total of the following amount

Rs. 1230.79, Rs. 11368.08, Rs. 203.63, Rs. 10314.89, Rs. 64.8, Rs. 101.00 and Rs. 3677.98

a. Rs. 27961.1

b. Rs. 26961.17

c. Rs. 26951.17

d. Rs. 25961.17

6. How many pieces, each of length 4.5 m can be cut of 225 m of wire?

a. 40

b. 54

c. 56

d. 50

7. Parkash and Girish were travelling together. Prakash paid Rs. 200 for their stay in a hotel
and Girish paid taxi fare of Rs. 80. If they have to share these expenses equally, then
a. Prakash should pay Rs. 60 to Girish

b. Girish should pay Rs. 120 to Prakash

c. Girish should pay Rs. 60 to Prakash

d. Prakash should pay Rs. 120 to Girish

8. Sum of the numbers from 1 to 20 is

a. 210

b. 110

c. 220

d. 105

9. Which of the following is equal to 115 x 15?

a. 105 x 10 + 115 x 5

b. 11 x 515

c. 1151 x 5

d. 110 x 15 + 5 x 15

10. The unit's digit in the sum (264)102 + (264)103 is

a. 0

b. 4

c. 6

d. 8
11. The smallest natural number by which the product of 3 consecutive even numbers is
always divisible is

a. 16

b. 32

c. 48

d. 96

12. The number of prime factors of (6)10 x (7)17 x (55)27 is

a. 54

b. 64

c. 81

d. 91

13. The total income of Hazari and Murari is Rs. 3000. Hazari spends 60% of his income and
Murari spends 80% of his income. If their savings are equal. Find the income of Hazari

a. Rs. 2000

b. Rs. 3000

c. Rs. 1500

d. Rs. 1000

14. Bholanath save 25% if his income, but due to dearness the expenses increased by 25%,
still he saves Rs. 30. Find his income

a. Rs. 400
b. Rs. 480

c. Rs. 450

d. Rs. 475

15. In a city 40% of the people are illiterate and 60% are poor. Among the rich 10% are
illiterate. What percentage of the poor population is illiterate?

a. 36%

b. 60%

c. 40%

d. None of these

Section - II

Mental Aptitude (Analytical Reasoning)

Directions (Q 1-5): Find the missing characters from the following series

1. ab _ a _ b _ a _ bba

a. aaab b. baba

c. abba d. baab

2. _ bc _ _ bb _ aabc

a. abab b. caab

c. acac d. aaab

3. cc _ a _ cabccb _ cca _ c _ ba
a. cbaba b. bacbc

c. bcabc d. abcbc

4. cba _ cb _ ccb _ c _

a. caac b. cbca

c. cbac d. cabc

5. aa _ cb _ aa _ _ bba _ ccb _

a. cabaac b. ababab

c. cbccab d. aaabca

6. If day before yesterday was Sunday then next Monday will be after ____ days.

a. 4 b. 5

c. 6
d. 7

7. If Sept 9 was Friday then the last Tuesday of the same Month will fall on

a. 25 b. 26

c. 27
d. 28

8. If the month of May begins on Sunday then the third Friday will fall on

a. 19 b. 20

c. 21
d. 22
9. If January 31 in a particular year falls on a Saturday then January 1 will be

a. Sunday b. Tuesday

c. Thursday d. Monday

10. At 6 PM the hour hand of a clock will point towards

a. North b. South

c. SW
d. SE

11. A boy walked 400 m north from his home, then he turned right and walked 100 m, then
he turned left and walked 500 m. in which direction is he walking now

a. North b. South

c. NE
d. NW

12. A car starts from a point A. Then it moves 4 KM towards South. Then it turns right and
moves 3 KM. How far is it from point A now.

a. 3 KM b. 4 KM

c. 5 KM d. 0 KM

13. 3, 10, 29, 66, _

a. 137
b. 127

c. 103
d. 218
14. 41, 29, 19, 11, _

a. 5 b. 6

c. 4
d. 3

15. ZXUQ : ACFJ : : NLIE : : 

a. KMQT b. KMPU

c. LMPT d. KMPT

Answers

Section - I Quantitative Aptitude (Arithmetic)

1. b, 2. a, 3. d, 4. c, 5. b

6. d, 7. c, 8. a, 9. d, 10. b

11. a, 12. d, 13. d, 14. b, 15. a

Section - II Mental Aptitude (Analytical Reasoning)

1. b, 2. c, 3. c, 4. a, 5. c

6. c, 7. c, 8. b, 9. c, 10. b

11. a, 12. c, 13. b, 14. a, 15. D


Vizag Steel Plant Management Trainees
(Technical) Exam preparation plan
Vizag Steel Plant Recruitment 2010: 195 Management Trainees (Technical)

Syllabus and Selection Procedure:


The selection process will consist of Two Stage Written Test (Preliminary and Final) followed
by an Interview.

Preliminary Written Test:


1. General Awareness

2. Mental Ability

3. General English

4. Verbal and Non Verbal Reasoning

5. Basics of Engineering

(A. MECHANICAL Engineering

B. CIVIL Engineering

C. INSTRUMENTATION Engineering

D. CHEMICAL Engineering

E. PRODUCTION Engineering

F. ELECTRICAL Engineering

G. IT (Information Technology) / Computers)

Final Written Test:


Final written test shall comprise separate papers for each discipline over and above one
paper on Aptitude and Knowledge in English.

Note: There will be negative marking for wrong answers


SAMPLE QUESTION PAPER
Section - I

Quantitative Aptitude (Arithmetic)

1. Four prime numbers are written in ascending order of their magnitudes the product of
the first three is 385 and that of the last three is 1001. The largest given prime number is
a. 11
b. 13
c. 17
d. 19

2. Mahavir deposited in the bank from Monday to Saturday the amounts of Rs. 87.80, Rs.
203.63, Rs. 3677.98, Rs. 92899.01, Rs. 66 and Rs. 554945.19 respectively. Find his total
deposit for this week
a. Rs. 651879.61
b. Rs. 652779.61
c. Rs. 650879.51
d. Rs. 655889.71

3. Amar deposited in Vijay Bank Rs. 259206.16 on Monday. Rs. 201890.48 on Tuesday, Rs.
284.16 on Wednesday. He withdrew Rs. 50000.00 on Thursday. He again deposited Rs.
230.01 on Friday and Rs. 72.62 on Saturday. Find his total balance in the bank for this week
a. Rs. 501783.43
b. Rs. 501683.43
c. Rs. 511693.43
d. Rs. 511683.43

4. I was born on October 17, 1927. How old I was on Jan. 26, 1978?
a. 49 years and 101 days
b. 50 years and 100 days
c. 50 years and 101 days
d. 50 years and 103 days

5. Find the total of the following amount

Rs. 1230.79, Rs. 11368.08, Rs. 203.63, Rs. 10314.89, Rs. 64.8, Rs. 101.00 and Rs. 3677.98
a. Rs. 27961.1
b. Rs. 26961.17
c. Rs. 26951.17
d. Rs. 25961.17
6. How many pieces, each of length 4.5 m can be cut of 225 m of wire?
a. 40
b. 54
c. 56
d. 50

7. Parkash and Girish were travelling together. Prakash paid Rs. 200 for their stay in a hotel
and Girish paid taxi fare of Rs. 80. If they have to share these expenses equally, then
a. Prakash should pay Rs. 60 to Girish
b. Girish should pay Rs. 120 to Prakash
c. Girish should pay Rs. 60 to Prakash
d. Prakash should pay Rs. 120 to Girish

8. Sum of the numbers from 1 to 20 is


a. 210
b. 110
c. 220
d. 105

9. Which of the following is equal to 115 x 15?


a. 105 x 10 + 115 x 5
b. 11 x 515
c. 1151 x 5
d. 110 x 15 + 5 x 15

10. The unit's digit in the sum (264)102 + (264)103 is


a. 0
b. 4
c. 6
d. 8

11. The smallest natural number by which the product of 3 consecutive even numbers is
always divisible is
a. 16
b. 32
c. 48
d. 96

12. The number of prime factors of (6)10 x (7)17 x (55)27 is


a. 54
b. 64
c. 81
d. 91

13. The total income of Hazari and Murari is Rs. 3000. Hazari spends 60% of his income and
Murari spends 80% of his income. If their savings are equal. Find the income of Hazari
a. Rs. 2000
b. Rs. 3000
c. Rs. 1500
d. Rs. 1000

14. Bholanath save 25% if his income, but due to dearness the expenses increased by 25%,
still he saves Rs. 30. Find his income
a. Rs. 400
b. Rs. 480
c. Rs. 450
d. Rs. 475

15. In a city 40% of the people are illiterate and 60% are poor. Among the rich 10% are
illiterate. What percentage of the poor population is illiterate?
a. 36%
b. 60%
c. 40%
d. None of these

Section - II

Mental Aptitude (Analytical Reasoning)

Directions (Q 1-5): Find the missing characters from the following series

1. ab _ a _ b _ a _ bba
a. aaab
b. baba
c. abba
d. baab

2. _ bc _ _ bb _ aabc
a. abab
b. caab
c. acac
d. aaab

3. cc _ a _ cabccb _ cca _ c _ ba
a. cbaba
b. bacbc
c. bcabc
d. abcbc

4. cba _ cb _ ccb _ c _
a. caac
b. cbca
c. cbac
d. cabc

5. aa _ cb _ aa _ _ bba _ ccb _
a. cabaac
b. ababab
c. cbccab
d. aaabca

6. If day before yesterday was Sunday then next Monday will be after ____ days.
a. 4
b. 5
c. 6
d. 7

7. If Sept 9 was Friday then the last Tuesday of the same Month will fall on
a. 25
b. 26
c. 27
d. 28

8. If the month of May begins on Sunday then the third Friday will fall on
a. 19
b. 20
c. 21
d. 22

9. If January 31 in a particular year falls on a Saturday then January 1 will be


a. Sunday
b. Tuesday
c. Thursday
d. Monday

10. At 6 PM the hour hand of a clock will point towards


a. North
b. South
c. SW
d. SE

11. A boy walked 400 m north from his home, then he turned right and walked 100 m, then
he turned left and walked 500 m. in which direction is he walking now
a. North
b. South
c. NE
d. NW

12. A car starts from a point A. Then it moves 4 KM towards South. Then it turns right and
moves 3 KM. How far is it from point A now.
a. 3 KM
b. 4 KM
c. 5 KM
d. 0 KM

13. 3, 10, 29, 66, _


a. 137
b. 127
c. 103
d. 218

14. 41, 29, 19, 11, _


a. 5
b. 6
c. 4
d. 3

15. ZXUQ : ACFJ : : NLIE : : 


a. KMQT
b. KMPU
c. LMPT
d. KMPT

Vizag Steel Plant MT Recruitment Books

Answers

Section - I Quantitative Aptitude (Arithmetic)


1. b, 2. a, 3. d, 4. c, 5. b

6. d, 7. c, 8. a, 9. d, 10. b

11. a, 12. d, 13. d, 14. b, 15. a

Section - II Mental Aptitude (Analytical Reasoning)

1. b, 2. c, 3. c, 4. a, 5. c

6. c, 7. c, 8. b, 9. c, 10. b

11. a, 12. c, 13. b, 14. a, 15. d


You might also like:

FCI Management Trainee Accounts Question Paper

IGNOU B.Ed. Exam Question paper

IGNOU BEd Exam Solved Paper for BEd Entrance 2009

Indira Gandhi National Open University (IGNOU) B.Ed. ...

R.A.S./R.T.S. (Pre.) Examination, 2008

LinkWithin

Posted by ALL EXAM QUESTION PAPERS at 11:44 AM 76 comments   Links to this post 
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Google Buzz
Labels: VIZAG STEEL

Reactions: 
Wednesday, January 20, 2010
Vizag Steel Plant (VSP) Management
Trainee Recruitment Exam.
Solved Sample Question Paper for Vizag Steel Plant (VSP) Management Trainee
Recruitment Exam. 

Section - I

Quantitative Aptitude (Arithmetic)


1. Four prime numbers are written in ascending order of their magnitudes the product of
the first three is 385 and that of the last three is 1001. The largest given prime number is

a. 11

b. 13

c. 17

d. 19

2. Mahavir deposited in the bank from Monday to Saturday the amounts of Rs. 87.80, Rs.
203.63, Rs. 3677.98, Rs. 92899.01, Rs. 66 and Rs. 554945.19 respectively. Find his total
deposit for this week

a. Rs. 651879.61

b. Rs. 652779.61

c. Rs. 650879.51

d. Rs. 655889.71

3. Amar deposited in Vijay Bank Rs. 259206.16 on Monday. Rs. 201890.48 on Tuesday, Rs.
284.16 on Wednesday. He withdrew Rs. 50000.00 on Thursday. He again deposited Rs.
230.01 on Friday and Rs. 72.62 on Saturday. Find his total balance in the bank for this week

a. Rs. 501783.43

b. Rs. 501683.43

c. Rs. 511693.43

d. Rs. 511683.43

4. I was born on October 17, 1927. How old I was on Jan. 26, 1978?

a. 49 years and 101 days

b. 50 years and 100 days

c. 50 years and 101 days


d. 50 years and 103 days

5. Find the total of the following amount

Rs. 1230.79, Rs. 11368.08, Rs. 203.63, Rs. 10314.89, Rs. 64.8, Rs. 101.00 and Rs. 3677.98

a. Rs. 27961.1

b. Rs. 26961.17

c. Rs. 26951.17

d. Rs. 25961.17

6. How many pieces, each of length 4.5 m can be cut of 225 m of wire?

a. 40

b. 54

c. 56

d. 50

7. Parkash and Girish were travelling together. Prakash paid Rs. 200 for their stay in a hotel
and Girish paid taxi fare of Rs. 80. If they have to share these expenses equally, then

a. Prakash should pay Rs. 60 to Girish

b. Girish should pay Rs. 120 to Prakash

c. Girish should pay Rs. 60 to Prakash

d. Prakash should pay Rs. 120 to Girish

8. Sum of the numbers from 1 to 20 is

a. 210

b. 110
c. 220

d. 105

9. Which of the following is equal to 115 x 15?

a. 105 x 10 + 115 x 5

b. 11 x 515

c. 1151 x 5

d. 110 x 15 + 5 x 15

10. The unit's digit in the sum (264)102 + (264)103 is

a. 0

b. 4

c. 6

d. 8

11. The smallest natural number by which the product of 3 consecutive even numbers is
always divisible is

a. 16

b. 32

c. 48

d. 96

12. The number of prime factors of (6)10 x (7)17 x (55)27 is

a. 54

b. 64

c. 81
d. 91

13. The total income of Hazari and Murari is Rs. 3000. Hazari spends 60% of his income and
Murari spends 80% of his income. If their savings are equal. Find the income of Hazari

a. Rs. 2000

b. Rs. 3000

c. Rs. 1500

d. Rs. 1000

14. Bholanath save 25% if his income, but due to dearness the expenses increased by 25%,
still he saves Rs. 30. Find his income

a. Rs. 400

b. Rs. 480

c. Rs. 450

d. Rs. 475

15. In a city 40% of the people are illiterate and 60% are poor. Among the rich 10% are
illiterate. What percentage of the poor population is illiterate?

a. 36%

b. 60%

c. 40%

d. None of these

Section - II

Mental Aptitude (Analytical Reasoning)

Directions (Q 1-5): Find the missing characters from the following series
1. ab _ a _ b _ a _ bba

a. aaab b. baba

c. abba d. baab

2. _ bc _ _ bb _ aabc

a. abab b. caab

c. acac d. aaab

3. cc _ a _ cabccb _ cca _ c _ ba

a. cbaba b. bacbc

c. bcabc d. abcbc

4. cba _ cb _ ccb _ c _

a. caac b. cbca

c. cbac d. cabc

5. aa _ cb _ aa _ _ bba _ ccb _

a. cabaac b. ababab

c. cbccab d. aaabca

6. If day before yesterday was Sunday then next Monday will be after ____ days.

a. 4 b. 5

c. 6
d. 7

7. If Sept 9 was Friday then the last Tuesday of the same Month will fall on

a. 25 b. 26

c. 27
d. 28

8. If the month of May begins on Sunday then the third Friday will fall on

a. 19 b. 20

c. 21
d. 22

9. If January 31 in a particular year falls on a Saturday then January 1 will be

a. Sunday b. Tuesday

c. Thursday d. Monday

10. At 6 PM the hour hand of a clock will point towards

a. North b. South

c. SW
d. SE

11. A boy walked 400 m north from his home, then he turned right and walked 100 m, then
he turned left and walked 500 m. in which direction is he walking now

a. North b. South

c. NE
d. NW

12. A car starts from a point A. Then it moves 4 KM towards South. Then it turns right and
moves 3 KM. How far is it from point A now.

a. 3 KM b. 4 KM

c. 5 KM d. 0 KM

13. 3, 10, 29, 66, _

a. 137
b. 127
c. 103
d. 218

14. 41, 29, 19, 11, _

a. 5 b. 6

c. 4
d. 3

15. ZXUQ : ACFJ : : NLIE : : 

a. KMQT b. KMPU

c. LMPT d. KMPT

Answers

Section - I Quantitative Aptitude (Arithmetic)

1. b, 2. a, 3. d, 4. c, 5. b

6. d, 7. c, 8. a, 9. d, 10. b

11. a, 12. d, 13. d, 14. b, 15. a

Section - II Mental Aptitude (Analytical Reasoning)

1. b, 2. c, 3. c, 4. a, 5. c

6. c, 7. c, 8. b, 9. c, 10. b

11. a, 12. c, 13. b, 14. a, 15. d


SAIL MT (Admin) and Technical Previous
Exam Paper
1. Which of the following is not a rabi crop?
(a) Wheat
(b) Barley
(c) Jute
(d) Rapeseed
Ans. (c)
2. Blue Revolution is associated with
(a) Fish
(b) Milk
(c) flower
(d) Litmus
Ans. (a)
3. Study the following features of farming in India:
1. The farmers voluntarily pool their land together cultivation.
2. They divide the produce in proportion to the land pooled.
3. They forego their proprietary rights in the land.
4. They cannot withdraw their land from the pool after due notice and paying for
the improvements.
Which of these features belong to cooperative farming?
(a) 1 and 2
(b) 1 and 3
(c) 2 and 4
(d) 3 and 4
Ans. (a)
4. Which of the following states is the main producer of Tendu Leaves?
(a) Orissa
(b) Madhya Pradesh
(c) Maharashtra
(c) Uttar Pradesh
Ans. (b)
5. The largest food crop of India is
(a) wheat
(b) rice
(c) maize
(d) gram
Ans. (b)
6. The maximum edible oil in India is produced from
(a) Rapeseed and mustard
(b) Til
(c) Sunflower
(d) Groundnut
Ans. (d)
7. Tobacco cultivated in Gujarat is mostly used for the manufacture of
(a) beedi
(b) cigarette
(c) zarda
(d) snuff powder
Ans. (a)
8. India is the largest producer of
(a) tobacco
(b) sugar
(c) tea
(d) rice
Ans. (c)
9. Rubber plantations are located mostly in
(a) Kerala and Karnataka
(b) Karnataka and Tamil Nadu
(c) Maharashtra and Kerala
(4) West Bengal and Kerala
Ans. (a)
10. Food grain production of India in million tones is nearest to the figure of
(a) 120
(b) 150
(c) 200
(d) 280
Ans. (c)
11. Self sufficiency in food, in the true sense of freedom from hunger, has not
been achieved in India inspite of a more than three-fold rise in food grains
production over 1950-1990. Which of the following are reason for it?
1. The Green Revolution has been restricted to small pockets of the country.
2. The cost of food is too high compared to the earnings of the poor.
3. Too much emphasis is laid on what and paddy compared to the coarse grains.
4. The gains of the green revolution have largely accrued to the cash crop rather
than food crops.
(a) 1, 2 and 3
(c) l, 3 and 4
(b) 1, 2 and 4
(d) 2, 3 and 4
Ans. (a)
12. The state which is known as the ‘Granary of India’ is
(a) Kerala
(b) U.P
(c) Haryana
(d) Punjab
Ans. (d)
13. Which of the following states is the Leading producer of tobacco?
(a) Tamil Nadu
(b) Karnataka
(c) Maharashtra
(d) Andhra Pradesh
Ans. (c)
14. Which of the following is the most important cash crop of West Bengal?
(a) Tea
(b) Jute
(c) Arecanut
(d) Coffee
(e) None of these
Ans. (b)
15. Sowing season for kharif crop is
(a) February-March
(b) June -July
(c) August –September
(d) October -December
Ans. (b)
16. Which one of the following crop combinations is characteristic of the upper
Bhramaputra Valley?
(a) Rice, Jute, Oilseeds
(b) Rice, Pulses, Oilseeds
(c) Rice, Tea, Oilseeds
(d) Tea, Gram, Jute
Ans. (c)
17. Which irrigation canal irrigates the portion of Thar Desert?
(a) Indira Gandhi canal
(b) Nangal canal
(c) Western Yamuna canal
(d) None of these
Ans. (c)
18. Which region in India is known as the ‘Rice Bowl of India’?
(a) North-east region
(b) Indo Gangetic plain
(c) Krishna -Godavari delta
(d) Kerala and Tamil Nadu
Ans. (c)
19. The highest milk producing breed of goat in India is
(a) Barbari
(b) Beetal
(c) Jamnapari
(d) Black Bengal
Ans. (b)
20. Which state produces maximum wheat in the country?
(a) Punjab
(b) U.P
(c) M.P
(d) Rajasthan
Ans. (b)
21. Which one of the following is not a part of the green revolution strategy?
(a) Irrigation
(b) Fertilizer
(c) High yielding varieties of seeds
(d) Crop insurance
Ans. (d)
22. Which of the following is not a rabi crop?
(a) Rice
(b) Wheat
(c) Linseed
(d) Barley
Ans. (a)
23. Which of the following states ranks first in the production of cotton in the
country?
(a) Maharashtra
(b) West Bengal
(c Punjab
(d) Gujarat
Ans. (d)
24. In India, the greatest variety of flowers is found in
(a) Assam
(b) Kerala
(c) U.P. hills
(d) Sikkim
Ans. (d)
25. Bangladesh has become a leading competitor of India in the world in the field
of
(a) cotton
(b) jute
(c) tea
(d) rice
Ans. (b)
26. Which of the following is the largest livestock ( in number) in India?
(a) Sheep
(b) Goats
(c) Buffaloes
(d) Horses and Ponies
Ans. (b)
27. Which of the following are true regarding Jhum cultivation in India?
1. It is largely practised in Assam
2 It is referred to as ‘slash and burn’ technique
3 in it, the fertility is exhausted in a few years
(a) l, 2 and 3
(b) l and 2
(c) 2 and 3
(d) 1 and 3
Ans. (a)
28. The most widely consumed cereal in India is
(a) barley
(b) wheat
(c) rice
(d) sorghum
Ans. (c)
29. Terrace farming is widely practised in
(a) Malabar coast
(b) Mountain areas
(c) Deserts
(d) Deccan plateau
Ans. (b)
30. Which of the following oilseed crops is grown most extensively in India?
(a) Mustard
(b) Linseed
(c) Sunflower
(d) Groundnut
Ans. (d)
31. Which of the following canals is not used for irrigation?
(a) Indira Gandhi Canal
(b) Buckingham Canal
(c) Western Yamuna Canal
(d) Upper Ganga Canal
Ans. (b)
32. In India, what percentage of area is covered by wheat growing regions?
(a) 10%
(b) 13.5%
(c) l7.8%
(d) 19.5%
Ans. (b)
33. The density of cattle population per 100 hectares of gross cropped area is the
highest in
(a) Uttar Pradesh
(b) Bihar
(c) Madhya Pradesh
(d) Haryana
Ans. (d)
34 The maximum density of canals lies in which of the following states?
(a) Tamil Nadu
(b) Andhra Pradesh
(c) Punjab
(d) Uttar Pradesh
Ans. (d)
35. Kerala is famous for the cultivation of
1. Coconut
2. Black pepper
3, Rubber
4. Groundnut
(a) l, 2 and 4
(b) 2, 3 ant 4
(c) l and 4
(d) l, 2, and 3
Ans. (d)
36. In the Northern Plains of India, rice is the main crop from Bengal to eastern
Uttar Pradesh, whereas in western Uttar Pradesh, Haryana and Punjab, wheat is
the main produce. This is because
(a) in the eastern region, fine clayey soil is avail able
(b) the western region remains cold during the winter season.
(c) the average rainfall decreases towards the west.
(d) the cultivation of rice requires cheap labour force
Ans. (b)
37. Jute is grown on a large scale in the delta of
(a) Ganges
(b) Sutlej
(c) Damodar
(d) Indus
Ans. (c)
38. Indian farmers insurance against crop failure is the process of one of the major
methods of risk coverage by Indian farmers in
(a) Dry farming
(b) Share cropping
(c) Mixed cropping
(d) Relay cropping
Ans. (c)
39. Consider the following statements:
I. The Green Revolution has been limited in its spatial coverage in India.
II. It has been confined mainly to Punjab, Haryana and western Uttar Pradesh.
Of these statements,
(a) both I and II are true.
(b) I is true but II is false.
(c) Both I and II are false.
(d) I is false but II is true.
Ans. (b)
40. India has attained self sufficiency in the production of
(a) coal
(b) iron
(c) nickel
(d) manganese
Ans. (d)
41. The largest coal deposit in India is in
(a) Godavari Valley
(b) Brahmani Valley
(c) Damodar Valley
(d) Satpura Valley
Ans. (c)
42. The headquarters of ONGC is situated at
(a) Bombay
(b) Delhi
(c) Dehradun
(d) Vadodara
Ans. (c)
43. Numaligarh in Assam is associated with which industry
(a) Oil refinery
(b) Automobile
(c) Cofee
(4) Cooperative farming
Ans. (a)
44. Mathura refinery receives crude oil from
(a) Cauvery basin
(b) Vadodara
(c) Kandla
(d) None of these
Ans. (d)
45. Which of the following power systems provides the highest quantity of energy
in India?
(a) Hydroelectric
(b) Nuclear
(c) Thermal
(d) Wind and tidal
Ans. (a)
46. Gujarat is the largest producer of salt in India because
(a) it has extensive dry coast
(b) its coastal waters are very saline
(c) it has extensive shallow seas
(d) besides producing salt from saline water it has reserves of rock salt
Ans. (c)
47. Coking coal is found in
(a) Rajasthan
(b) Madhya Pradesh
(c) Bihar
(d) Orissa
Ans. (c)
48. The new oil refinery in North India is going to be set up at
(a) Bhatinda
(b) Panipat
(c) Udaipur
(d) Mathura
(e) Udhampur
Ans. (b)
49. Manganese ore is abundantly found in
(a) Karnataka
(b) Rajasthan
(c) Madhya Pradesh
(d) Orissa
Ans. (c)
50. Bombay High is famous for
(a) atomic reactor
(b) steel plant
(c) chemical industry
(d) petroleum deposits
Ans. ( d)
http://allexamquestionpaper.blogspot.com/search/label/SAIL

1. All of the following are examples of real security and privacy


risks EXCEPT: 
A. hackers. 
B. spam. 
C. viruses. 
D. identity theft. 
Answer: B
2. A process known as ____________ is used by large retailers to
study trends. 
A. data mining 
B. data selection 
C. POS 
D. data conversion 
Answer: A
3. ____________terminals (formerly known as cash registers)
are often connected to complex inventory and sales computer
systems. 
A. Data 
B. Point-of-sale (POS) 
C. Sales 
D. Query 
Answer: B
4. A(n) ____________ system is a small, wireless handheld
computer that scans an item’s tag and pulls up the current
price (and any special offers) as you shop. 
A. PSS 
B. POS 
C. inventory 
D. data mining 
Answer: A
5. The ability to recover and read deleted or damaged files from a
criminal’s computer is an example of a law enforcement
specialty called: 
A. robotics. 
B. simulation. 
C. computer forensics. 
D. animation. 
Answer: C
6. Which of the following is NOT one of the four major data
processing functions of a computer? 
A. gathering data 
B. processing data into information 
C. analyzing the data or information 
D. storing the data or information 
Answer: C
7. ____________ tags, when placed on an animal, can be used to
record and track in a database all of the animal’s movements. 
A. POS 
B. RFID 
C. PPS 
D. GPS 
Answer: B
8. Surgeons can perform delicate operations by manipulating
devices through computers instead of manually. This technology is
known as: 
A. robotics. 
B. computer forensics. 
C. simulation. 
D. forecasting. 
Answer: A
9. Technology no longer protected by copyright, available to
everyone, is considered to be: 
A. proprietary. 
B. open. 
C. experimental. 
D. in the public domain. 
Answer: A
10. ____________ is the study of molecules and structures whose
size ranges from 1 to 100 nanometers. 
A. Nanoscience 
B. Microelectrodes 
C. Computer forensics 
D. Artificial intelligence 
Answer: A 
11. ____________ is the science that attempts to produce
machines that display the same type of intelligence that humans
do. 
A. Nanoscience 
B. Nanotechnology 
C. Simulation 
D. Artificial intelligence (AI) 
Answer: D
12. ____________ is data that has been organized or presented in
a meaningful fashion. 
A. A process 
B. Software 
C. Storage 
D. Information 
Answer: D
13. The name for the way that computers manipulate data into
information is called: 
A. programming. 
B. processing. 
C. storing. 
D. organizing. 
Answer: B
14. Computers gather data, which means that they allow users to
____________ data. 
A. present 
B. input 
C. output 
D. store 
Answer: B
15. After a picture has been taken with a digital camera and
processed appropriately, the actual print of the picture is
considered: 
A. data. 
B. output. 
C. input. 
D. the process. 
Answer: B
16. Computers use the ____________ language to process data. 
A. processing 
B. kilobyte 
C. binary 
D. representational 
Answer: C
17. Computers process data into information by working
exclusively with: 
A. multimedia. 
B. words. 
C. characters. 
D. numbers. 
Answer: D
18. In the binary language each letter of the alphabet, each number
and each special character is made up of a unique combination of: 
A. eight bytes. 
B. eight kilobytes. 
C. eight characters. 
D. eight bits. 
Answer: D
19. The term bit is short for: 
A. megabyte. 
B. binary language. 
C. binary digit. 
D. binary number. 
Answer: C
20. A string of eight 0s and 1s is called a: 
A. megabyte. 
B. byte. 
C. kilobyte. 
D. gigabyte. 
Answer: B
21. A ____________ is approximately one billion bytes. 
A. kilobyte 
B. bit 
C. gigabyte 
D. megabyte 
Answer: C
22. A ____________ is approximately a million bytes. 
A. gigabyte 
B. kilobyte 
C. megabyte 
D. terabyte 
Answer: C
23. ____________ is any part of the computer that you can
physically touch. 
A. Hardware 
B. A device 
C. A peripheral 
D. An application 
Answer: A
24. The components that process data are located in the: 
A. input devices. 
B. output devices. 
C. system unit. 
D. storage component. 
Answer: C
25. All of the following are examples of input devices EXCEPT a:
A. scanner. 
B. mouse. 
C. keyboard. 
D. printer. 
Answer: D
26. Which of the following is an example of an input device? 
A. scanner 
B. speaker 
C. CD 
D. printer 
Answer: A
27. All of the following are examples of storage devices EXCEPT: 
A. hard disk drives. 
B. printers. 
C. floppy disk drives. 
D. CD drives. 
Answer: B
28. The ____________, also called the “brains” of the
computer, is responsible for processing data. 
A. motherboard 
B. memory 
C. RAM 
D. central processing unit (CPU) 
Answer: D
29. The CPU and memory are located on the: 
A. expansion board. 
B. motherboard. 
C. storage device. 
D. output device. 
Answer: B
30. Word processing, spreadsheet, and photo-editing are examples
of: 
A. application software. 
B. system software. 
C. operating
system software. 
D. platform software. 
Answer: A
31. ____________ is a set of computer programs used on a
computer to help perform tasks. 
A. An instruction 
B. Software 
C. Memory 
D. A processor 
Answer: B
32. System software is the set of programs that enables your
computer’s hardware devices and ____________ software to
work together. 
A. management 
B. processing 
C. utility 
D. application 
Answer: D
33. The PC (personal computer) and the Apple Macintosh are
examples of two different: 
A. platforms. 
B. applications. 
C. programs. 
D. storage devices. 
Answer: A
34. Apple Macintoshes (Macs) and PCs use different
____________ to process data and different operating systems. 
A. languages 
B. methods 
C. CPUs 
D. storage devices 
Answer: C
35. Servers are computers that provide resources to other
computers connected to a: 
A. network. 
B. mainframe. 
C. supercomputer. 
D. client. 
Answer: A
36. Smaller and less expensive PC-based servers are replacing
____________ in many businesses. 
A. supercomputers 
B. clients 
C. laptops 
D. mainframes 
Answer: D
37. ____________ are specially designed computers that perform
complex calculations extremely rapidly. 
A. Servers 
B. Supercomputers 
C. Laptops 
D. Mainframes 
Answer: B
38. DSL is an example of a(n) ____________ connection. 
A. network 
B. wireless 
C. slow 
D. broadband 
Answer: D
39. The difference between people with access to computers and
the Internet and those without this access is known as the: 
A. digital divide. 
B. Internet divide. 
C. Web divide. 
D. broadband divide. 
Answer: A
40. ____________ is the science revolving around the use of
nanostructures to build devices on an extremely small scale. 
A. Nanotechnology 
B. Micro-technology 
C. Computer forensics 
D. Artificial intelligence 
Answer: A
41. Which of the following is the correct order of the four major
functions of a computer? 
A. Process à Output à Input à Storage 
B. Input à Outputà Process à Storage 
C. Process à Storage à Input à Output 
D. Input à Process à Output à Storage 
Answer: D
42. ____________ bits equal one byte. 
A. Eight 
B. Two 
C. One thousand 
D. One million 
Answer: A
43. The binary language consists of ____________ digit(s). 
A. 8 
B. 2 
C. 1,000 
D. 1 
Answer: B
44. A byte can hold one ____________ of data. 
A. bit 
B. binary digit 
C. character 
D. kilobyte 
Answer: C
45. ____________ controls the way in which the computer system
functions and provides a means by which users can interact with
the computer. 
A. The platform 
B. The operating system 
C. Application software 
D. The motherboard 
Answer: B
46. The operating system is the most common type of
____________ software. 
A. communication 
B. application 
C. system 
D. word-processing software 
Answer: C
47. ____________ are specially designed computer chips that
reside inside other devices, such as your car or your electronic
thermostat. 
A. Servers 
B. Embedded computers 
C. Robotic computers 
D. Mainframes 
Answer: B
48. The steps and tasks needed to process data, such as responses
to questions or clicking an icon, are called: 
A. instructions. 
B. the operating system. 
C. application software. 
D. the system unit. 
Answer: A
49. The two broad categories of software are: 
A. word processing and spreadsheet. 
B. transaction and application. 
C. Windows and Mac OS. 
D. system and application. 
Answer: D
50. The metal or plastic case that holds all the physical parts of the
computer is the: 
A. system unit. 
B. CPU. 
C. mainframe. 
D. platform. 
Answer: A
Fill in the Blank:
 Between PCs and Macs, the ____________ is the platform of choice
for graphic design and animation. 
Answer: Mac
 The ____________ is the program that manages the hardware of the
computer system, including the CPU, memory, storage devices, and
input/output devices. 
Answer: operating system
 The type of operating system software you use depends on your
computer’s ____________. 
Answer: platform
 ____________software helps you carry out tasks, such as typing a
document or creating a spreadsheet. 
Answer: Application
 ____________are the fastest and most expensive computers. 
Answer: Supercomputers
 A ____________ is approximately 1,000 bytes. 
Answer: kilobyte
 Input devices are used to provide the steps and tasks the computer
needs to process data, and these steps and tasks are called ____________. 
Answer: instructions
 A computer gathers data, processes it, outputs the data or information,
and ____________ the data or information. 
Answer: stores
 The binary language consists of two digits: ____________ and
____________. 
Answer: 0 and 1
 A string of ____________ 0s and 1s is called a byte. 
Answer: eight (8)
 The devices you use to enter data into a computer system are known as
____________ devices. 
Answer: input
 The devices on a computer system that let you see the processed
information are known as ____________ devices. 
Answer: output
 ____________ is the set of computer instructions or programs that
enables the hardware to perform different tasks. 
Answer: Software
 64. When you connect to the ____________, your computer is
communicating with a server at your Internet service provider (ISP). 
Answer: Internet
 ____________ are computers that excel at executing many different
computer programs at the same time. 
Answer: Mainframes
 ____________is the application of computer systems and techniques
to gather legal evidence. 
Answer: Computer forensics
 ____________ is the science that attempts to create machines that
will emulate the human thought process. 
Answer: Artificial intelligence (AI)
Macintosh computers use the Macintosh operating system (Mac OS), whereas
PCs generally run ____________ as an operating system. 
Answer: Microsoft Windows
 A process known as ____________ tracks trends and allows retailers
to respond to consumer buying patterns. 
Answer: data mining
 Hard disk drives and CD drives are examples of ____________
devices. 
Answer: storage
 You would use ____________ software to create spreadsheets, type
documents, and edit photos. 
Answer: application
 ____________ are computers that support hundreds or thousands of
users simultaneously. 
Answer: Mainframes
 ____________ is the term given to the act of stealing someone’s
identity and ruining their credit rating. 
Answer: Identity theft
 Surgeons are using ____________ to guide robots to perform delicate
surgery. 
Answer: computers
 Patient ____________ are life-sized mannequins that have a pulse
and a heartbeat and respond to procedures just like humans. 
Answer: simulators
True and False
 Currently, the performance of tasks by robots is based on
preprogrammed algorithms. 
Answer: True
 Data can be a number, a word, a picture, or a sound. 
Answer: True
 Strictly defined, a computer is a data processing device. 
Answer: True
 The discrepancy between the “haves” and “have-nots” with
regard to computer technology is commonly referred to as the digital society. 
Answer: False (digital divide)
 One of the benefits of becoming computer fluent is being a savvy
computer user and consumer and knowing how to avoid viruses, the programs
that pose threats to computer security. 
Answer: True
 Trend-spotting programs, developed for business, have been used to
predict criminal activity. 
Answer: True
 Employers do not have the right to monitor e-mail and network traffic
on employee systems used at work. 
Answer: False
 Clicking on an icon with the mouse is a form of giving an instruction to
the computer. 
Answer: True
 Output devices store instructions or data that the CPU processes. 
Answer: False (memory)
 The CPU and memory are located on a special circuit board in the
system unit called the motherboard. 
Answer: True
 Nanostructures represent the smallest human-made structures that can
be built. 
Answer: True
 The main difference between a supercomputer and a mainframe is that
supercomputers are designed to execute a few programs as quickly as possible,
whereas mainframes are designed to handle many programs running at the
same time (but at a slower pace). 
Answer: True
 Being computer fluent means that you should be able to build a
computer yourself. 
Answer: False
 Embedded computers are self-contained computer devices that have
their own programming and do not receive input. 
Answer: True
 A Web browser is a special device that is installed in your computer that
allows it to communicate with other devices on a network. 
Answer: False (network adapter)
 With a wireless network, it is easier to relocate devices. 
Answer: True
 The most common type of memory that the computer uses to process
data is ROM. 
Answer: False (RAM)

Computer General Knowledge QUESTION PAPER


1. Register is a
(a) Set of capacitors used to register input instructions in a digital computer
(b) Set of paper tapes and cards put in a file
(c) Temporary storage unit within the CPU having dedicated or general
purpose use
(d) part of the auxiliary memory
(e) device to convert current signal into voltage signal
Ans (c)
2. Errors in computer results could be due to
(a) encoding of data (b) transmission of data
(c) manipulation of data (d) all of the above
(e) none of above
Ans (d)
3. Terminal is a
(a) device used to give supply to a computer
(b) Point at which data may leave or enter the computer
(c) ending point in a program
(d) point where wires are interconnected
(e) an input/output device
Ans (b)
4. A computer programmer
(a) enters data into computer
(b) writes programs
(c) changes flow chart into instructions
(d) provides solutions to complex problems
(e) does total planning and thinking for a computer
Ans (e)
5.Pickup wrong definition
(a) Off line – is a system peripheral equipment not controlled by CPU
(b) Online – is system in which peripheral equipment is in direct contact with
CPU
(c) Peripherals – are hardware under the control of CPU, like punched card
readers, tapes, drums, disk, output devices
(d) PL/I is the acronym Peripheral Listing /Index
(e) Program or routine is a set sequence of instructions given to computer for
problem solving
Ans (d)
6. When a CD (Compact Disc used in audio and Video system) is seen in
sunlight, rainbow like colours are seen. This can be explained on the basis of
phenomenon of
(a) reflection and diffraction
(b) reflection and transmission
(c) diffraction and transmission
(d) refraction, diffraction and transmission
(e) none of these
Ans (d) Internet is an inter-networking of information from one part of the
network to any other provided the information is packed according to certain
conventions
7. For reproducing sound, a CD (Compact Disc) audio player uses a
(a) quartz crystal
(b) titanium needle
(c) laser beam
(d) barium titanium ceramic
(e) none of these
Ans (c) LASER stands for Light Amplification by Stimulated Emission of
Radiation
8. The memory of a computer is commonly expressed in terms of Kilobytes or
Megabytes. A byte is made up of
(a) eight decimal digits (b) eight binary digits
(c) two binary digits (d) two decimal digits (e) none of these
Ans (b) A byte consists of 8 bits—8 binary digits
9. Which of the following circuit is used as a ‘Memory device’ in computers?
(a) Rectifier (b) Flip-Flop (c) Comparator (d) Attenuator (e) none of these
Ans (b) Flip-flop refers to an electronic component which can adopt one of
two possible states -0 or 1. It acts as an electronic switch which gets changed
its state when input signals are received
10. Which is/are the main provisions of Information Technology (IT) Act,
2000?
(a) Legal recognition to digital signatures and documents.
(b) Finalisation of contracts through electronic media.
(c) Making hacking with computer system an office.
(d) All of the above
Ans (d)
11. Consider the following statements about Internet facility:
I. It serves as the largest one-line information system.
II. It provides the most dependable and latest mode for sending E-mail.
III. Recurring expenditure on communication E-mail is very high.
IV. It is often misused and has triggered cyber-crimes.
Which of these statements are correct?
(a) I, II and IV (b) I and IV (c) II, III and IV (d) II and III
Ans (a)
12. The computer device primarily used to provide hard copy is the
(a) CRT (b) Line Printer (c) Computer Console (d) Card Reader
Ans (b)
13. The unit of hardware, which an operator uses to monitor computer
processing, is the
(a) Card Reader (b) CPU (c) Line Printer (d) Console
Ans (d)
14. Computers can be classified in which of the following hierarchical orders?
(a) PC, Large, Super Micro, Super Computer
(b) Super Micro, PC, Large, Super Computer
(c) PC, Super Micro, Large, Super Computer
(d) Large, Super Micro, Super Computer, PC
Ans (c)
15. Which one of the following is a stored program machine?
(a) Micro-processor (b) Calculator
(c) Analog-computer (d) Micro-computer
Ans (d)
16. First generation computer systems used
(a) Transistors (b) Vacuum tubes
(c) Magnetic cores (d) Silicon chips
Ans (b)
17. Transistors are associated with which computer system?
(a) First generation (b) Fifth generation
(c) Second generation (d) None of these
Ans (c)
18. Charles Babbage invented
(a) ENIAC (b) Difference engine (c) Electronic computer (d) Punched card
Ans (b)
19. Who wrote the book ‘Computer Liberation and Dream Machine’, the first
book on personal computers?
(a) John McCarthy (b) Ted Nelson (c) Niklaus Wirth (d) Karl Capek
Ans (b)
20. Who was the inventor of mechanical calculator for adding numbers?
(a) Charles Babbage (b) Peano (c) Newton (d) Pascal
Ans (D)
21. The most widely used commercial programming computer language is
(a) BASIC (b) COBOL (c) FORTRAN (d) PASCAL
Ans (b) Cobol is abbreviated term for Common Business Oriented Language.
It is high level programme language designed to assist the task of programs by
enabling them to write programme in more simple manner
22.The brain of a computer is
(a) CPU (b) CD (c) Floppy disc (d) Megabyte
Ans (A) CPU is abbreviated term for Central Processing Unit. It is the
principal operating part of a computer
23. Foxpro’ is
(a) a medicine (b) a disease (c) a computer language (d) an animal
Ans (C)
24.In computer language, one kilobyte equals
(a) 1000 bytes (b) 1024 bytes (c) 100 bytes (d) 8 bytes
Ans (b) The memory of a computer is commonly expressed in terms of
kilobytes
25. Which one of the following is not a programming language of a computer?
(a) BASIC (b) FORTRAN (c) LASER (d) PASCAL
Ans (c)
26.Which of the following packages is used for composition in printing press?
(a) Lotus (b) dBase (c) Page Maker (d) Word Perfect
Ans (c)
27. Which one of the following is not a computer language?
(a) BASIC (b) COBOL (c) LOTUS (d) FORTRAN
Ans (d)
28. The individual within the operations group who ordinarily uses a variety of
keyboard devices, is the
(a) Data Clerk (b) Keypunch Operator
(c) Data Entry Clerk (d) Computer Operator
Ans (c)
29. An advantage of a distributed word processing network is
(a) increased number of reports handled
(b) less delay in inter-office communications
(c) greater corporate control over outputs
(d) All of these
Ans (b)
30.The retrieval of information from the computer is defined as
(a) collection of data (b) data retrieval operations
(c) output (d) data output collection
Ans (c)
31. Which of the following terms could be used to describe the concurrent
processing of computer programs via CRTs, on one computer system?
(a) Time sharing (b) On-line processing
(c) Interactive processing (d) All of these
Ans (d)
32.The daily processing of corrections to customer accounts best exemplifies
the processing mode of
(a) batch processing (b) real-time processing
(c) time-sharing (d) off-line processing
Ans (a)
33. A characteristic of card system is
(a) slowness in processing data
(b) using cards as records of transactions
(c) needing a larger data staff
(d) All of these
Ans (d)
34. Which of the following floppy sizes exists?
(a) 5.25 inches (b) 4.75 inches (c) 6 inches (d) 8 inches
Ans (a)
35. MS-DOS is the name of a/an
(a) Application software (b) Hardware
(c) System software (d) None of these
Ans (c)
36. A peripheral device used in a word processing system is
(a) Floppy disk (b) Magnetic card reader
(c) CRT (d) All of these
Ans (d)
37. A term used interchangeably with diskette is
(a) Disk cartridge (b) Disk pack
(c) Floppy disk (d) Packette disk
Ans (c)
38. An I/O device which provides photographic outputs for printing galleys, is
the
(a) Camera printer (b) Automatic typesetter
(c) Radix printer (d) All of these
Ans (d)
39. Which one of the following a file?
(a) Floppy disk (b) Magnetic drum (c) magnetic tape (d) None of these
Ans (d)
40.A decimal equivalent of m second is
(a) 0.000001 sec (b) 1000000 sec (c) 0.001 sec (d) 1000 sec
Ans (a)
41. A characteristic of the ASCII code is
(a) its limitation to a maximum of 96 character configuration
(b) its use of the zone codes 1010, 1011 and 1100
(c) its independence from Hollerith code
(d) All of these
Ans (c)
42. A temporary storage area, attached to the CPU, for I/O operations, is a
(a) Channel (b) Buffer (c) Register (d) Core
Ans (b)
43. The computer code for interchange of information between terminals is
(a) ASCII (b) BCD (c) BCDIC (d) Hollerith
Ans (a)
44. ROM is composed of
(a) Magnetic cores (b) Micro-processors
(c) Photoelectric cells (d) Floppy disks
Ans (b)
45. Which of the following is true?
(a) Plotters are not available for microcomputer systems
(b) Micro-computer are not programmed like conventional computers
(c) Mini-computers are task-oriented
(d) The contents of ROM are easily changed
Ans (c)
46. Magnetic disk a medium known as
(a) Serial access (b) Direct access (c) Sequential access (d) Sequential and
rotational access
Ans (b)
47. A dot-matrix printer
(a) is an input-output device (b) is an output device only
(c) is an input device only (d) None of these
Ans (b)
48.An octal number 237 is equal to the binary number
(a) 010 011 111 (b) 010 111 011
(c) 011 101 101 (d) 011 000 001
Ans (c)
49. A term associated with the comparison of processing speed is
(a) FFTS (b) MPG (c) MIPS (d) CPS
Ans (c)
50. The maximum size of a memory addressed by 12 bits is
(a) 1 K bytes (b) 16 K bytes (c) 32 K bytes (d) 4 K bytes
Ans (d)

Computer Department Competitive Exams question paper and Answer


Sheet
By admin on January 25th, 2011
Computer Department Competitive Exams question paper  and Answer Sheet
1. All of the following are examples of real security and privacy risks EXCEPT: 
A. hackers. 
B. spam. 
C. viruses. 
D. identity theft. 
Answer: B 
2. A process known as ____________ is used by large retailers to study trends. 
A. data mining 
B. data selection 
C. POS 
D. data conversion 
Answer: A 
3. ____________terminals (formerly known as cash registers) are often connected to complex
inventory and sales computer systems. 
A. Data 
B. Point-of-sale (POS) 
C. Sales 
D. Query 
Answer: B 
4. A(n) ____________ system is a small, wireless handheld computer that scans an item’s
tag and pulls up the current price (and any special offers) as you shop. 
A. PSS 
B. POS 
C. inventory 
D. data mining 
Answer: A 
5. The ability to recover and read deleted or damaged files from a criminal’s computer is
an example of a law enforcement specialty called: 
A. robotics. 
B. simulation. 
C. computer forensics. 
D. animation. 
Answer: C 
6. Which of the following is NOT one of the four major data processing functions of a
computer? 
A. gathering data 
B. processing data into information 
C. analyzing the data or information 
D. storing the data or information 
Answer: C 
7. ____________ tags, when placed on an animal, can be used to record and track in a
database all of the animal’s movements. 
A. POS 
B. RFID 
C. PPS 
D. GPS 
Answer: B 
8. Surgeons can perform delicate operations by manipulating devices through computers
instead of manually. This technology is known as: 
A. robotics. 
B. computer forensics. 
C. simulation. 
D. forecasting. 
Answer: A 
9. Technology no longer protected by copyright, available to everyone, is considered to be: 
A. proprietary. 
B. open. 
C. experimental. 
D. in the public domain. 
Answer: A 
10. ____________ is the study of molecules and structures whose size ranges from 1 to 100
nanometers. 
A. Nanoscience 
B. Microelectrodes 
C. Computer forensics 
D. Artificial intelligence 
Answer: A 
11. ____________ is the science that attempts to produce machines that display the same
type of intelligence that humans do. 
A. Nanoscience 
B. Nanotechnology 
C. Simulation 
D. Artificial intelligence (AI) 
Answer: D
12. ____________ is data that has been organized or presented in a meaningful fashion. 
A. A process 
B. Software 
C. Storage 
D. Information 
Answer: D 
13. The name for the way that computers manipulate data into information is called: 
A. programming. 
B. processing. 
C. storing. 
D. organizing. 
Answer: B 
14. Computers gather data, which means that they allow users to ____________ data. 
A. present 
B. input 
C. output 
D. store 
Answer: B 
15. After a picture has been taken with a digital camera and processed appropriately, the
actual print of the picture is considered: 
A. data. 
B. output. 
C. input. 
D. the process. 
Answer: B

16. Computers use the ____________ language to process data. 


A. processing 
B. kilobyte 
C. binary 
D. representational 
Answer: C 
17. Computers process data into information by working exclusively with:
A. multimedia. 
B. words. 
C. characters. 
D. numbers. 
Answer: D
18. In the binary language each letter of the alphabet, each number and each special character is made up
of a unique combination of: 
A. eight bytes. 
B. eight kilobytes. 
C. eight characters. 
D. eight bits. 
Answer: D 
19. The term bit is short for: 
A. megabyte. 
B. binary language. 
C. binary digit. 
D. binary number. 
Answer: C
20. A string of eight 0s and 1s is called a: 
A. megabyte. 
B. byte. 
C. kilobyte. 
D. gigabyte. 
Answer: B 
21. A ____________ is approximately one billion bytes. 
A. kilobyte 
B. bit 
C. gigabyte 
D. megabyte 
Answer: C 
22. A ____________ is approximately a million bytes. 
A. gigabyte 
B. kilobyte 
C. megabyte 
D. terabyte 
Answer: C 
23. ____________ is any part of the computer that you can physically touch. 
A. Hardware 
B. A device 
C. A peripheral 
D. An application 
Answer: A
24. The components that process data are located in the: 
A. input devices. 
B. output devices. 
C. system unit. 
D. storage component. 
Answer: C 
25. All of the following are examples of input devices EXCEPT a: 
A. scanner. 
B. mouse. 
C. keyboard. 
D. printer. 
Answer: D 
26. Which of the following is an example of an input device? 
A. scanner 
B. speaker 
C. CD 
D. printer 
Answer: A 
27. All of the following are examples of storage devices EXCEPT: 
A. hard disk drives. 
B. printers. 
C. floppy disk drives. 
D. CD drives. 
Answer: B 
28. The ____________, also called the “brains†of the computer, is responsible for processing data. 
A. motherboard 
B. memory 
C. RAM 
D. central processing unit (CPU) 
Answer: D 
29. The CPU and memory are located on the: 
A. expansion board. 
B. motherboard. 
C. storage device. 
D. output device. 
Answer: B 
30. Word processing, spreadsheet, and photo-editing are examples of: 
A. application software. 
B. system software. 
C. operating system software. 
D. platform software. 
Answer: A 
31. ____________ is a set of computer programs used on a computer to help perform tasks. 
A. An instruction 
B. Software 
C. Memory 
D. A processor 
Answer: B 
32. System software is the set of programs that enables your computer’s hardware devices and
____________ software to work together. 
A. management 
B. processing 
C. utility 
D. application 
Answer: D 
33. The PC (personal computer) and the Apple Macintosh are examples of two different: 
A. platforms. 
B. applications. 
C. programs. 
D. storage devices. 
Answer: A 
34. Apple Macintoshes (Macs) and PCs use different ____________ to process data and different operating
systems. 
A. languages 
B. methods 
C. CPUs 
D. storage devices 
Answer: C 
35. Servers are computers that provide resources to other computers connected to a: 
A. network. 
B. mainframe. 
C. supercomputer. 
D. client. 
Answer: A 
36. Smaller and less expensive PC-based servers are replacing ____________ in many businesses. 
A. supercomputers 
B. clients 
C. laptops 
D. mainframes 
Answer: D 
37. ____________ are specially designed computers that perform complex calculations extremely rapidly. 
A. Servers 
B. Supercomputers 
C. Laptops 
D. Mainframes 
Answer: B 
38. DSL is an example of a(n) ____________ connection. 
A. network 
B. wireless 
C. slow 
D. broadband 
Answer: D 
39. The difference between people with access to computers and the Internet and those without this access
is known as the: 
A. digital divide. 
B. Internet divide. 
C. Web divide. 
D. broadband divide. 
Answer: A
40. ____________ is the science revolving around the use of nanostructures to build devices on an extremely
small scale. 
A. Nanotechnology 
B. Micro-technology 
C. Computer forensics 
D. Artificial intelligence 
Answer: A 
41. Which of the following is the correct order of the four major functions of a computer? 
A. Process à Output à Input à Storage 
B. Input à Outputà Process à Storage 
C. Process à Storage à Input à Output 
D. Input à Process à Output à Storage 
Answer: D 
42. ____________ bits equal one byte. 
A. Eight 
B. Two 
C. One thousand 
D. One million 
Answer: A 
43. The binary language consists of ____________ digit(s). 
A. 8 
B. 2 
C. 1,000 
D. 1 
Answer: B 
44. A byte can hold one ____________ of data. 
A. bit 
B. binary digit 
C. character 
D. kilobyte 
Answer: C 
45. ____________ controls the way in which the computer system functions and provides a means by which
users can interact with the computer. 
A. The platform 
B. The operating system 
C. Application software 
D. The motherboard 
Answer: B 
46. The operating system is the most common type of ____________ software. 
A. communication 
B. application 
C. system 
D. word-processing software 
Answer: C 
47. ____________ are specially designed computer chips that reside inside other devices, such as your car or
your electronic thermostat. 
A. Servers 
B. Embedded computers 
C. Robotic computers 
D. Mainframes 
Answer: B 
48. The steps and tasks needed to process data, such as responses to questions or clicking an icon, are
called: 
A. instructions. 
B. the operating system. 
C. application software. 
D. the system unit. 
Answer: A 
49. The two broad categories of software are: 
A. word processing and spreadsheet. 
B. transaction and application. 
C. Windows and Mac OS. 
D. system and application. 
Answer: D 
50. The metal or plastic case that holds all the physical parts of the computer is the: 
A. system unit. 
B. CPU. 
C. mainframe. 
D. platform. 
Answer: A

Operating System Question Answer for Competitive


Exams
1. Pre-emptive scheduling, is the strategy of temporarily suspending a running process-
Ans: before the CPU time slice expires

2. Mutual exclusion problem occurs -


Ans: among processes that share resources

3. Sector interleaving in disks is done by -


Ans: the operating system

4. Disk scheduling involves deciding-


Ans: the order in which disk access requests must be serviced

5. Dirty bit is used to show the -


Ans: page that is modified after being loaded into cache memory

6. Fence register is used for-


Ans: memory protection.
7. The first-fit, best-fit and worst-fit algorithm can be used for-
Ans: contiguous allocation of memory

8. Give example of single-user operating systems-


Ans: MS-DOS, XENIX

Objective Type Computer Science Questions for


Public Sector Recruitment Exam
1. The problem of fragmentation arises in
(a) static storage Allocation
(b) stack allocation of storage
(c) stack allocation with dynamic binding
(d) Heap allocation

Ans: (d)

2. The process of organizing the memory into two banks to allow 8 and 16-bit data operation is
called

a. Bank Switching
b. Indexed Mapping
c. Two-way memory interleaving
d. Memory segmentation

Ans: (c)

3. Memory refreshing may be done

a. by the CPU that contains a special regress counter, only


b. by an external refresh controller, only
c. either by the CPU or by an external refresh controller
d. none of the above

Ans: (c)

4. The use of hardware in memory management is through segment relocation and protection is

a. to perform address translation to reduce size of the memory


b. to perform address translation to reduce execution time overhead
c. both (a) and (b)
d. none of the above

Ans: (c)

5. Thrashing occurs when

a. too much of the time is spent in waiting to swap between memory and disk
b. two processes try to access the same resource
c. the size of the data to be inserted is less than the size of a page in memory
d. the processor's mapping table discovers that the program is trying to use an address that
doesn't currently exist

Ans: (a)

Objective Type Question Answers of Operating


System
1. Which of the command is used to remove files ?
a. erase
b. rm
c. delete
d. dm

Ans: b

2. Which of the following command is used to count just the number of lines contained in a file ?
a. wc-1
b. wc-w
c.wc-c
d. wc-r

Ans: a

3. Which command is used to copy a file wb with the same name from the programs directory to
the misc. directory ?
a. copy programs/wb misc/wb
b. cp programs/wb misc
c. copy a:programs/wb b:misc/wb
d. tar programs/wb misc/wb

Ans: b

4. The commonly used UNIX commands like date, Is, cat, etc. are stored in
a. /dev directory
b. /bin and /usr/bin directories
c. /unix directory
d. /tmp directory

Ans: b

5. Which of the following directories contain all the files created by a user, including his login
directory ?
a. /tmp
b. /usr
c. /etc
d. /dev

Ans: b

6. Which command is used to copy the three files wb, colllect and mon into the misc directory,
under the same, when you were currently in the programs directory ?
a. copy wb collect mon/misc
b. cp wb collect mon ../misc
c. copy wb ../misc collect ../misc mon ../misc
d. tar wb collect mon/misc

Ans: b

7. Which of the following command is used to display the directory attributes rather than its
contents ?
a. 1s-1-d
b. Is-x
c. Is-1
d. is-F

Ans: a

8. Which command is used to remove a directory


a. rd
b. dldir
c. rmdir
d. rdir

Ans: c

9. Which command is used to list out all the hidden files along with the other files ?
a. Is-1
b. Is-F
c. Is-x
d Is-a

Ans: d

10. The file that contains a set of instructions which are performed when a user logs in, is
a) .exrc
b) .profile
c) autoexec.bat
d) .autoexec

Ans: b

Relational Database Design and SQL Questions


1. In a relational schema, each tuple is divided into fields called
a. Relations
b. Domains
c. Queries
d. All of the above

Ans: b

2. A logical schema
a. is the entire database
b. is a standard way of organizing information into accessible parts
c. describes how data is actually stored on disk
d. all of the above

Ans: b
3. A form defines
a. where data are placed on the screen
b. the width of each field
c. both (a) and (b)
d. All of the above

Ans: c

4. A top-to-bottom relationship among the items in a database is established by a


a. Hierarchical Schema
b. Network Schema
c. Relational Schema
d. All of the above

Ans: b

5. A good query system


a. can accept English language commands
b. allows non-programmers to access information stored in a database
c. can be accessed only by data processing professionals
d. Both (a) and (b)

Ans: b

6. A report form
a. appears on the computer monitor during data entry
b. is used during report generation to format data
c. Both a and b
d. All of the above

Ans: b

7. A list consists of last names, first names, addresses and pincodes if all people in the list have
the same last and the same pincode, a useful key would be
a. the pincode
b. the last name
c. a compound key consisting of the first name and the last name
d. all of the above

Ans: c

8. A command that lets you change one or more fields in a record is


a. Insert
b. Modify
c. Look-up
d. All of the above

Ans: b

10. Which of the following contains a complete record of all activity that affected the contents of
a database during a certain period of time ?
a. Report writer
b. Query language
c. Data manipulation language
d. Transaction Log

Ans: d

Posted by Anil Kant at 12:43 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Computer Science and Applications, PSU Exam Papers, SQL Server Interview Questions,UGC
Net

Saturday, August 28, 2010


DBMS Interview Questions & Answers
What is normalization?
ANSWER:
It is a process of analysing the given relation schemas based on their Functional Dependencies
(FDs) and primary key to achieve the properties
• Minimizing redundancy
• Minimizing insertion, deletion and update anomalies.

What is Functional Dependency?


ANSWER:
A Functional dependency is denoted by X Y between two sets of attributes X and Y that are
subsets of R specifies a constraint on the possible tuple that can form a relation state r of R.
The constraint is for any two tuples t1 and t2 in r if t1[X] = t2[X] then they have t1[Y] = t2[Y]. This
means the value of X component of a tuple uniquely determines the value of component Y.

When is a functional dependency F said to be minimal?


ANSWER:
• Every dependency in F has a single attribute for its right hand side.
• We cannot replace any dependency X A in F with a dependency Y A where Y is a proper
subset of X and still have a set of dependency that is equivalent to F.
• We cannot remove any dependency from F and still have set of dependency that is equivalent
to F.

What is Multivalued dependency?


ANSWER:
Multivalued dependency denoted by X Y specified on relation schema R, where X and Y are
both subsets of R, specifies the following constraint on any relation r of R: if two tuples t1 and t2
exist in r such that t1[X] = t2[X] then t3 and t4 should also exist in r with the following properties
• t3[x] = t4[X] = t1[X] = t2[X]
• t3[Y] = t1[Y] and t4[Y] = t2[Y]
• t3[Z] = t2[Z] and t4[Z] = t1[Z]
where [Z = (R-(X U Y)) ]

What is Lossless join property?


ANSWER:
It guarantees that the spurious tuple generation does not occur with respect to relation schemas
after decomposition.
What is 1 NF (Normal Form)?
ANSWER:
The domain of attribute must include only atomic (simple, indivisible) values.

What is Fully Functional dependency?


ANSWER:
It is based on concept of full functional dependency. A functional dependency X Y is full
functional dependency if removal of any attribute A from X means that the dependency does not
hold any more.

What is 2NF?
ANSWER:
A relation schema R is in 2NF if it is in 1NF and every non-prime attribute A in R is fully
functionally dependent on primary key.

What is 3NF?
ANSWER:
A relation schema R is in 3NF if it is in 2NF and for every FD X A either of the following is true
• X is a Super-key of R.
• A is a prime attribute of R.
In other words, if every non prime attribute is non-transitively dependent on primary key.

What is BCNF (Boyce-Codd Normal Form)?


ANSWER:
A relation schema R is in BCNF if it is in 3NF and satisfies an additional constraint that for every
FD X A, X must be a candidate key.

What is 4NF?
ANSWER:
A relation schema R is said to be in 4NF if for every Multivalued dependency X Y that holds
over R, one of following is true
• X is subset or equal to (or) XY = R.
• X is a super key.

What is 5NF?
ANSWER:
A Relation schema R is said to be 5NF if for every join dependency {R1, R2, ..., Rn} that holds
R, one the following is true
• Ri = R for some i.
• The join dependency is implied by the set of FD, over R in which the left side is key of R.

Posted by Anil Kant at 2:30 AM 1 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: DBMS Interview Questions, SQL Server Interview Questions

Friday, August 27, 2010


Some Useful DBMS Interview Questions Answers
What is an attribute?
ANSWER:
It is a particular property, which describes the entity.

What is a Relation Schema and a Relation?


ANSWER:
A relation Schema denoted by R(A1, A2, …, An) is made up of the relation name R and the list
of attributes Ai that it contains. A relation is defined as a set of tuples. Let r be the relation which
contains set tuples (t1, t2, t3, ..., tn). Each tuple is an ordered list of n-values t=(v1,v2, ..., vn).

What is degree of a Relation?


ANSWER:
It is the number of attribute of its relation schema.

What is Relationship?
ANSWER:
It is an association among two or more entities.

What is Relationship set?


ANSWER:
The collection (or set) of similar relationships.

What is Relationship type?


ANSWER:
Relationship type defines a set of associations or a relationship set among a given set of entity
types.

What is degree of Relationship type?


ANSWER:
It is the number of entity type participating.

What is Data Storage - Definition Language?


ANSWER:
The storage structures and access methods used by database system are specified by a set of
definition in a special type of DDL called data storage-definition language.

What is DML (Data Manipulation Language)?


ANSWER:
This language that enable user to access or manipulate data as organised by appropriate data
model.
• Procedural DML or Low level: DML requires a user to specify what data are needed and how
to get those data.
• Non-Procedural DML or High level: DML requires a user to specify what data are needed
without specifying how to get those data.

What is DML Compiler?


ANSWER:
It translates DML statements in a query language into low-level instruction that the query
evaluation engine can understand.

What is Query evaluation engine?


ANSWER:
It executes low-level instruction generated by compiler.
What is DDL Interpreter?
ANSWER:
It interprets DDL statements and record them in tables containing metadata.
.

What is Relational Algebra?


ANSWER:
It is procedural query language. It consists of a set of operations that take one or two relations
as input and produce a new relation.

What is Relational Calculus?


ANSWER:
It is an applied predicate calculus specifically tailored for relational databases proposed by E.F.
Codd. E.g. of languages based on it are DSL ALPHA, QUEL.

Posted by Anil Kant at 2:25 AM 1 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: DBMS Interview Questions, SQL Server Interview Questions

SQL Server Interview Questions and Answers


What is database?
ANSWER:
A database is a logically coherent collection of data with some inherent meaning, representing
some aspect of real world and which is designed, built and populated with data for a specific
purpose.

What is a Database system?


ANSWER:
The database and DBMS software together is called as Database system.

Disadvantage in File Processing System?


ANSWER:
• Data redundancy & inconsistency.
• Difficult in accessing data.
• Data isolation.
• Data integrity.
• Concurrent access is not possible.
• Security Problems. .

Define the "integrity rules"


ANSWER:
There are two Integrity rules.
• Entity Integrity: States that “Primary key cannot have NULL value”
• Referential Integrity: States that “Foreign Key can be either a NULL value or should be Primary
Key value of other relation.

What is extension and intension?


ANSWER:
Extension -It is the number of tuples present in a table at any instance. This is time dependent.
Intension - It is a constant value that gives the name, structure of table and the constraints laid
on it.

What is System R? What are its two major subsystems?


ANSWER:
System R was designed and developed over a period of 1974-79 at IBM San Jose Research
Center . It is a prototype and its purpose was to demonstrate that it is possible to build a
Relational System that can be used in a real life environment to solve real life problems, with
performance at least comparable to that of existing system.
Its two subsystems are
• Research Storage
• System Relational Data System.

How is the data structure of System R different from the relational structure?
ANSWER:
Unlike Relational systems in System R
• Domains are not supported
• Enforcement of candidate key uniqueness is optional
• Enforcement of entity integrity is optional
• Referential integrity is not enforced

What is a view? How it is related to data independence?


ANSWER:
A view may be thought of as a virtual table, that is, a table that does not really exist in its own
right but is instead derived from one or more underlying base table. In other words, there is no
stored file that direct represents the view instead a definition of view is stored in data dictionary.
Growth and restructuring of base tables is not reflected in views. Thus the view can insulate
users from the effects of restructuring and growth in the database. Hence accounts for logical
data independence. .

What is Data Model?


ANSWER:
A collection of conceptual tools for describing data, data relationships data semantics and
constraints.

What is E-R model?


ANSWER:
This data model is based on real world that consists of basic objects called entities and of
relationship among these objects. Entities are described in a database by a set of attributes.

What is Object Oriented model?


ANSWER:
This model is based on collection of objects. An object contains values stored in instance
variables with in the object. An object also contains bodies of code that operate on the object.
These bodies of code are called methods. Objects that contain same types of values and the
same methods are grouped together into classes.

What is an Entity?
ANSWER:
It is a 'thing' in the real world with an independent existence.
What is an Entity type?
ANSWER:
It is a collection (set) of entities that have same attributes.

What is an Entity set?


ANSWER:
It is a collection of all entities of particular entity type in the database.

What is an Extension of entity type?


ANSWER:
The collections of entities of a particular entity type are grouped together into an entity set.

What is Weak Entity set?


ANSWER:
An entity set may not have sufficient attributes to form a primary key, and its primary key
compromises of its partial key and primary key of its parent entity, then it is said to be Weak
Entity set.

Posted by Anil Kant at 2:20 AM 1 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: DBMS Interview Questions, SQL Server Interview Questions

Tuesday, August 24, 2010


What is Data Independence ?
Data independence means that “the application is independent of the storage structure and
access strategy of data”. In other words, The ability to modify the schema definition in one level
should not affect the schema definition in the next higher level.

Two types of Data Independence:

• Physical Data Independence : Modification in physical level should not affect the logical level.
• Logical Data Independence : Modification in logical level should affect the view level.
NOTE: Logical Data Independence is more difficult to achieve
Posted by Anil Kant at 2:19 AM 0 comments Email ThisBlogThis!Share to TwitterShare to
FacebookShare to Google Buzz
Labels: DBMS Interview Questions, SQL Server Interview Questions

Monday, August 23, 2010


Describe the three levels of data abstraction ?
The are three levels of abstraction:

• Physical level: The lowest level of abstraction describes how data are stored.
• Logical level: The next higher level of abstraction, describes what data are stored in database
and what relationship among those data.
• View level: The highest level of abstraction describes only part of entire database.

Posted by Anil Kant at 2:19 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: DBMS Interview Questions, SQL Server Interview Questions

Sunday, August 22, 2010


What is DBMS ?
• Redundancy is controlled.
• Unauthorised access is restricted.
• Providing multiple user interfaces.
• Enforcing integrity constraints.
• Providing backup and recovery.

Posted by Anil Kant at 2:17 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: DBMS Interview Questions, SQL Server Interview Questions

What is RDBMS ?
Relational Data Base Management Systems (RDBMS) are database management systems that
maintain data records and indices in tables. Relationships may be created and maintained
across and among the data and tables.

In a relational database, relationships between data items are expressed by means of tables.
Interdependencies among these tables are expressed by data values rather than by pointers.
This allows a high degree of data independence. An RDBMS has the capability to recombine
the data items from different files, providing powerful tools for data usage.
Posted by Anil Kant at 2:14 AM 0 comments Email ThisBlogThis!Share to TwitterShare to
FacebookShare to Google Buzz
Labels: DBMS Interview Questions, SQL Server Interview Questions

Saturday, August 21, 2010


Data Abstraction, System R and Integrity Rules
Describe the three levels of data abstraction?
ANSWER:
The are three levels of abstraction:
• Physical level: The lowest level of abstraction describes how data are stored.
• Logical level: The next higher level of abstraction, describes what data are stored in database
and what relationship among those data.
• View level: The highest level of abstraction describes only part of entire database.

Define the "integrity rules"


ANSWER:
There are two Integrity rules.
• Entity Integrity: States that “Primary key cannot have NULL value”
• Referential Integrity: States that “Foreign Key can be either a NULL value or should be Primary
Key value of other relation.

What is extension and intension?


ANSWER:
Extension -It is the number of tuples present in a table at any instance. This is time dependent.
Intension - It is a constant value that gives the name, structure of table and the constraints laid
on it.

What is System R? What are its two major subsystems?


ANSWER:
System R was designed and developed over a period of 1974-79 at IBM San Jose Research
Center . It is a prototype and its purpose was to demonstrate that it is possible to build a
Relational System that can be used in a real life environment to solve real life problems, with
performance at least comparable to that of existing system.
Its two subsystems are
• Research Storage
• System Relational Data System.

How is the data structure of System R different from the relational structure?
ANSWER:
Unlike Relational systems in System R
• Domains are not supported
• Enforcement of candidate key uniqueness is optional
• Enforcement of entity integrity is optional
• Referential integrity is not enforced

Posted by Anil Kant at 3:10 AM 1 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: DBMS Interview Questions, SQL Server Interview Questions

DBMS Interview Questions and Answers


What is database?
ANSWER:
A database is a logically coherent collection of data with some inherent meaning, representing
some aspect of real world and which is designed, built and populated with data for a specific
purpose.

What is DBMS?
ANSWER:
• Redundancy is controlled.
• Unauthorised access is restricted.
• Providing multiple user interfaces.
• Enforcing integrity constraints.
• Providing backup and recovery.

What is a Database system?


ANSWER:
The database and DBMS software together is called as Database system.

Disadvantage in File Processing System?


ANSWER:
• Data redundancy & inconsistency.
• Difficult in accessing data.
• Data isolation.
• Data integrity.
• Concurrent access is not possible.
• Security Problems. .

Operating System Interview Questions Answers


What is difference between NTFS & FAT32? 

Ans: NTFS stands for new technology file system or network technology file system. In NTSF
partition size can be of 2 TB or more. and file size can be 16 TB. file/folder encryption is done.
and it supports file name character upto 255.

FAT32 stands for File allocation table. in FAT32 partition size can be Upto 2 TB. and file size
can be 4 GB. file/folder encryption is not possible in FAT32. and it supports file name character
upto 8.3.

What is the difference XP and Windows 2000? 

Ans: Windows XP is some what faster than Windows 2000, assuming you have a fast
processor and tons of memory (although it will run fine with a 300Mhz Pentium II and 128MB of
RAM).

The new Windows XP interface is more cheerful and colorful than earlier versions, although the
less-cartoony "Classic" interface can still be used if desired.
Windows XP has more bells and whistles, such as the Windows Movie Maker, built-in CD writer
support, the Internet Connection Firewall, and Remote Desktop Connection.
Windows XP has better support for games and comes with more games than Windows 2000.
Windows XP is the latest OS - If you don't upgrade now, you'll probably end up migrating to XP
eventually anyway, and we mere mortals can only take so many OS upgrades.

Posted by Anil Kant at 12:02 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Operating System

Tuesday, September 7, 2010


Objective Type Question Answers of Operating
System
1. Which of the command is used to remove files ?
a. erase
b. rm
c. delete
d. dm

Ans: b

2. Which of the following command is used to count just the number of lines contained in a file ?
a. wc-1
b. wc-w
c.wc-c
d. wc-r

Ans: a

3. Which command is used to copy a file wb with the same name from the programs directory to
the misc. directory ?
a. copy programs/wb misc/wb
b. cp programs/wb misc
c. copy a:programs/wb b:misc/wb
d. tar programs/wb misc/wb

Ans: b
4. The commonly used UNIX commands like date, Is, cat, etc. are stored in
a. /dev directory
b. /bin and /usr/bin directories
c. /unix directory
d. /tmp directory

Ans: b

5. Which of the following directories contain all the files created by a user, including his login
directory ?
a. /tmp
b. /usr
c. /etc
d. /dev

Ans: b

6. Which command is used to copy the three files wb, colllect and mon into the misc directory,
under the same, when you were currently in the programs directory ?
a. copy wb collect mon/misc
b. cp wb collect mon ../misc
c. copy wb ../misc collect ../misc mon ../misc
d. tar wb collect mon/misc

Ans: b

7. Which of the following command is used to display the directory attributes rather than its
contents ?
a. 1s-1-d
b. Is-x
c. Is-1
d. is-F
Ans: a

8. Which command is used to remove a directory


a. rd
b. dldir
c. rmdir
d. rdir

Ans: c

9. Which command is used to list out all the hidden files along with the other files ?
a. Is-1
b. Is-F
c. Is-x
d Is-a

Ans: d

10. The file that contains a set of instructions which are performed when a user logs in, is
a) .exrc
b) .profile
c) autoexec.bat
d) .autoexec

Ans: b

Posted by Anil Kant at 2:48 AM 1 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Operating System, PSU Exam Papers, UGC Net

Operating System Questions


1. Which of the following command can be used to get information about all user who are
currently logged into the system ?
a. which
b. who am i
c. who
d. 1/u

Ans: c

2. The command used to remove the directory is


a. rmdir
b. remove
c. rd
d. rdir

Ans: a

3. Which of the following command can be used to get information about yourself
a. who am i
b. pwd
c. i/4
d. which

Ans: a

4. Which of the following command is used to summarize the disk usage ?


a. chkdsk
b. du
c. fdisk
d. disk

Ans: b

5. Which of the following commands is used to copy directory structures in and out ?
a. cp
b. cp-p
c. cpio
d. copy

Ans: c

6. Which of the following signs is used to backup over typing errors in vi ?


a. @
b. $
c. #
d. !

Ans: c

7. Which of the following commands is used to change the working directory ?


a. cd
b. chdir
c. changedir
d. cdir

Ans: a

8. Which of the following signs is used to erase or kill an entire line you have typed and start you
are on a new line(but not display a new prompt) ?
a. @
b. $
c. #
d. !

Ans: a

9. Which of the following commands is used to count the total number of lines, words and
characters contained in a file.
a. count p
b. wcount
c. wc
d. countw

Ans: c

10. Which of the following commands is used to list contents of directories ?


a. 1s
b. dir
c. 1p
d. tar

Ans: a

Posted by Anil Kant at 1:13 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Operating System, PSU Exam Papers, UGC Net

Thursday, September 2, 2010


PSU Papers for Computer Science
1. Dijkstra's banking algorithm in an operating system solves the problem of -
Ans: Deadlock Avoidance

2. In a paged memory system, if the page size is increased, then the internal fragmentation
generally -
Ans: Becomes more

3. An operating system contains 3 user processes each requiring 2 units of resources R. The
minimum number of units of R such that no deadlock will ever occur is -
Ans: 4

4. Critical region is -
Ans: A set of instructions that access common shared resources which exclude one another in
time

5. Kernel is -
Ans: The set of primitive functions upon which the rest of operating system functions are built up

6. Necessary conditions for deadlock are -


Ans: Non-preemption and circular wait, Mutual exclusion and partial allocation

7. In a time sharing operating system, when the time slot given to a process is completed, the
process goes from the RUNNING state to the -
Ans: READY state

8. Supervisor call -
Ans: Are privileged calls that are used to perform resource management functions, which are
controlled by the operating system

9. Semaphores are used to solve the problem of -


Ans: Mutual exclusion, Process synchronization

10. If the property of locality of reference is well pronounced in a program-


Ans: The number of page faults will be less

Posted by Anil Kant at 11:38 PM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Operating System, PSU Exam Papers

Operating System - Question Answer


1. In Round Robin CPU Scheduling, as the time quantum is increased, the average turn around
time-
Ans: varies irregulary

2. In a multiprogramming environment-
Ans: more than one process resides in the memory

3. The size of the virtual memory depends on the size of the -


Ans: Address Bus

4. Give example of Scheduling Policies in which context switching never take place-
Ans: Shortest Job First, First-cum-first-served

5. Suppose that a process is in 'BLOCKED' state waiting for some I/O service. When the service
is completed, it goes to the-
Ans: READY State

Posted by Anil Kant at 10:34 PM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Operating System

Operating System Question Answer for Competitive


Exams
1. Pre-emptive scheduling, is the strategy of temporarily suspending a running process-
Ans: before the CPU time slice expires

2. Mutual exclusion problem occurs -


Ans: among processes that share resources

3. Sector interleaving in disks is done by -


Ans: the operating system

4. Disk scheduling involves deciding-


Ans: the order in which disk access requests must be serviced

5. Dirty bit is used to show the -


Ans: page that is modified after being loaded into cache memory

6. Fence register is used for-


Ans: memory protection.

7. The first-fit, best-fit and worst-fit algorithm can be used for-


Ans: contiguous allocation of memory
8. Give example of single-user operating systems-
Ans: MS-DOS, XENIX

Posted by Anil Kant at 10:24 PM 1 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Operating System

Wednesday, September 1, 2010


Operating System Question Answer
1. Concurrent processes are processes that -
Ans: Overlap in time

2. The page replacement policy that sometimes leads to more page faults when the size of the
memory is increased is -
Ans: FIFO

3. The only state transition that is initiated by the user process itself is -
Ans: Block

4. Fragmentation is -
Ans: fragments of memory words unused in a page

5. Give Example of real time systems


Ans: Aircraft control system, A process control system

Posted by Anil Kant at 11:28 PM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Operating System, PSU Exam Papers

Tuesday, August 31, 2010


Computer Officer Exam Paper
1. Virtual memory is -
Ans: an illusion of an extremely large memory

2. Special locality refers to the problem that once a location is referenced


Ans: a nearby location will be referenced soon
3. An example of a SPOOLED device
Ans: A line printer used to print the output of a number of jobs

4. Page faults occurs when


Ans: one tries to divide a number by 0

5. Overlay is
Ans: a single contiguous memory that was used in the olden days for running large programs by
swapping

DBMS Interview Questions & Answers


What is normalization?
ANSWER:
It is a process of analysing the given relation schemas based on their Functional Dependencies
(FDs) and primary key to achieve the properties
• Minimizing redundancy
• Minimizing insertion, deletion and update anomalies.

What is Functional Dependency?


ANSWER:
A Functional dependency is denoted by X Y between two sets of attributes X and Y that are
subsets of R specifies a constraint on the possible tuple that can form a relation state r of R.
The constraint is for any two tuples t1 and t2 in r if t1[X] = t2[X] then they have t1[Y] = t2[Y]. This
means the value of X component of a tuple uniquely determines the value of component Y.

When is a functional dependency F said to be minimal?


ANSWER:
• Every dependency in F has a single attribute for its right hand side.
• We cannot replace any dependency X A in F with a dependency Y A where Y is a proper
subset of X and still have a set of dependency that is equivalent to F.
• We cannot remove any dependency from F and still have set of dependency that is equivalent
to F.

What is Multivalued dependency?


ANSWER:
Multivalued dependency denoted by X Y specified on relation schema R, where X and Y are
both subsets of R, specifies the following constraint on any relation r of R: if two tuples t1 and t2
exist in r such that t1[X] = t2[X] then t3 and t4 should also exist in r with the following properties
• t3[x] = t4[X] = t1[X] = t2[X]
• t3[Y] = t1[Y] and t4[Y] = t2[Y]
• t3[Z] = t2[Z] and t4[Z] = t1[Z]
where [Z = (R-(X U Y)) ]

What is Lossless join property?


ANSWER:
It guarantees that the spurious tuple generation does not occur with respect to relation schemas
after decomposition.

What is 1 NF (Normal Form)?


ANSWER:
The domain of attribute must include only atomic (simple, indivisible) values.

What is Fully Functional dependency?


ANSWER:
It is based on concept of full functional dependency. A functional dependency X Y is full
functional dependency if removal of any attribute A from X means that the dependency does not
hold any more.

What is 2NF?
ANSWER:
A relation schema R is in 2NF if it is in 1NF and every non-prime attribute A in R is fully
functionally dependent on primary key.

What is 3NF?
ANSWER:
A relation schema R is in 3NF if it is in 2NF and for every FD X A either of the following is true
• X is a Super-key of R.
• A is a prime attribute of R.
In other words, if every non prime attribute is non-transitively dependent on primary key.

What is BCNF (Boyce-Codd Normal Form)?


ANSWER:
A relation schema R is in BCNF if it is in 3NF and satisfies an additional constraint that for every
FD X A, X must be a candidate key.

What is 4NF?
ANSWER:
A relation schema R is said to be in 4NF if for every Multivalued dependency X Y that holds
over R, one of following is true
• X is subset or equal to (or) XY = R.
• X is a super key.

What is 5NF?
ANSWER:
A Relation schema R is said to be 5NF if for every join dependency {R1, R2, ..., Rn} that holds
R, one the following is true
• Ri = R for some i.
• The join dependency is implied by the set of FD, over R in which the left side is key of R.

Posted by Anil Kant at 2:30 AM 1 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: DBMS Interview Questions, SQL Server Interview Questions

Friday, August 27, 2010


Some Useful DBMS Interview Questions Answers
What is an attribute?
ANSWER:
It is a particular property, which describes the entity.
What is a Relation Schema and a Relation?
ANSWER:
A relation Schema denoted by R(A1, A2, …, An) is made up of the relation name R and the list
of attributes Ai that it contains. A relation is defined as a set of tuples. Let r be the relation which
contains set tuples (t1, t2, t3, ..., tn). Each tuple is an ordered list of n-values t=(v1,v2, ..., vn).

What is degree of a Relation?


ANSWER:
It is the number of attribute of its relation schema.

What is Relationship?
ANSWER:
It is an association among two or more entities.

What is Relationship set?


ANSWER:
The collection (or set) of similar relationships.

What is Relationship type?


ANSWER:
Relationship type defines a set of associations or a relationship set among a given set of entity
types.

What is degree of Relationship type?


ANSWER:
It is the number of entity type participating.

What is Data Storage - Definition Language?


ANSWER:
The storage structures and access methods used by database system are specified by a set of
definition in a special type of DDL called data storage-definition language.

What is DML (Data Manipulation Language)?


ANSWER:
This language that enable user to access or manipulate data as organised by appropriate data
model.
• Procedural DML or Low level: DML requires a user to specify what data are needed and how
to get those data.
• Non-Procedural DML or High level: DML requires a user to specify what data are needed
without specifying how to get those data.

What is DML Compiler?


ANSWER:
It translates DML statements in a query language into low-level instruction that the query
evaluation engine can understand.

What is Query evaluation engine?


ANSWER:
It executes low-level instruction generated by compiler.

What is DDL Interpreter?


ANSWER:
It interprets DDL statements and record them in tables containing metadata.
.

What is Relational Algebra?


ANSWER:
It is procedural query language. It consists of a set of operations that take one or two relations
as input and produce a new relation.

What is Relational Calculus?


ANSWER:
It is an applied predicate calculus specifically tailored for relational databases proposed by E.F.
Codd. E.g. of languages based on it are DSL ALPHA, QUEL.
Posted by Anil Kant at 2:25 AM 1 comments Email ThisBlogThis!Share to TwitterShare to
FacebookShare to Google Buzz
Labels: DBMS Interview Questions, SQL Server Interview Questions

SQL Server Interview Questions and Answers


What is database?
ANSWER:
A database is a logically coherent collection of data with some inherent meaning, representing
some aspect of real world and which is designed, built and populated with data for a specific
purpose.

What is a Database system?


ANSWER:
The database and DBMS software together is called as Database system.

Disadvantage in File Processing System?


ANSWER:
• Data redundancy & inconsistency.
• Difficult in accessing data.
• Data isolation.
• Data integrity.
• Concurrent access is not possible.
• Security Problems. .

Define the "integrity rules"


ANSWER:
There are two Integrity rules.
• Entity Integrity: States that “Primary key cannot have NULL value”
• Referential Integrity: States that “Foreign Key can be either a NULL value or should be Primary
Key value of other relation.

What is extension and intension?


ANSWER:
Extension -It is the number of tuples present in a table at any instance. This is time dependent.
Intension - It is a constant value that gives the name, structure of table and the constraints laid
on it.

What is System R? What are its two major subsystems?


ANSWER:
System R was designed and developed over a period of 1974-79 at IBM San Jose Research
Center . It is a prototype and its purpose was to demonstrate that it is possible to build a
Relational System that can be used in a real life environment to solve real life problems, with
performance at least comparable to that of existing system.
Its two subsystems are
• Research Storage
• System Relational Data System.

How is the data structure of System R different from the relational structure?
ANSWER:
Unlike Relational systems in System R
• Domains are not supported
• Enforcement of candidate key uniqueness is optional
• Enforcement of entity integrity is optional
• Referential integrity is not enforced

What is a view? How it is related to data independence?


ANSWER:
A view may be thought of as a virtual table, that is, a table that does not really exist in its own
right but is instead derived from one or more underlying base table. In other words, there is no
stored file that direct represents the view instead a definition of view is stored in data dictionary.
Growth and restructuring of base tables is not reflected in views. Thus the view can insulate
users from the effects of restructuring and growth in the database. Hence accounts for logical
data independence. .

What is Data Model?


ANSWER:
A collection of conceptual tools for describing data, data relationships data semantics and
constraints.

What is E-R model?


ANSWER:
This data model is based on real world that consists of basic objects called entities and of
relationship among these objects. Entities are described in a database by a set of attributes.

What is Object Oriented model?


ANSWER:
This model is based on collection of objects. An object contains values stored in instance
variables with in the object. An object also contains bodies of code that operate on the object.
These bodies of code are called methods. Objects that contain same types of values and the
same methods are grouped together into classes.

What is an Entity?
ANSWER:
It is a 'thing' in the real world with an independent existence.

What is an Entity type?


ANSWER:
It is a collection (set) of entities that have same attributes.

What is an Entity set?


ANSWER:
It is a collection of all entities of particular entity type in the database.

What is an Extension of entity type?


ANSWER:
The collections of entities of a particular entity type are grouped together into an entity set.

What is Weak Entity set?


ANSWER:
An entity set may not have sufficient attributes to form a primary key, and its primary key
compromises of its partial key and primary key of its parent entity, then it is said to be Weak
Entity set.

Posted by Anil Kant at 2:20 AM 1 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: DBMS Interview Questions, SQL Server Interview Questions

Tuesday, August 24, 2010


What is Data Independence ?
Data independence means that “the application is independent of the storage structure and
access strategy of data”. In other words, The ability to modify the schema definition in one level
should not affect the schema definition in the next higher level.

Two types of Data Independence:

• Physical Data Independence : Modification in physical level should not affect the logical level.
• Logical Data Independence : Modification in logical level should affect the view level.
NOTE: Logical Data Independence is more difficult to achieve

Posted by Anil Kant at 2:19 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: DBMS Interview Questions, SQL Server Interview Questions

Monday, August 23, 2010


Describe the three levels of data abstraction ?
The are three levels of abstraction:

• Physical level: The lowest level of abstraction describes how data are stored.
• Logical level: The next higher level of abstraction, describes what data are stored in database
and what relationship among those data.
• View level: The highest level of abstraction describes only part of entire database.

Posted by Anil Kant at 2:19 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: DBMS Interview Questions, SQL Server Interview Questions

Sunday, August 22, 2010


What is DBMS ?
• Redundancy is controlled.
• Unauthorised access is restricted.
• Providing multiple user interfaces.
• Enforcing integrity constraints.
• Providing backup and recovery.

Posted by Anil Kant at 2:17 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: DBMS Interview Questions, SQL Server Interview Questions

What is RDBMS ?
Relational Data Base Management Systems (RDBMS) are database management systems that
maintain data records and indices in tables. Relationships may be created and maintained
across and among the data and tables.

In a relational database, relationships between data items are expressed by means of tables.
Interdependencies among these tables are expressed by data values rather than by pointers.
This allows a high degree of data independence. An RDBMS has the capability to recombine
the data items from different files, providing powerful tools for data usage.

Posted by Anil Kant at 2:14 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: DBMS Interview Questions, SQL Server Interview Questions

Saturday, August 21, 2010


Data Abstraction, System R and Integrity Rules
Describe the three levels of data abstraction?
ANSWER:
The are three levels of abstraction:
• Physical level: The lowest level of abstraction describes how data are stored.
• Logical level: The next higher level of abstraction, describes what data are stored in database
and what relationship among those data.
• View level: The highest level of abstraction describes only part of entire database.

Define the "integrity rules"


ANSWER:
There are two Integrity rules.
• Entity Integrity: States that “Primary key cannot have NULL value”
• Referential Integrity: States that “Foreign Key can be either a NULL value or should be Primary
Key value of other relation.

What is extension and intension?


ANSWER:
Extension -It is the number of tuples present in a table at any instance. This is time dependent.
Intension - It is a constant value that gives the name, structure of table and the constraints laid
on it.

What is System R? What are its two major subsystems?


ANSWER:
System R was designed and developed over a period of 1974-79 at IBM San Jose Research
Center . It is a prototype and its purpose was to demonstrate that it is possible to build a
Relational System that can be used in a real life environment to solve real life problems, with
performance at least comparable to that of existing system.
Its two subsystems are
• Research Storage
• System Relational Data System.

How is the data structure of System R different from the relational structure?
ANSWER:
Unlike Relational systems in System R
• Domains are not supported
• Enforcement of candidate key uniqueness is optional
• Enforcement of entity integrity is optional
• Referential integrity is not enforced

Posted by Anil Kant at 3:10 AM 1 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: DBMS Interview Questions, SQL Server Interview Questions

DBMS Interview Questions and Answers


What is database?
ANSWER:
A database is a logically coherent collection of data with some inherent meaning, representing
some aspect of real world and which is designed, built and populated with data for a specific
purpose.

What is DBMS?
ANSWER:
• Redundancy is controlled.
• Unauthorised access is restricted.
• Providing multiple user interfaces.
• Enforcing integrity constraints.
• Providing backup and recovery.

What is a Database system?


ANSWER:
The database and DBMS software together is called as Database system.

Disadvantage in File Processing System?


ANSWER:
• Data redundancy & inconsistency.
• Difficult in accessing data.
• Data isolation.
• Data integrity.
• Concurrent access is not possible.
• Security Problems. .
Objective Type Computer Science Questions for
Public Sector Recruitment Exam
1. The problem of fragmentation arises in
(a) static storage Allocation
(b) stack allocation of storage
(c) stack allocation with dynamic binding
(d) Heap allocation

Ans: (d)

2. The process of organizing the memory into two banks to allow 8 and 16-bit data operation is
called

a. Bank Switching
b. Indexed Mapping
c. Two-way memory interleaving
d. Memory segmentation

Ans: (c)

3. Memory refreshing may be done

a. by the CPU that contains a special regress counter, only


b. by an external refresh controller, only
c. either by the CPU or by an external refresh controller
d. none of the above

Ans: (c)

4. The use of hardware in memory management is through segment relocation and protection is

a. to perform address translation to reduce size of the memory


b. to perform address translation to reduce execution time overhead
c. both (a) and (b)
d. none of the above

Ans: (c)

5. Thrashing occurs when

a. too much of the time is spent in waiting to swap between memory and disk
b. two processes try to access the same resource
c. the size of the data to be inserted is less than the size of a page in memory
d. the processor's mapping table discovers that the program is trying to use an address that
doesn't currently exist

Ans: (a)

Posted by Anil Kant at 1:47 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Computer Science and Applications, PSU Exam Papers

Monday, September 6, 2010


Technical Questions for PSU's
1. The operators << (left shift) and >> (right shift) are
a. assignment operators
b. relational operators
c. logical operators
d. bitwise logical operators

Ans: d

2. The values that can legally appear to the right of the assignment operator are called
a. rvalues
b. int values
c. variables
d. constants
Ans: a

3. The string containing certain required formating information is called


a. argument
b. character array
c. character string
d. control string

Ans: d

4. In C, the NULL statement which does nothing is just


(a.) a., (b) ;
(c) : (d) .

Ans: (b)

5. The general form of do-while statement is


a. do expression while statement;
b. do while expression;
c. do statement while expression;
d. do statement while statement;

Ans: c

6. The two statement that can be used to change the flow of control are
a. if and switch
b. if and while
c. switch and do-while
d. break and continue

Ans: a

7. In printf(), the appearance of the output can be affected by


a. field width
b. conversion character
c. flag
d. all of the above
e. none of the above

Ans: d

8. The conversion character 's' for data input means that the data item is
a. an unsigned decimal integer
b. a short integer
c. a hexadecimal integer
d. a string followed by whitespace character

Ans: d

9. The conversion character for data input which indicates that the data item is a floating-point
values is
(a) f
(b) g
(c) e
(d) All of the above

Ans: d

10. The conversion character 'i' for data output means that the data item is displayed as -
(a) a floating point value with an exponent
(b) an unsigned decimal integer
(c) a signed decimal integer
(d) an octal integer

Ans: c
Posted by Anil Kant at 11:58 PM 0 comments Email ThisBlogThis!Share to TwitterShare to
FacebookShare to Google Buzz
Labels: Computer Science and Applications, Programing in C and C++, PSU Exam Papers, UGC Net

Objective Questions of 'C'


1. Precedence determines which operator
a. is evaluated first
b. is most important
c. is fastest
d. operates on the largest number

Ans: a

2. A expression contains relational assignment and arithmetic operator. In the absence of


parentheses, the order of evaluation will be

a. assignment, relational, arithmetic


b. arithmetic, relational, assignment
c. relational, arithmetic, assignment
d. assignment, arithmetic, relational

Ans: b

3. The commands that send or "redirect" output of a program to a disk file or another system
device such as the printer are

a. 
b. [and]
c. /* and /*
d. ( and )

Ans: a

4. Which of the following scanf() statements is true ?


a. scanf("%f', float-var-name);
b. scanf("%d ∑");
c. scanf("%d", &int-var-name);
d. scanf("%d", &number);

Ans: d

5. The meaning of conversion character h for data input is


a. data item is an unsigned decimal integer
b. data item is a short integer
c. data item is a hexadecimal integer
d. data item is a string folowed by a whitespace character

Ans: b

Posted by Anil Kant at 3:05 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Computer Science and Applications, Programing in C and C++, UGC Net

Objective Type Questions on Loop


1. The general form of the conditional expression is
a. expression 1 ? expression 2 :expression 3
b. expression 2 ? expression 3 ?expression 1
c. expression 3 ? expression 2 :expression 1
d. expression 1 ? expression 2 ?expression 3

Ans: a

2. Any program in C, has access to three standard files


a. standrad input file, standard output file, standard error file
b. stdin, stdout, stderr
c. keyboard, screen, screen
d. all of the above
e. none of the above
Ans: d

3. In a simple 'if' statement with no 'else', what happens if the condition following the 'if' is false ?
a. The program searches for the last else in the program
b. Nothing
c. Control 'falls through' to the statement folowing 'if'
d. The body of the statement is executed

Ans: c

4. A while loop is more appropriate than a for loop when


a. the body of the loop will be executed at last once
b. the terminating condition occurs unexpectedly
c. the program will be executed at least once
d. the number of times the loop will be executed is known before the loop is executed
e. none of the above

Ans: b

5. The comma operator(,) is used to


a. permit two different expressions to appear in situations where only once expression would
ordinarily be used
b. terminate loops or to exit from switch
c. alter the normal sequence of program execution by transferring control to some other part of
the program
d. carry out a logical test and then take one of two possible actions, depending upon the
outcome of the test

Ans: a

Posted by Anil Kant at 2:02 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Computer Science and Applications, Programing in C and C++, PSU Exam Papers, UGC Net

Relational Database Design and SQL Questions


1. In a relational schema, each tuple is divided into fields called
a. Relations
b. Domains
c. Queries
d. All of the above

Ans: b

2. A logical schema
a. is the entire database
b. is a standard way of organizing information into accessible parts
c. describes how data is actually stored on disk
d. all of the above

Ans: b

3. A form defines
a. where data are placed on the screen
b. the width of each field
c. both (a) and (b)
d. All of the above

Ans: c

4. A top-to-bottom relationship among the items in a database is established by a


a. Hierarchical Schema
b. Network Schema
c. Relational Schema
d. All of the above

Ans: b

5. A good query system


a. can accept English language commands
b. allows non-programmers to access information stored in a database
c. can be accessed only by data processing professionals
d. Both (a) and (b)

Ans: b

6. A report form
a. appears on the computer monitor during data entry
b. is used during report generation to format data
c. Both a and b
d. All of the above

Ans: b

7. A list consists of last names, first names, addresses and pincodes if all people in the list have
the same last and the same pincode, a useful key would be
a. the pincode
b. the last name
c. a compound key consisting of the first name and the last name
d. all of the above

Ans: c

8. A command that lets you change one or more fields in a record is


a. Insert
b. Modify
c. Look-up
d. All of the above

Ans: b

10. Which of the following contains a complete record of all activity that affected the contents of
a database during a certain period of time ?
a. Report writer
b. Query language
c. Data manipulation language
d. Transaction Log

Ans: d

Posted by Anil Kant at 12:43 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Computer Science and Applications, PSU Exam Papers, SQL Server Interview Questions,UGC
Net

Some 'C' Programming objective type questions


1. The recursive form of algebric formula
y=(x1,+x2+x3... +xn) is

a. y=x+n-1 xi i=1
b. y=xn+n xi i=1
c. y=xn+xi
d. y=xn+n-1 i=1 xi
e. none of the above

Ans: d

2. Which of the folowing, is a storage class specification of C ?


a. Automatic
b. Mean
c. External
d. String
e. none of the above

Ans: d

3. The statement following else in an 'if-else' construct are executed when


a. the conditional statement following the 'if' is false
b. the conditional statement following the 'if' is teue
c. the conditional statement following the 'else' is false
d. the conditional statement following the 'else' is true
e. none of the above

Ans: a

4. Given these variables


char ch;
short i;
unsigned long u1;
float f;
the overall type of this expression is

a. char
b. unsigned
c. float
d. double
e. none of the above

Ans: c

5. What will this program display ?


#include
main()
{
float f;
f= 10/3;
printf("%f", f);
}

a. 3.3
b. 3.000000
c. 3
d. 3.1

Ans: b

Posted by Anil Kant at 12:18 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Computer Science and Applications, Programing in C and C++, PSU Exam Papers, UGC Net

Sunday, September 5, 2010


C and C++ objective type questions
Q1. The braces that surround the code in a 'C' program
a. show what code goes in a particular function
b. delimit a section of code
c. separate the code from the constant
d. separate the source file from the subject file
e. none of the above

Q2. Almost every C program begins with the statement


a. main()
b. printf()
c. #include
d. scanf()
e. none of the above

Q3. A single character input from the keyboard can be obtained by using the function
a. printf()
b. getchar()
c. putchar()
d. scanf()
e. none of the above

Q4. The function scanf() reads


a. a single character
b. character and strings
c. any possible variable type
d. any possible number
e. none of the above

Q5. A field width specifier in a printf() function


a. specifies the maximum value of a number
b. controls the size of type used to print numbers
c. controls the margins of the program
d. specifies how many character positions will be used for a number
e. none of the above

Ans: 1. b , 2. c , 3. b , 4. c , 5. d

Posted by Anil Kant at 11:20 PM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Computer Science and Applications, Programing in C and C++, UGC Net

UGC Net Computer Science and Application Paper


1. The library files that comes with 'C' are -
Ans: files that contains functions which carry out various commonly used operations and
calculations.

2. In 'C' square brackets[] are used in -


a. functions
b. arrays
c. statements
d. all of the above
ANs: b

3. A 'C' program contains the declarations and initial assignments:


int i=8, j=5;
The value of arithmetic expression is int from
2*((i/5)+(4*j-3)%(i+j-2)) is
a. 18
b. 14
c. 1
d. 17

Ans: b

4. The single character input/output functions are


Ans: getchar() and putchar()

5. The purpose of a conditional operator is to-


a. select one of the two values alternately
b. select the highest of the two values
c. select one of the two values depending on a condition
d. select the more equal of the two values

Ans: c

Posted by Anil Kant at 1:45 AM 1 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Computer Science and Applications, Programing in C and C+
+, UGC Net

Objective type C & C++ Questions


Q1. An identifier in C
a. is a name of a thing such as variable and function
b. is made up of letters, numerals and the underscore
c. can obtain both upper case and lower case letter
d. all of the above
e. none of the above

Q2. The math library is setup for the user by the file
a. float.h
b. limits.h
c. math.h
d. time.h
e. none of the above

Q3. Which of the following does not have an unary operator ?


a. -7 b. ++i
c. j d. all of the above
e. none of the above

Q4. Assume x, y and z are floating point variables and they have been assigned the values
x=8.8, y=3.5, z= -5.2 . The value of arithmetic expression 2*x/(3*y) is
a. 2.000000
b. 1.600000
c. 1.676190
d. 0.676190
e. none of the above

Q5. The two operators && and || are


a. arithmetic operators
b. equality operators
c. logical operators
d. relational operators
e. none of the above

Posted by Anil Kant at 12:07 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Computer Science and Applications, Programing in C and C++, UGC Net

Saturday, September 4, 2010


Multiple choice questions of networking
Q1. A distributed network configuration in which all data/information pass through a central
computer is
a. bus network
b. ring network
c. star network
d. point-to-point network
e. none of the above

Q2. The most flexibility in how devices are wired together is provided by
a. bus networks
b. star networks
c. ring networks
d. T-switched networks
e. none of the above

Q3. The communication mode that supports two-way traffic but only one direction at a time is
a. simplex b. half duplex
c. duplex d. multiplex
e. none of the above

Q4. A central Computer surrounded by one or more satellite computers is called a


a. bus network
b. ring network
c. star network
d. all of the above
e. none of the above

Q5. FDDI is a
a. ring network
b. star network
c. mesh network
d. bus based network
e. none of the above

Ans: 1. c , 2. a , 3. b , 4. c , 5. a

Posted by Anil Kant at 12:45 AM 1 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Computer Networking, Computer Science and Applications, UGC Net

Networking for UGC NET Exam


Q.1. Local area networks can transmit
a. slower than telecommunications over public telephone lines.
b. faster than telecommunications over public telephone lines.
c. using twisted-pair wiring or coaxial cables.
d. both a and c
e. none of the above

Q2. A Packet -switching network


a. is free
b. allows communication channels to be shared among more than one user.
c. can reduce the cost of using an information utility.
d. both a and b
e. none of the above

Q3. The application layer of a network


a. establishes, maintains and terminates virtual circuits
b. consists of software being run on the computer connected to the network
c. defines the user's port into the network
d. all of the above
e. none of the above

Q4. Devices on one network can communicate with devices on another network via a
a. file server b. printer server
c. utility server d. gateway
e. none of the above

Q5. A network that requires human inventation of route signals is called a


a. bus network
b. ring network
c. star network
d. T-switched network
e. none of the above
Ans: 1. d , 2. d , 3. b , 4. d , 5. d

Posted by Anil Kant at 12:06 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Computer Networking, Computer Science and Applications, UGC Net

Friday, September 3, 2010


Computer Networking Objective Type Question
Answer
1. How many pairs of stations can simultaneously communicate on Ethernet LAN ?
Ans: 1

2. A modem that is attached to the telephone system by jamming the phone's handset into two
flexible receptacles in the coupler ?

a. gateway
b. time-divison multiplexer
c. acoustic coupler
d. bridge

Ans: c

3. Which of the following allows devices on one network to communicate with devices on
another network ?
a. multiplexer
b. gateway
c. t-switch
d. modem

Ans: b

4. A station in a network forwards incoming packets by placing them on its shortest output
queue. What routing algorithm is being used ?
a. flooding
b. hot potato routing
c. static routing
d. delta routing

Ans: b

5. The communication mode that supports data in both directions at the same time is
a. simplex
b. half-simplex
c. full-duplex
d. multiplex

Ans: c

6. Modulation is the process of


a. sending a file from one computer to another computer
b. converting digital signals to analog signals
c. converting analog signals to digital signals
d. echoing every character that is received

7. The signal to noise ratio for a voice grade line is 30.1 db or a power ration of 1023:1. The
maximum achievable data rate on this line whose spectrum ranges from 300 Hz to 4300 Hz is
a. 6200 bps b. 34000 bps
c. 9600 bps d. 31000 bps

ANs: d

8. Which of the following is used for modulation and demodulation ?


a. modem
b. protocol
c. gateway
d. multiplexer
Ans: a

9. A software that allows a personal computer to pretend is as a terminal is


a. auto-dialing
b. bulletin-board
c. modem
d. terminal emulation

ANs: a

10. Which of the following refers to the terms "residual error rate" ?
a. the number of bit error per twenty four hours of continuous operation on an asynchronus line
b. the probability that one or more errors will be undetected when an error detection scheme is
used
c. the probability that one or more errors will be detected when an error detection mechanism is
used
d. signal to noise ratio divided by the ratio of energy per bit to noise per hertz

Ans: b

C++ Interview Questions


1. What is the word you will use when defining a function in base class to allow this
function to be a polimorphic function?

Ans: virtual

2. What do you mean by binding of data and functions?

Ans: Encapsulation.
3. What is the difference between an object and a class?

Ans: Classes and objects are separate but related concepts. Every object belongs to a class
and every class contains one or more related objects.

- A Class is static. All of the attributes of a class are fixed before, during, and after the execution
of a program. The attributes of a class don't change.
- The class to which an object belongs is also (usually) static. If a particular object belongs to a
certain class at the time that it is created then it almost certainly will still belong to that class
right up until the time that it is destroyed.

- An Object on the other hand has a limited lifespan. Objects are created and eventually
destroyed. Also during that lifetime, the attributes of the object may undergo significant change.

4. What is a class ?

Ans: Class is a user-defined data type in C++. It can be created to solve a particular kind of
problem. After creation the user need not know the specifics of the working of a class.

5. What is friend function ?

Ans: As the name suggests, the function acts as a friend to a class. As a friend of a class, it can
access its private and protected members. A friend function is not a member of the class. But it
must be listed in the class definition.

6. Which recursive sorting technique always makes recursive calls to sort subarrays that
are about half size of the original array?

Ans: Mergesort always makes recursive calls to sort subarrays that are about half size of the
original array, resulting in O(n log n) time.

7. What is abstraction?
Ans: Abstraction is of the process of hiding unwanted details from the user.

Posted by Anil Kant at 1:50 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: C++ Interview Questions and Answers

Monday, August 23, 2010


C++ INterview Questions and Answers
1. What is the difference between an ARRAY and a LIST?

Answer:

Array is collection of homogeneous elements.


List is collection of heterogeneous elements.

For Array memory allocated is static and continuous.


For List memory allocated is dynamic and Random.

Array: User need not have to keep in track of next memory allocation.
List: User has to keep in Track of next location where memory is allocated.

2. Does c++ support multilevel and multiple inheritance?

Ans: Yes.

3. What do you mean by inheritance?

Ans: Inheritance is the process of creating new classes, called derived classes, from existing
classes or base classes. The derived class inherits all the capabilities of the base class, but can
add embellishments and refinements of its own.

4. What is a COPY CONSTRUCTOR and when is it called?

Ans: A copy constructor is a method that accepts an object of the same class and copies it’s
data members to the object on the left part of assignement:

5. What is virtual class and friend class?

Ans: Friend classes are used when two or more classes are designed to work together and
need access to each other's implementation in ways that the rest of the world shouldn't be
allowed to have. In other words, they help keep private things private. For instance, it may be
desirable for class DatabaseCursor to have more privilege to the internals of class Database
than main() has

Basic Computer Questions - Bank PO Exam


11. A(n)………contains commands that can be selected.
(A) pointer
(B) menu
(C) icon
(D) button
(E) None of these
Ans : (B)

12. An error is also known as—


(A) bug
(B) debug
(C) cursor
(D) icon
(E) None of these
Ans : (A)

13. Arithmetic Operations—


(A) involve matching one data item to another to determine if the first item is greater than, equal
to, or less than the other item
(B) sort data items according to standard, predefined criteria in ascending order or descending
order
(C) use conditions with operators such as AND, OR and NOT
(D) include addition, subtraction, multiplication and division
(E) None of these
Ans : (D)

14. Sending an e-mail is similar to—


(A) picturing an event
(B) narrating a story
(C) writing a letter
(D) creating a drawing
(E) None of these
Ans : (C)

15. Promotion in Marketing means—


(A) passing an examination
(B) elevation from one grade to another
(C) selling the products through various means
(D) selling the product in specific areas
(E) None of these
Ans : (C)

16. Microsoft Word is an example of—


(A) an operating system
(B) a processing device
(C) application software
(D) an input device
(E) None of these
Ans : (B)

17. Sources of Sales Leads are—


(A) Data Mining
(B) Market Research
(C) Media Outlets
(D) Promotional Programs
(E) All of these
Ans : (E)

18. Any data or instruction entered into the memory of a computer is considered as—
(A) storage
(B) output
(C) input
(D) information
(E) None of these
Ans : (A)

19. Which part of the computer displays the work done ?


(A) RAM
(B) printer
(C) monitor
(D) ROM
(E) None of these
Ans : (C)

20. Which is the part of a computer that one can touch and feel ?
(A) Hardware
(B) Software
(C) Programs
(D) Output
(E) None of these
Ans : (A)

Posted by Anil Kant at 4:53 AM 4 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank Exam Papers, Bank IT Officer Exam Papers, Basic Computer Questions

Basic Questions of Computer Science for Bank Exam


1. A keyboard is this kind of device—
(A) black
(B) input
(C) output
(D) word Processing
(E) None of these
Ans : (B)

2. IT stands for—
(A) information Technology
(B) integrated Technology
(C) intelligent Technology
(D) interesting Technology
(E) None of these
Ans : (A)

3. Which of the following refers to the fastest, biggest and most expensive computers ?
(A) Personal Computers
(B) Supercomputers
(C) Laptops
(D) Notebooks
(E) None of these
Ans : (B)

4. A collection of related information sorted and dealt with as a unit is a—


(A) disk
(B) data
(C) file
(D) floppy
(E) None of these
Ans : (C)

5. The process of a computer receiving information from a server on the Internet is known as—
(A) pulling
(B) pushing
(C) downloading
(D) transferring
(E) None of these
Ans : (C)

6. Which part of the computer helps to store information ?


(A) Disk drive
(B) Keyboard
(C) Monitor
(D) Printer
(E) None of these
Ans : (A)

7. ………………is the process of carrying out commands.


(A) Fetching
(B) Storing
(C) Executing
(D) Decoding
(E) None of these
Ans : (C)

8. The role of a………generally is to determine a buyer’s needs and match it to the correct
hardware and software.
(A) computer Scientist
(B) computer sales representative
(C) computer consultant
(D) corporate trainer
(E) None of these
Ans : (B)

9. Which of the following groups consist of only output devices ?


(A) Scanner, Printer, Monitor
(B) Keyboard, Printer, Monitor
(C) Mouse, Printer, Monitor
(D) Plotter, Printer, Monitor
(E) None of these
Ans : (D)

10. The rectangular area of the screen that displays a program, data, and/or information is a—
(A) title bar
(B) button
(C) dialog box
(D) window
(E) None of these
Ans : (D)

Posted by Anil Kant at 4:51 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank Exam Papers, Bank IT Officer Exam Papers, Basic Computer Questions

Sunday, September 12, 2010


Objective Type Computer Science Questions for
Public Sector Recruitment Exam
1. The problem of fragmentation arises in
(a) static storage Allocation
(b) stack allocation of storage
(c) stack allocation with dynamic binding
(d) Heap allocation

Ans: (d)

2. The process of organizing the memory into two banks to allow 8 and 16-bit data operation is
called

a. Bank Switching
b. Indexed Mapping
c. Two-way memory interleaving
d. Memory segmentation

Ans: (c)

3. Memory refreshing may be done

a. by the CPU that contains a special regress counter, only


b. by an external refresh controller, only
c. either by the CPU or by an external refresh controller
d. none of the above

Ans: (c)

4. The use of hardware in memory management is through segment relocation and protection is

a. to perform address translation to reduce size of the memory


b. to perform address translation to reduce execution time overhead
c. both (a) and (b)
d. none of the above

Ans: (c)

5. Thrashing occurs when

a. too much of the time is spent in waiting to swap between memory and disk
b. two processes try to access the same resource
c. the size of the data to be inserted is less than the size of a page in memory
d. the processor's mapping table discovers that the program is trying to use an address that
doesn't currently exist

Ans: (a)
Posted by Anil Kant at 1:47 AM 0 comments Email ThisBlogThis!Share to TwitterShare to
FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Computer Science and Applications, PSU Exam Papers

C++ Interview
1. What is an adaptor class or Wrapper class?
Ans: A class that has no functionality of its own. Its member functions hide the use of a third
party software component or an object with the non-compatible interface or a non-object-
oriented implementation.

2. What is a Null object?


Ans: It is an object of some class whose purpose is to indicate that a real object of that class
does not exist. One common use for a null object is a return value from a member function that
is supposed to return an object with some specified properties but cannot find such an object.

3. What is class invariant?


Ans: A class invariant is a condition that defines all valid states for an object. It is a logical
condition to ensure the correct working of a class. Class invariants must hold when an object is
created, and they must be preserved under all operations of the class. In particular all class
invariants are both preconditions and post-conditions for all operations or member functions of
the class.

4. Differentiate between the message and method.


Ans:
Message:
* Objects communicate by sending messages to each other.
* A message is sent to invoke a method.

Method
* Provides response to a message.
* It is an implementation of an operation.

5. What is a dangling pointer?


Ans: A dangling pointer arises when you use the address of an object after
its lifetime is over. This may occur in situations like returning
addresses of the automatic variables from a function or using the
address of the memory block after it is freed.

Posted by Anil Kant at 1:03 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, C# Interview Questions

Bank IT Officer Exam Papers


1. The model which provides a concrete expression of these concepts by means of two
fundamental ideas — logical records and links, is called a

A. relationship model
B. network model
C. hicrachical model
D. none of the above

2. The network model has been established by

A. CODASYL committee
B. IBM
C. ECA
D. none of the above

3. A link may be defined as the representation of an

A. objects 
B, programs
C. association 
D. none of the above

4. DML is intended provide operations which ope- rate upon data stored in the

A, file 
B. record
C. database 
D. none of the above

5. In the hierarchical model a hierarchical schema is defined by a tree whose nodes are

A. database 
B. logical record types
C. links 
D. none of the above

6. The set of all values in the relations represents the contents of the

A. database 
B. record file
C. table 
D. none of the above

7. In hierarchical data model, the database is represented by

A. a directed graph 
B. tree structures
C. relation 
D, none of the above

8. A Database Management System (DBMS) is a software system capable of supporting and


managing any number of independent

A. results
B. relations
c. none of the above

9. Support for data independence is arguably the most important feature of a


A system 
B. database system
C. relation 
D. none of the above

10. Distinct levels of data independence arc

A. two 
B. three
C. four 
D. none of the above

11. Database software may be divided into

A. four distinct categories


B. three distinct categories
C. two distinct categories
D. none of the above

12. Any large software project may be divided into several

A. project phases
B. sub projects
C. hardware 
D. none of the above

13. Data modeling occupies an important position in the

A. database file 
B. database life cycle
C. relation 
D. none of the above
14. The term "software engineering" implies the application of scientific knowledge and
discipline to the construction of

A. database record
B. computer hardware system
C. computer software system
D. none of the above

15. Program correctness has been a strong motivation for much of the work in software
engineering and

A. high-level language programming


B. programming language design
C. Pascal
D. none of the above

ANS:
1. B

2. A

3. B

4. B

5. B

6. A

7. B

8. C
9. Do Yourselves

10. Do Yourselves

11. B

12. A

13. B

14. C

15. B

Posted by Anil Kant at 12:02 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, PSU Exam Papers

Friday, September 10, 2010


Operating System Interview Questions Answers
What is difference between NTFS & FAT32? 

Ans: NTFS stands for new technology file system or network technology file system. In NTSF
partition size can be of 2 TB or more. and file size can be 16 TB. file/folder encryption is done.
and it supports file name character upto 255.

FAT32 stands for File allocation table. in FAT32 partition size can be Upto 2 TB. and file size
can be 4 GB. file/folder encryption is not possible in FAT32. and it supports file name character
upto 8.3.

What is the difference XP and Windows 2000? 

Ans: Windows XP is some what faster than Windows 2000, assuming you have a fast
processor and tons of memory (although it will run fine with a 300Mhz Pentium II and 128MB of
RAM).

The new Windows XP interface is more cheerful and colorful than earlier versions, although the
less-cartoony "Classic" interface can still be used if desired.
Windows XP has more bells and whistles, such as the Windows Movie Maker, built-in CD writer
support, the Internet Connection Firewall, and Remote Desktop Connection.
Windows XP has better support for games and comes with more games than Windows 2000.
Windows XP is the latest OS - If you don't upgrade now, you'll probably end up migrating to XP
eventually anyway, and we mere mortals can only take so many OS upgrades.

Posted by Anil Kant at 12:02 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Operating System

Thursday, September 9, 2010


Delhi Metro Rail Corporation Limited Recruitment
Exam
1. Parameter passing mechanism for an array is
a. call by value b. call by value and call by reference
c. call by reference d. none of the above

Ans: (a)

2. Use of functions
a. help to avoid repeating a set of instructions many times
b. enhance the logical flow of the program
c. makes the debugging task easier
d. all of the above

Ans: (d)

3. Storage class defines


a. the data type
b. the scope
c. the scope and performance
d. the scop, performance and data type

Ans: (c)

4. The use of macros in place of functions


a. reduces execution times
b. reduces code size
c. increases execution time
d. increase code size

Ans: (a)

5. Scope of macro definition


a. cannot be beyond the file in which it is defined
b. may be part of a file
c. is in the entire program
d. excludes string of characters within double quotes
e. (a), (b), (d)

Ans: (e)

Posted by Anil Kant at 1:04 AM 1 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, PSU Exam Papers

Wednesday, September 8, 2010


Bharat Electronics Limited Recruitment Exam
1. The address space of 8086 microprocessor is :
a. one megabyte b. 256 kilobytes
c. 1 K megabytes c. 64 kilobytes

Ans: (a) one megabyte

2. Which normal form is considered adequate for normal relational database design ?
a. 2 NF b. 5 NF
c. 4 NF d. 3 NF

Ans: (d) 3 NF

3. When the result of a computation depends on the speed of the processes involved there is
said to be
a. cycle stealing b. race condition
c. a time lock d. a deadlock

Ans: (b) race condition

4. Zero has two representations in


a. sign magnitude
b. 1's complement
c. 2's compliment
d. None of the above

Ans: (a) sign magnitude

5. Which of the following addresing modes permits relocation without any change
a. Indirect addressing b. Indexed Addressing
c. Base register addressing d. PC relative addressing

Ans: (c) Base register addressing

Posted by Anil Kant at 12:51 AM 1 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, PSU Exam Papers

Tuesday, September 7, 2010


Objective Type Question Answers of Operating
System
1. Which of the command is used to remove files ?
a. erase
b. rm
c. delete
d. dm

Ans: b

2. Which of the following command is used to count just the number of lines contained in a file ?
a. wc-1
b. wc-w
c.wc-c
d. wc-r

Ans: a

3. Which command is used to copy a file wb with the same name from the programs directory to
the misc. directory ?
a. copy programs/wb misc/wb
b. cp programs/wb misc
c. copy a:programs/wb b:misc/wb
d. tar programs/wb misc/wb

Ans: b

4. The commonly used UNIX commands like date, Is, cat, etc. are stored in
a. /dev directory
b. /bin and /usr/bin directories
c. /unix directory
d. /tmp directory

Ans: b

5. Which of the following directories contain all the files created by a user, including his login
directory ?
a. /tmp
b. /usr
c. /etc
d. /dev

Ans: b

6. Which command is used to copy the three files wb, colllect and mon into the misc directory,
under the same, when you were currently in the programs directory ?
a. copy wb collect mon/misc
b. cp wb collect mon ../misc
c. copy wb ../misc collect ../misc mon ../misc
d. tar wb collect mon/misc

Ans: b

7. Which of the following command is used to display the directory attributes rather than its
contents ?
a. 1s-1-d
b. Is-x
c. Is-1
d. is-F

Ans: a

8. Which command is used to remove a directory


a. rd
b. dldir
c. rmdir
d. rdir

Ans: c

9. Which command is used to list out all the hidden files along with the other files ?
a. Is-1
b. Is-F
c. Is-x
d Is-a

Ans: d

10. The file that contains a set of instructions which are performed when a user logs in, is
a) .exrc
b) .profile
c) autoexec.bat
d) .autoexec

Ans: b

Posted by Anil Kant at 2:48 AM 1 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Operating System, PSU Exam Papers, UGC Net

Operating System Questions


1. Which of the following command can be used to get information about all user who are
currently logged into the system ?
a. which
b. who am i
c. who
d. 1/u

Ans: c

2. The command used to remove the directory is


a. rmdir
b. remove
c. rd
d. rdir
Ans: a

3. Which of the following command can be used to get information about yourself
a. who am i
b. pwd
c. i/4
d. which

Ans: a

4. Which of the following command is used to summarize the disk usage ?


a. chkdsk
b. du
c. fdisk
d. disk

Ans: b

5. Which of the following commands is used to copy directory structures in and out ?
a. cp
b. cp-p
c. cpio
d. copy

Ans: c

6. Which of the following signs is used to backup over typing errors in vi ?


a. @
b. $
c. #
d. !

Ans: c
7. Which of the following commands is used to change the working directory ?
a. cd
b. chdir
c. changedir
d. cdir

Ans: a

8. Which of the following signs is used to erase or kill an entire line you have typed and start you
are on a new line(but not display a new prompt) ?
a. @
b. $
c. #
d. !

Ans: a

9. Which of the following commands is used to count the total number of lines, words and
characters contained in a file.
a. count p
b. wcount
c. wc
d. countw

Ans: c

10. Which of the following commands is used to list contents of directories ?


a. 1s
b. dir
c. 1p
d. tar
Ans: a

Posted by Anil Kant at 1:13 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Operating System, PSU Exam Papers, UGC Net

Sunday, September 5, 2010


UGC Net Computer Science and Application Paper
1. The library files that comes with 'C' are -
Ans: files that contains functions which carry out various commonly used operations and
calculations.

2. In 'C' square brackets[] are used in -


a. functions
b. arrays
c. statements
d. all of the above
ANs: b

3. A 'C' program contains the declarations and initial assignments:


int i=8, j=5;
The value of arithmetic expression is int from
2*((i/5)+(4*j-3)%(i+j-2)) is

a. 18
b. 14
c. 1
d. 17

Ans: b

4. The single character input/output functions are


Ans: getchar() and putchar()
5. The purpose of a conditional operator is to-
a. select one of the two values alternately
b. select the highest of the two values
c. select one of the two values depending on a condition
d. select the more equal of the two values

Ans: c

Posted by Anil Kant at 1:45 AM 1 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Computer Science and Applications, Programing in C and C+
+, UGC Net

Saturday, September 4, 2010


United Bank of India IT Officer Examination Technical
Paper
Ques 1. What do you understand by M-Banking ? What the benifits of M-Banking in Banks ?
How M-Marketing is useful for Banks net profit ?

Ques 2. Differentiate two-tier and three-tier client server architecture ?

Ques 3. What do you understand by knowledge searching in Database ? How you relate it with
database mining ? How Data mining useful in Database and in busines ?

Posted by Anil Kant at 4:13 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, DBMS Interview Questions, PSU Exam Papers

Friday, September 3, 2010


Computer Networks Question Papers
State Whether True or False:

1. The 5-7 digits are known as the country code of the Network User Address(NUA). (T/F)

2. The physical layer, in reference to the OSI model, defines the interface between the X.25
network and the Packet mode device. (T/F)
3. The second layer of communication is the data link layer. (T/F)

4. The data link layer, in reference to the OSI model, the Recommendation X.25 specifies data
link procedures that provide for the exchange of data via frames that can be sent and recieved.
(T/F)

5. The third layer of communication is the network layer. (T/F)

Ans:

(1) T
(2) T
(3) T
(4) F
(5) T

Posted by Anil Kant at 2:28 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Computer Networking, PSU Exam Papers

Networking Question for Examinations


State Whether True or False

1. The First three digit of the DNIC(Data Network Identification Code) identify the city. (T/F)

2. The use of an X.25 Switch as a gateway between the public and private networks provides a
cost-effective means of sharing relatively expensive X.25 access lines to the public data
networks. (T/F)

3. The Network User Address (NUA) consist of 12 decimal digits and two optional extra digits
which are available for packet terminals only to use for sub-addressing. (T/F)

4. The first digit of Network User Address(NUA) are known as the DNIC(Data Network
Identification Code). (T/F)
5. The term 'gateway' is commonly used to define a facility which interconnects two networks so
that users on one network can communicate with user on another network. (T/F)

6. The term 'gateway' which provides interconnection between private packet switching
networks based on OSI principles and the public packet data networks based on the X-series
recommendations. (T/F)

7. The 1-4 digits are known as the country code of the Network User Address(NUA). (T/F)

8. The digits 8 to 12 are known as the terminal number of the NUA. (T/F)

9. The CCITT Recommendation X.25 specifies three layers of communications: session,


transport and network. (T/F)

10. CCITT Recommendation X.21 defines the international nubering plan for private data
networks. (T/F)

Ans:
(1). T, (2). T, (3). T, (4). F, (5). T, (6). T, (7). F, (8). T, (9). T, (10). T

Posted by Anil Kant at 12:34 AM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Computer Networking

Thursday, September 2, 2010


PSU Papers for Computer Science
1. Dijkstra's banking algorithm in an operating system solves the problem of -
Ans: Deadlock Avoidance

2. In a paged memory system, if the page size is increased, then the internal fragmentation
generally -
Ans: Becomes more

3. An operating system contains 3 user processes each requiring 2 units of resources R. The
minimum number of units of R such that no deadlock will ever occur is -
Ans: 4

4. Critical region is -
Ans: A set of instructions that access common shared resources which exclude one another in
time

5. Kernel is -
Ans: The set of primitive functions upon which the rest of operating system functions are built up

6. Necessary conditions for deadlock are -


Ans: Non-preemption and circular wait, Mutual exclusion and partial allocation

7. In a time sharing operating system, when the time slot given to a process is completed, the
process goes from the RUNNING state to the -
Ans: READY state

8. Supervisor call -
Ans: Are privileged calls that are used to perform resource management functions, which are
controlled by the operating system

9. Semaphores are used to solve the problem of -


Ans: Mutual exclusion, Process synchronization

10. If the property of locality of reference is well pronounced in a program-


Ans: The number of page faults will be less

Posted by Anil Kant at 11:38 PM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Operating System, PSU Exam Papers

Operating System - Question Answer


1. In Round Robin CPU Scheduling, as the time quantum is increased, the average turn around
time-
Ans: varies irregulary
2. In a multiprogramming environment-
Ans: more than one process resides in the memory

3. The size of the virtual memory depends on the size of the -


Ans: Address Bus

4. Give example of Scheduling Policies in which context switching never take place-
Ans: Shortest Job First, First-cum-first-served

5. Suppose that a process is in 'BLOCKED' state waiting for some I/O service. When the service
is completed, it goes to the-
Ans: READY State

Posted by Anil Kant at 10:34 PM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Operating System

Operating System Question Answer for Competitive


Exams
1. Pre-emptive scheduling, is the strategy of temporarily suspending a running process-
Ans: before the CPU time slice expires

2. Mutual exclusion problem occurs -


Ans: among processes that share resources

3. Sector interleaving in disks is done by -


Ans: the operating system

4. Disk scheduling involves deciding-


Ans: the order in which disk access requests must be serviced

5. Dirty bit is used to show the -


Ans: page that is modified after being loaded into cache memory
6. Fence register is used for-
Ans: memory protection.

7. The first-fit, best-fit and worst-fit algorithm can be used for-


Ans: contiguous allocation of memory

8. Give example of single-user operating systems-


Ans: MS-DOS, XENIX

Posted by Anil Kant at 10:24 PM 1 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Operating System

Wednesday, September 1, 2010


Operating System Question Answer
1. Concurrent processes are processes that -
Ans: Overlap in time

2. The page replacement policy that sometimes leads to more page faults when the size of the
memory is increased is -
Ans: FIFO

3. The only state transition that is initiated by the user process itself is -
Ans: Block

4. Fragmentation is -
Ans: fragments of memory words unused in a page

5. Give Example of real time systems


Ans: Aircraft control system, A process control system

Posted by Anil Kant at 11:28 PM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Operating System, PSU Exam Papers

Tuesday, August 31, 2010


Computer Officer Exam Paper
1. Virtual memory is -
Ans: an illusion of an extremely large memory

2. Special locality refers to the problem that once a location is referenced


Ans: a nearby location will be referenced soon

3. An example of a SPOOLED device


Ans: A line printer used to print the output of a number of jobs

4. Page faults occurs when


Ans: one tries to divide a number by 0

5. Overlay is
Ans: a single contiguous memory that was used in the olden days for running large programs by
swapping

Posted by Anil Kant at 11:18 PM 0 comments Email ThisBlogThis!Share to TwitterShare to


FacebookShare to Google Buzz
Labels: Bank IT Officer Exam Papers, Operating System, PSU Exam Papers

Bank IT Officer Exam Papers


1. Which is Computer Memory that does not forget ?
Ans: ROM

2. The computer memory holds data and ?


ans: program

3. What is means by term RAM ?


Ans: Memory which can be both read and written to

4. Which computer memory is esentially empty ?


Ans: RAM
5. The bubbles in a bubble memory pack are created with the help of ?
Ans: magnetic field

Operating System Question Answer


1. Concurrent processes are processes that -
Ans: Overlap in time

2. The page replacement policy that sometimes leads to more page faults when the size of the
memory is increased is -
Ans: FIFO

3. The only state transition that is initiated by the user process itself is -
Ans: Block

4. Fragmentation is -
Ans: fragments of memory words unused in a page

5. Give Example of real time systems


Ans: Aircraft control system, A process control system

System Analysis and Design/Data Oriented Systems Design Multiple Choice Questions

7.1 A data dictionary has consolidated list of data contained in

(i) dataflows (ii) data stores

(iii) data outputs (iv) processes

a. (i) and (iii)

b. (i) and (ii)


c. (ii) and (iv)

d. (i) and (iv)

7.2 A data dictionary is useful as

(i) it is a documentation aid

(ii) it assists in designing input forms

(iii) it contains al data in an application including temporary data used in

processes

(iv) it is a good idea in system design

a. (i) and (ii)

b. (i) and (iv)

c. (i),(ii) and (iii)

d. (i) and (iv)

7.3 By metadata we mean

a. very large data

b. data about data

c. data dictionary

d. meaningful data

7.4 A data dictionary is usually developed

a. At requirements specification phase

b. During feasibility analysis

c. When DFD is developed

d. When a datadase is designed

7.5 A data dictionary has information about

a. every data element in a data flow

b. only key data element in a data flow


c. only important data elements in a data flow

d. only numeric data elements in a data flow

7.6 A data element in a data dictionary may have

a. only integer value

b. no value

c. only real value

d. only decimal value

V. Rajaraman/IISc. Bangalore M7/V1/July 04/1System Analysis and Design/Data Oriented Systems


Design Multiple Choice Questions

7.7 A data element in a data flow

(i) may be an integer number

(ii) may be a real number

(iii)may be binary

(iv)may be imaginary

a. (i),(ii),(iv)

b. (iii),(iv),(ii)

c. (i),(ii),(iii)

d. (i) and (ii)

7.8 It is necessary to carefully design data input to a computer based system

because

a. it is good to be careful

b. the volume of data handled is large

c. the volume of data handled is small

d. data entry operators are not good

7.9 Errors occur more often when

a. data is entered by users


b. data is entered by operators

c. when data is handwritten by users and entered by an operator

d. the key board design is bad

7.10 Good system design prevents data entry errors by

(i) Designing good forms with plenty of space to write in

block capitals

(ii)By giving clear instructions to a user on how to fill a form

(iii)Reducing keystrokes of an operator

(iv)Designing good keyboard

a. i, ii, iii

b. i, ii, iv

c. i, ii

d. iii and iv

7.11 In on-line data entry it is possible to

a. Give immediate feedback if incorrect data is entered

b. Eliminate all errors

c. Save data entry operators time

d. Eliminate forms

7.12 The main problems encountered in off-line data entry are:

(i)Data are entered by operators

V. Rajaraman/IISc. Bangalore M7/V1/July 04/2System Analysis and Design/Data Oriented Systems


Design Multiple Choice Questions

(ii)Data entered by hand in forms batched and forms may be missed

or misread

(iii) Errors are detected after a lapse of time

(iv)Data are entered by users


a. i and ii

b. i and iii

c. ii and iii

d. iii and iv

7.13 In interactive data input a menu is used to

a. enter new data

b. add/delete data

c. select one out of many alternatives often by a mouse click

d. detect errors in data input

7.14 In interactive data input a template is normally used to

a. enter new data

b. add/delete data

c. select one out of many alternatives often by a mouse click

d. detect errors in data input

7.15 In interactive data input terminal commands are normally used to

a. enter new data

b. add/delete data

c. select one out of many alternatives often by a mouse click

d. detect errors in data input

7.16 Data inputs which required coding are

a. fields which specify prices

b. key fields

c. name fields such as product name

d. fields which are of variable length

7.17 Key fields are normally coded


a. i and ii

b. i and iv

c. ii and iii

d. i and iii

7.18 A code is useful to represent a key field because

a. it is a concise representation of the field

b. it is usually done by all

c. it is generally a good idea

d. it is needed in database design

7.19 By the term “concise code” we understand that the code

a. conveys information on item being coded

b. is of small length

c. can add new item easily

d. includes all relevant characteristics of item being coded

7.20 By the term “expandable code” we understand that the code

a. conveys information on item being coded

b. is of small length

V. Rajaraman/IISc. Bangalore M7/V1/July 04/3System Analysis and Design/Data Oriented Systems


Design Multiple Choice Questions

c. can add new item easily

d. includes all relevant characteristics of item being coded

7.21 By the term “meaningful code” we understand that the code

a. conveys information on item being coded

b. is of small length

c. can add new item easily

d. includes all relevant characteristics of item being code


7.22 By the term “comprehensive code“ we understand that the code

a. conveys information on item being coded

b. is of small length

c. can add new item easily

d. includes all relevant characteristics of item being coded

7.23 A concise code is necessarily

a. Precise

b. Meaningful

c. Comprehensive

d. Difficult

7.24 Serial numbers used as codes are

(i) concise

(ii ) meaningful

(iii) expandable

(iv) comprehensive

a. i and ii

b. ii and iii

c. ii and iv

d. i and iii

7.25 Block codes are

(i)concise

(ii )meaningful

(iii)expandable

(iv)comprehensive

a. i and ii
b. ii and iii

c. iii and iv

d. i and iii

7.26 Group classification codes are

(i)concise

(ii)meaningful

(iii) expandable

V. Rajaraman/IISc. Bangalore M7/V1/July 04/4System Analysis and Design/Data Oriented Systems


Design Multiple Choice Questions

(iv)comprehensive

a. i and ii

b. i, ii and iii

c. ii, iii and iv

d. i, ii and iv

7.27 Significant codes are

(i)concise

(ii)meaningful

(iii )expandable

(iv)comprehensive

a. i and ii

b. i, ii and iii

c. ii, iii and iv

d. i, ii and iv

7.28 In significant codes some or all parts of the code

a. are meaningful

b. are usable
c. are significant

d. represent values

7.29 Errors in codes are detected by

a. proper design of code

b. introducing redundant digits/characters designed to detect errors

c. making the code concise

d. making the code precise

7.30 Design of error detecting codes requires good

a. knowledge of mathematics

b. statistical mechanics

c. statistics of errors normally committed during data entry

d. Boolean algebra

7.31 A modulus-11 check digit is used to detect error in

a. alphanumeric codes

b. numeric codes

c. hexadecimal codes

d. serial number code

7.32 A modulus-11 check digit will detect

(i)single transcription errors

(ii)single transposition errors

(iii)multiple digit transcription errors

(iv)and correct a single error

a. i and iii

b. i and iv

c. i and ii
d. iii and iv

V. Rajaraman/IISc. Bangalore M7/V1/July 04/5System Analysis and Design/Data Oriented Systems


Design Multiple Choice Questions

7.33 A modulus-17 check will detect single transcription errors in

a. alphanumeric codes

b. hexadecimal codes

c. decimal numerical codes

d. serial number codes

7.34 For modulus-11 check digit to detect a single transposition errors

a. weights should all be distinct

b. weights may all be equal and > 0

c. weights should be less than 8

d. weights should all be > 0 and distinct

7.35 For modulus-11 check digit to detect a single transcription errors

a. weights should all be distinct

b. weights may all be equal and > 0

c. weights should be less than 8

d. weights should all be > 0 and distinct

7.36 Modulus-11 check digit for the code 45672 is

a. 0

b. 1

c. 2

d. 3

7.37 Modulus-11 check digit for the code 85672 is

a. 0

b. 1
c. X

d. 3

7.38 For modulus-11 check digit to detect single transposition or single

transcription error the number of digits in the codes should not exceed

a. 9

b. 10

c. 11

d. 99

7.39 Modulus-17 check character for the hexadecimal code AB4567 is

a. F

b. D

c. 1

d. 0

7.40 Sequence numbering of records is used to

(i)Identify each record uniquely

(ii)Track a missing record in a batch of records

(iii)Count number of records

(iv) Sort the records

a. i, ii

b. i, ii, iii

c. i, ii, iii, iv

d. i and iv

V. Rajaraman/IISc. Bangalore M7/V1/July 04/6System Analysis and Design/Data Oriented Systems


Design Multiple Choice Questions

7.41 A batch control record uses

(i)Batch totals of selected fields


(ii)A simple count of number of records in a batch

(iii)Modulus-11 check digit of each key field

(iv)Totals of selected fields of record totalled for the batch

a. i and ii

b. i, ii, iv

c. i, ii, iii, iv

d. iii and iv

7.42 A record total uses

a. batch totals of selected fields

b. count of numbers of records

c. modulus-11 check digit sum of all fields

d. total of selected fields of a record

7.43 If a field is known to represent an angle of a triangle, radix used to check

should be

a. 90

b. 60

c. 180

d. 360

7.44 If a field is known to represent days of a month, radix used to check should

a. 30

b. 31

c. 28

d. 29

7.45 Radix check for a field representing year is

a. Possible
b. not possible

c. not relevant

d. may be tried

7.46 An appropriate range check for marks in an examination paper whose

maximum marks 100 is

a. 100

b. 0 to 100

c. – 99 to +99

d. 99

7.47 An appropriate range check for month field in a date is

a. 12

b. –12 to 12

c. 1 to 12

d. 0 to 12

7.48 An appropriate range check of age of a tenth standard student in a high

school

a. 5 to 15

b. 10 to 25

V. Rajaraman/IISc. Bangalore M7/V1/July 04/7System Analysis and Design/Data Oriented Systems


Design Multiple Choice Questions

c. 8 to 20

d. 3 to 18

7.49 Reasonableness checks for monthly mess bill of a student if daily rate is

Rs. 40 is

a. 1200

b. 12000
c. 120

d. 2400

7.50 Batch control totals will detect

(i)incorrect data entry of a field

(ii)missing record

(iii) data records out of order

( iv)inconsistent data

a. i and ii

b. i, ii and iii

c. ii, iii and iv

d. iii and iv

7.51 If records are out-of-order then error may be detected by

a. batch control totals

b. radix check

c. sequence number check

d. range check

7.52 In payroll record a reasonable inter-field relationship check is to relate

salary field with

a. age field

b. department field

c. designation field

d. increment field

V. Rajaraman/IISc. Bangalore M7/V1/July 04/8System Analysis and Design/Data Oriented Systems


Design Multiple Choice Questions

Key to Objective Questions

7.1 b 7.2 c 7.3 b 7.4 c 7.5 a 7.6 b


7.7 c 7 .8 b 7.9 c 7.10 a 7.11 a 7.12 c 7.13

c 7.14 a 7.15 b 7.16 b 7.17 d 7.18 a

7.19 b 7.20 c 7.21 a 7.22 d 7.23 a 7.24

d 7.25 b 7.26 c 7.27 c 7.28 d 7.29 b 7.30

c 7.31 b 7.32 c 7.33 b 7.34 d 7.35 b 7.36 b

7.37 c 7.38 b 7.39 b 7.40 c 7.41 b 7.42 d

7.43 c 7.44 b 7.45 b 7.46 b 7.47 c 7.48 c 7.49 d

7.50 a 7.51 c 7.52 c

V. Rajaraman/IISc. Bangalore M7/V1/July 04/9

Objective Questions of 'C'


1. Precedence determines which operator
a. is evaluated first
b. is most important
c. is fastest
d. operates on the largest number

Ans: a

2. A expression contains relational assignment and arithmetic operator. In the absence of


parentheses, the order of evaluation will be

a. assignment, relational, arithmetic


b. arithmetic, relational, assignment
c. relational, arithmetic, assignment
d. assignment, arithmetic, relational

Ans: b
3. The commands that send or "redirect" output of a program to a disk file or another system
device such as the printer are

a. 
b. [and]
c. /* and /*
d. ( and )

Ans: a

4. Which of the following scanf() statements is true ?


a. scanf("%f', float-var-name);
b. scanf("%d ∑");
c. scanf("%d", &int-var-name);
d. scanf("%d", &number);

Ans: d

5. The meaning of conversion character h for data input is


a. data item is an unsigned decimal integer
b. data item is a short integer
c. data item is a hexadecimal integer
d. data item is a string folowed by a whitespace character

Ans: b

Questions

 
Question 1.

What is the correct value to return to the operating system upon the successful completion of a
program?
A. -1
B. 1
C. 0
D. Programs do not return a value.

Question 2.

What is the only function all C++ programs must contain?


A. start()
B. system()
C. main()
D. program()

Question 3.

What punctuation is used to signal the beginning and end of code blocks?
A. { }
B. -> and <-
C. BEGIN and END
D. ( and )

Question 4.

What punctuation ends most lines of C++ code?


A. . (dot)
B. ; (semi-colon)
C. : (colon)
D. ' (single quote)

Question 5.
Which of the following is a correct comment?
A. */ Comments */
B. ** Comment **
C. /* Comment */
D. { Comment }

Question 6.

Which of the following is not a correct variable type?


A. float
B. real
C. int
D. double

Question 7.

Which of the following is the correct operator to compare two variables?


A. :=
B. =
C. equal
D. ==

Question 8.

Which of the following is true?


A. 1
B. 66
C. .1
D. -1
E. All of the above

Question 9.
Which of the following is the boolean operator for logical-and?
A. &
B. &&
C. |
D. |&

Question 10.

Evaluate !(1 && !(0 || 1)).


A. True
B. False
C. Unevaluatable

Scroll Down for answers

 
 

Answers

1. C. 0
2. C. main()
3. A. { }
4. B. ;
5. C. /* Comment */
6. B. real
7. D. ==
8. E. All of the above
9. B. &&
10. A. True

Question 1

Identify the correct statement

a. Programmer can use comments to include short explanations within the source


code itself.

b. All lines beginning with two slash signs are considered comments.

c. Comments very important effect on the behaviour of the program


d. both

Question 2

The directives for the preprocessors begin with

a.    Ampersand symbol (&

b.    Two Slashes (//)

c.    Number Sign (#)

d.    Less than symbol (<

Question 3

The file iostream includes

a.    The declarations of the basic standard input-output library.

b.    The streams of includes and outputs of program effect.

c.    Both of these

d.    None of these

Question 4

There is a unique function in C++ program by where all C++ programs start their execution

a.    Start()

b.    Begin()

c.    Main()

d.    Output()

 
Question 5

Every function in C++ are followed by

a.    Parameters

b.    Parenthesis

c.    Curly braces

d.    None of these

Question 6

Which of the following is false?

a.    Cout represents the standard output stream in c++.

b.    Cout is declared in the iostream standard file

c.    Cout is declared within the std namespace

d.    None of above

Question 7

Every statement in C++ program should end with

a.    A full stop (.)

b.    A Comma (,)

c.    A Semicolon (

d.    A colon (

Question 8

Which of the following statement is true about preprocessor directives?


a.    These are lines read and processed by the preprocessor

b.    They do not produce any code by themselves

c.    These must be written on their own line

d.    They end with a semicolon

Question 9

A block comment can be written by

a.    Starting every line with double slashes (//)

b.    Starting  with /* and ending with */

c.    Starting with //* and ending with *//

d.    Starting with <!- and ending with -!>

Question 10

When writing comments you can

a.    Use code and  /* comment on the same line

b.    Use code and // comments on the same line

c.    Use code and //* comments on the same line

d.    Use code and <!- comments on the same line

 
 

Answers

1.    b.  All lines beginning with two slash signs are considered comments.

2.    c. Number Sign (#)

3.    a. The declarations of the basic standard input-output library.

4.    c. Main()

5.    b. Parenthesis

6.    d. None of above

7.    c. A semicolon

8.    d. They end with a semicolon

9.    b. Starting  with /* and ending with */

10.    b. Use code and // comments on the same line

Question 1

 
A variable is/are

a.    String that varies during program execution

b.    A portion of memory to store a determined value

c.    Those numbers that are frequently required in programs

d.    None of these

Question 2

Which of the following can not be used as identifiers?

a.    Letters

b.    Digits

c.    Underscores

d.    Spaces
 

Question 3

Which of the following identifiers is invalid?

a.    papername

b.    writername

c.    typename

d.    printname

Question 4

Which of the following can not be used as valid identifier?

a.    bitand

 
b.    bittand

c.    biand

d.    band

Question 5

The difference between x and ‘x’ is

a.    The first one refers to a variable whose identifier is x and the second one refers to
the character constant x

b.    The first one is a character constant x and second one is the string literal x

c.    Both are same

d.    None of above

Question 6
 

Which of the following is not a valid escape code?

a.    \t

b.    \v

c.    \f

d.    \w

Question 7

Which of the following statement is true?

a.    String Literals can extend to more than a single line of code by putting a backslash
sign at the end of each unfinished line.

b.    You can also concatenate several string constants separating them by one or several
blank spaces, tabulators, newline or any other valid blank character

 
c.    If we want the string literal to explicitly made of wide characters, we can precede the
constant with the L prefix

d.    All of above

Question 8

Regarding #difine which of the following statement is false?

a.    It is not C++ statement but the directive for the preprocessor

b.    This does not require a semicolon at the end of line

c.    It is a C++ statement that declares a constant in C++

d.    None of the above

Question 9

 
Regarding following statement  which of the statements is true?

const int pathwidth=100;

a.    Declares a variable pathwidth with 100 as its initial value

b.    Declares a construction pathwidth with 100 as its initial value

c.    Declares a constant pathwidth whose value will be 100

d.    Constructs an integer type variable with pathwidth as identifier and 100 as value

Question 10

In an assignment statement

a.    The lvalue must always be a variable

b.    The rvalue might be a constant, a variable, an expression or any combination of these

c.    The assignment always takes place from right to left and never the other way
 

d.    All of above

Answers

1.     b. A portion of memory to store a determined value

2.     d.  Spaces


 

3.     c. Typename

4.     a. Bitand

5.     a. The first one refers to a variable whose identifier is x and the second one refers to
the character constant x

6.     d. \w

7.     d. All of above

8.     c. It is a C++ statement that declares a constant in C++

9.    c. Declares a constant pathwidth whose value will be 100

10. d. All of above

Questions

Question 1

In an assignment statement
a=b;

Which of the following statement is true?

a.    The variable a and the variable b are equal.

b.    The value of b is assigned to variable a but the later changes on variable b will not
effect the value of variable a

c.    The value of b is assigned to variable a and the later changes on variable b will effect
the value of variable a

d.    The value of variable a is assigned to variable b and the value of variable b is assigned
to variable a.

Question 2

All of the following are valid expressions in C++

a  =  2 + (b = 5);

a  = b = c = 5;

a  = 11 % 3

a.    True

b.    False

Question 3:

To increase the value of c by one which of the following statement is wrong?

a.    c++;

b.    c = c + 1;

c.    c + 1 => c;
d.    c += 1

Question 4:

When following piece of code is executed, what happens?

b = 3;

a = b++;

a.    a contains 3 and b contains 4

b.    a contains 4 and b contains 4

c.    a contains 4 and b contains 3

d.    a contains 3 and b contains 3

Question 5:

The result of a Relational operation is always

a.    either True or False

b.    is less than or is more than

c.    is equal or less or more

d.    All of these

Question 6:

Which of the following is not a valid relational operator?


a.    ==

b.    =>

c.    >=

d.    >=

Question 7:

What is the final value of x when the code int x; for(x=0; x<10; x++) {} is run?

A. 10

B. 9

C. 0

D. 1

Question 8:

When does the code block following while(x<100) execute?

A. When x is less than one hundred

B. When x is greater than one hundred

C. When x is equal to one hundred

D. While it wishes

Question 9:

Which is not a loop structure?


A. for

B. do while

C. while

D. repeat until

Question 10:

How many times is a do while loop guaranteed to loop?

A. 0

B. Infinitely

C. 1

D. Variable

 
 

Answers

1.    b. The value of b is assigned to variable a but the later changes on variable b will not effect
the value of variable a

2.    a. True

3.    c. c + 1 => c;

4.    a. a contains 3 and b contains 4

5.    a. either True or False

6.    b. =>

7.    A. 10

8.    A. When x is less than one hundred

9.    D. Repeat Until

10.    C. 1

Questions
Question 1
Streams are
a.       Abstraction to perform input and output operations in sequential media
b.      Abstraction to perform input and output operations in direct access media
c.       Objects  where a program can either insert or extract characters to and from it
d.      Both a and c

Question 2
Which of the following is known as insertion operator?
a.       ^
b.      v
c.       << 
d.      >> 

Question 3:
Regarding the use of  new line character (/n) and endl manipulator with cout statement
a.       Both ways are exactly same
b.      Both are similar but endl additionally performs flushing of buffer
c.       endl can’t be used with cout
d.      \n can’t be used with cout

Question 4:
Which of the following is output statement in C++?
a.       print
b.      write
c.       cout
d.      cin

Question 5:
Which of the following is input statement in C++?
a.       cin
b.      input
c.       get
d.      none of above 

Question 6:
By default, the standard output device for C++ programs is
a.       Printer
b.      Monitor
c.       Modem
d.      Disk
 

Question 7:
By default, the standard input device for C++ program is
a.       Keyboard
b.      Mouse
c.       Scanner
d.      None of these

Question 8:
Which of the following statement is true regarding cin statement?
a.       cin statement must contain a variable preceded by >> operator
b.      cin does not process the input until user presses RETURN key
c.       you can use more than one datum input from user by using cin
d.      all of above

Question 9:
Which of the following is extraction operator in C++?
a.       ^
b.      v
c.       << 
d.      >> 

 
Question 10:
When requesting multiple datum, user must separate each by using
a.       a space
b.      a tab character
c.       a new line character
d.      all of above

Answers

1.       d. Both a and c


2.       c. <<
3.       b. Both are similar but endl additionally performs flushing of buffer
4.       c. Cout
5.       a. Cin
6.       b. Monitor
7.       a. Keyboard
8.       d. All of above
9.       d. >>
10.   d. all of above

Question 1:

 
cin extraction stops execution as soon as it finds any blank space character
 
a.       true
b.      false
 

Question 2:

 
Observe the following statements and decide what do they do.
 
string mystring;
 
getline(cin, mystring);
 
a.       reads a line of string from cin into mystring
b.      reads a line of string from mystring into cin
c.       cin can’t be used this way
d.      none of above
 

Question 3:

 
Regarding stringstream identify the invalid statement
 
a.       stringstream is defined in the header file <sstream>
b.      It allows string based objects treated as stream
c.       It is especially useful to convert strings to numerical values and vice versa.
d.      None of above
 

Question 4:

 
Which of the header file must be included to use stringstream?
 
a.       <iostream>
b.      <string>
c.       <sstring>
d.      <sstream>
 

Question 5:

 
Which of the following header file does not exist?
 
a.       <iostream>
b.      <string>
c.       <sstring>
d.      <sstream>
 

Question 6:

 
If you use same variable for two getline statements
 
a.       Both the inputs are stored in that variable
b.      The second input overwrites the first one
c.       The second input attempt fails since the variable already got its value
d.      You can not use same variable for two getline statements
 
 
Question 7:

 
The “return 0;” statement in main function indicates
 
a.       The program did nothing; completed 0 tasks
b.      The program worked as expected without any errors during its execution
c.        not to end the program yet.
d.      None of above
 

Question 8:

 
Which of the following is not a reserve keyword in C++?
 
a.       mutable
b.      default
c.       readable
d.      volatile
 

Question 9:

 
The size of following variable is not 4 bytes in 32 bit systems
 
a.       int
b.      long int
c.       short int
d.      float
 

Question 10:

 
Identify the correct statement regarding scope of variables
 
a.       Global variables are declared in a separate file and accessible from any program.
b.      Local variables are declared inside a function and accessible within the function only.
c.       Global variables are declared inside a function and accessible from anywhere in program.
d.      Local variables are declared in the main body of the program and accessible only from
functions.

Answers

1.       a. True
2.       a. Reads a line of string from cin into mystring
3.       d. None of above
4.       d. <sstream>
5.       c. <sstring>
6.       b. The second input overwrites the first one
7.       b. The program worked as expected without any errors during its execution
8.       c. readable
9.       c. short int
10      b. Local variables are declared inside a function and accessible within the function on

Question 1:
Find out the error in following block of code.

If (x = 100)

    Cout << “x is 100”;

a.       100 should be enclosed in quotations


b.      There is no semicolon at the end of first line
c.       Equals to operator mistake
d.      Variable x should not be inside quotation
 

Question 2:
Looping in a program means

a.       Jumping to the specified branch of program


b.      Repeat the specified lines of code
c.       Both of above
d.      None of above
 

Question 3:
The difference between while structure and do structure for looping is

a.       In while statement the condition is tested at the end of first iteration


b.      In do structure the condition is tested at the beginning of first iteration
c.       The do structure decides whether to start the loop code or not whereas while statement
decides whether to repeat the code or not
d.      In while structure condition is tested before executing statements inside loop whereas in do
structure condition is tested before repeating the statements inside loop
 

Question 4:
Which of the following is not a looping statement in C?
a.       while
b.      until
c.       do
d.      for
Question 5:
Which of the following is not a jump statement in C++?

a.       break
b.      goto
c.       exit
d.      switch
 

Question 6:
Which of the following is selection statement in C++?

a.       break
b.      goto
c.       exit
d.      switch
 

Question 7:
The continue statement

a.       resumes the program if it is hanged


b.      resumes the program if it was break was applied
c.       skips the rest of the loop in current iteration
d.      all of above
 

Question 8:
Consider the following two pieces of codes and choose the best answer

CODE 1:
switch (x) {

case  1:

cout <<”x is 1”;

break;

case 2:

                cout <<”x is 2”;

                break;
default:

                cout <<”value of x unknown”;

CODE 2
If (x==1){

                Cout <<”x is 1”;

                }

Else if (x==2){

                Cout << “x is 2”;

                }

Else{

                Cout <<”value of x unknown”;

}             

a.       Both of the above code fragments have the same behaviour


b.      Both of the above code fragments produce different effects
c.       The first code produces more results than second
d.      The second code produces more results than first.
 

Question 9:
Observe the following block of code and determine what happens when x=2?

switch (x){

case 1:

case 2:

case 3:

                cout<< "x is 3, so jumping to third branch";

                goto thirdBranch;

default:

                cout<<"x is not within the range, so need to say Thank You!";


                }

a.       Program jumps to the end of switch statement since there is nothing to do for x=2
b.      The code inside default will run since there is no task for x=2, so, default task is run
c.       Will display x is 3, so jumping to third branch and jumps to thirdBranch.
d.      None of above
 

Question 10
Which of the following is false for switch statement in C++?

a.       It uses labels instead of blocks


b.      we need to put break statement at the end of the group of statement of a condition
c.       we can put range for case such as case 1..3
d.      None of above

 
Answers

1.       c. Equals to operator mistake


2.       b. Repeat the specified lines of code
3.       In while structure condition is tested before executing statements inside loop whereas in do
structure condition is tested before repeating the statements inside loop
4.       b. Until
5.       d. Switch
6.       d. Switch
7.       c. skips the rest of the loop in current iteration
8.       a. Both of the above code fragments have the same behaviour
9.       c. Will display x is 3, so jumping to third branch and jumps to thirdBranch
10.   c. we can put range for case such as case 1..3

Question 1:

The void specifier is used if a function does not have return type.

a.       True

b.      False

Question 2:

You must specify void in parameters if a function does not have any arguments.

a.       True

b.      False

 
Question 3:

Type specifier is optional when declaring a function

a.       True

b.      False

Question 4:

Study the following piece of code and choose the best answer

int x=5, y=3, z;

a=addition(x,y)

a.       The function addition is called by passing the values

b.      The function addition is called by passing reference

Question 5:

In case of arguments passed by values when calling a function such as z=addidion(x,y),

a.       Any modifications to the variables x & y from inside the function will not have any effect
outside the function.

b.      The variables x and y will be updated when any modification is done in the function

c.       The variables x and y are passed to the function addition

d.      None of above are valid.

Question 6:

If the type specifier of parameters of a function is followed by an ampersand (& , that function
call is
a.       pass by value

b.      pass by reference

Question 7:

In case of pass by reference

a.       The values of those variables are passed to the function so that it can manipulate them

b.      The location of variable in memory is passed to the function so that it can use the same
memory area for its processing

c.       The function declaration should contain ampersand (&  in its type declaration

d.      All of above

Question 8:

Overloaded functions are

a.       Very long functions that can hardly run

b.      One function containing another one or more functions inside it.

c.       Two or more functions with the same name but different number of parameters or type.

d.      None of above

Question 9:

Functions can be declared with default values in parameters. We use default keyword to specify
the value of such parameters.

a.       True

b.      False
 

Question 10:

Examine the following program and determine the output

#include <iostream>

using namespace std;

int operate (int a, int b)

                return (a * b);

float operate (float a, float b)

                return (a/b);

int main()

                int x=5, y=2;

                float n=5.0, m=2.0;

                cout << operate(x,y) <<"\t";

cout << operate (n,m);

return 0;

a.       10.0      5.0


b.      5.0         2.5

c.       10.0      5

d.      10         2.5

Answers

1.       a. True

2.       b. False  [ parameters can be empty without void too!]


3.       b. False

4.       a. The function addition is called by passing the values

5.       a. Any modifications to the variables x & y from inside the function will not have any effect
outside the function

6.       b. pass by reference

7.       b. The location of variable in memory is passed to the function so that it can use the same
memory area for its processing

8.       d. None of above

9.       b. False

10.    d. 10       2.5

 Questions
Question 1:

A function can not be overloaded only by its return type.

a. True

b. False

Question 2:

A function can be overloaded with a different return type if it has all the parameters same.

a. True

b. False

Question 3:
Inline functions involves some additional overhead in running time.

a. True

b. False

Question 4:

A function that calls itself for its processing is known as

a. Inline Function

b. Nested Function

c. Overloaded Function

d. Recursive Function

Question 5:

We declare a function with ______ if it does not have any return type

a. long

b. double

c. void

d. int

Question 6:

Arguments of a functions are separated with

a. comma (,)

b. semicolon (

c. colon (
d. None of these

Question 7:

Variables inside parenthesis of functions declarations have _____ level access.

a. Local

b. Global

c. Module

d. Universal

Question 8:

Observe following function declaration and choose the best answer:

int  divide ( int a, int b = 2 )

a. Variable b is of integer  type and will always have value 2

b. Variable a and b are of int type and the initial value of both variables is 2

c. Variable b is international scope and will have value 2

d. Variable b will have value 2 if not specified when calling function

Question 9:

The keyword endl

a. Ends the execution of program where it is written

b. Ends the output in cout statement

c. Ends the line in program. There can be no statements after endl

d. Ends current line and starts a new line in cout statement.


 

Question 10:

Strings are character arrays. The last index of it contains the null-terminated character

a. \n

b. \t

c. \0

d. \1

Answers:
1. a. True

2. b. False

3. a. True

4. d. Recursive Function

5. c. Void

6. a. Comma (,)

7. a. Local

8. d. Variable b will have value 2 if not specified when calling function

9. d. Ends current line and starts a new line in cout statement

10. c. \0

Definitions
 Encapsulation::

Encapsulation is the mechanism that binds together code and the data it
manipulates and keeps both safe from outside interference and misuse.

 Inheritance :

Inheritance is the process by which one object acquires the properties of


another object.

 Polymorphism :

Polymorphism is a feature that allows one interface to be used for a general


class of actions. The specific action is determined by the exact nature of
actions.

 Code Blocks :

Two or more statements which is allowed to be grouped into blocks of code is


otherwise called as Code Blocks.This is done by enclosing the statements
between opening and closing curly braces.

 Floating-point numbers:

Floating-point numbers which is also known as real numbers, are used when
evaluating expressions that require fractional precision.

 Unicode:

Unicode defines a fully international character set that can represent all of the
characters found in all human languages. It is a unification of dozens of
character sets, such as Latin, Greek, Arabic and many more.

 Booleans:

Java has a simple type called boolean, for logical values. It can have only on of
two possible values, true or false.

 Casting:

A cast is simply an explicit type conversion. To create a conversion between


two incompatible types, you must use a cast.
 Arrays:

An array is a group of like-typed variables that are referred to by a common


name. Arrays offer a convenient means of grouping related information. Arrays
of any type can be created and may have one or more dimension.

 Relational Operators:

The relational operators determine the relationship that one operand has to the
other. They determine the equality and ordering.

 Short-Circuit Logical Operators:

The secondary versions of the Boolean AND and OR operators are known as
short- circuit logical operators. It is represented by || and &&..

 Switch:

The switch statement is Java’s multiway branch statement. It provides an easy


way to dispatch execution to different parts of your code based on the value of
an experession.

 Jump Statements:

Jump statements are the statements which transfer control to another part of
your program. Java Supports three jump statements: break, continue, and
return.

 Instance Variables:

The data, or variable, defined within a class are called instance variable.

Top

Introduction to Java Programming

1) The Java interpreter is used for the execution of the source code.

a) True

b) False
Ans: a.

2) On successful compilation a file with the class extension is created.

a) True

b) False

Ans: a.

3) The Java source code can be created in a Notepad editor.

a) True

b) False

Ans: a.

4) The Java Program is enclosed in a class definition.

a) True

b) False

Ans: a.

5) What declarations are required for every Java application?

Ans: A class and the main( ) method declarations.

6) What are the two parts in executing a Java program and their purposes?

Ans: Two parts in executing a Java program are:

Java Compiler and Java Interpreter.

The Java Compiler is used for compilation and the Java Interpreter is used for
execution of the application.

7) What are the three OOPs principles and define them?

Ans : Encapsulation, Inheritance and Polymorphism are the three OOPs Principles.
Encapsulation: Is the Mechanism that binds together code and the data it manipulates,
and keeps both safe from outside interference and misuse.

Inheritance: Is the process by which one object acquires the properties of another
object.

Polymorphism: Is a feature that allows one interface to be used for a general class of
actions. 

8) What is a compilation unit?

Ans : Java source code file.

9) What output is displayed as the result of executing the following statement?

System.out.println("// Looks like a comment.");

1. // Looks like a comment


2. The statement results in a compilation error
3. Looks like a comment
4. No output is displayed

Ans : a.

10) In order for a source code file, containing the public class Test, to successfully
compile, which of the following must be true?

1. It must have a package statement


2. It must be named Test.java
3. It must import java.lang
4. It must declare a public class named Test

Ans : b

11) What are identifiers and what is naming convention?

Ans : Identifiers are used for class names, method names and variable names. An
identifier may be any descriptive sequence of upper case & lower case letters,numbers
or underscore or dollar sign and must not begin with numbers.

12) What is the return type of program’s main( ) method?

Ans : void
13) What is the argument type of program’s main( ) method?

Ans : string array.

14) Which characters are as first characters of an identifier?

Ans : A – Z, a – z, _ ,$

15) What are different comments?

Ans : 1) // -- single line comment

2) /* --

*/ multiple line comment

3) /** --

*/ documentation

16) What is the difference between constructor method and method?

Ans : Constructor will be automatically invoked when an object is created. Whereas


method has to be call explicitly.

17) What is the use of bin and lib in JDK?

Ans : Bin contains all tools such as javac, applet viewer, awt tool etc., whereas Lib
contains all packages and variables

Top

Data types,variables and Arrays

1) What is meant by variable?

Ans: Variables are locations in memory that can hold values. Before assigning any
value to a variable, it must be declared.

2) What are the kinds of variables in Java? What are their uses?
Ans: Java has three kinds of variables namely, the instance variable, the local variable
and the class variable.

Local variables are used inside blocks as counters or in methods as temporary


variables and are used to store information needed by a single method.

Instance variables are used to define attributes or the state of a particular object and
are used to store information needed by multiple methods in the objects.

Class variables are global to a class and to all the instances of the class and are useful
for communicating between different objects of all the same class or keeping track of
global states.

3) How are the variables declared?

Ans: Variables can be declared anywhere in the method definition and can be
initialized during their declaration.They are commonly declared before usage at the
beginning of the definition.

Variables with the same data type can be declared together. Local variables must be
given a value before usage.

4) What are variable types?

Ans: Variable types can be any data type that java supports, which includes the eight
primitive data types, the name of a class or interface and an array.

5) How do you assign values to variables?

Ans: Values are assigned to variables using the assignment operator =.

6) What is a literal? How many types of literals are there?

Ans: A literal represents a value of a certain type where the type describes how that
value behaves.There are different types of literals namely number literals, character
literals, boolean literals, string literals,etc.

7) What is an array?

Ans: An array is an object that stores a list of items.

8) How do you declare an array?


Ans: Array variable indicates the type of object that the array holds.

Ex: int arr[];

9) Java supports multidimensional arrays.

a)True

b)False

Ans: a.

10) An array of arrays can be created.

a)True

b)False

Ans: a.

11) What is a string?

Ans: A combination of characters is called as string.

12) Strings are instances of the class String.

a)True

b)False

Ans: a.

13) When a string literal is used in the program, Java automatically creates instances
of the string class.

a)True

b)False

Ans: a.

14) Which operator is to create and concatenate string?


Ans: Addition operator(+).

15) Which of the following declare an array of string objects?

1. String[ ] s;
2. String [ ]s:
3. String[ s]:
4. String s[ ]:

Ans : a, b and d

16) What is the value of a[3] as the result of the following array declaration?

1. 1
2. 2
3. 3
4. 4

Ans : d

17) Which of the following are primitive types?

1. byte
2. String
3. integer
4. Float

Ans : a.

18) What is the range of the char type?

1. 0 to 2 16
2. 0 to 2 15
3. 0 to 2 16-1
4. 0 to 2 15-1

Ans. d

19) What are primitive data types?

Ans : byte, short, int, long

float, double
boolean

char

20) What are default values of different primitive types?

Ans :

int - 0

short - 0

byte - 0

long - 0 l

float - 0.0 f

double - 0.0 d

boolean - false

char - null

21) Converting of primitive types to objects can be explicitly.

a)True

b)False

Ans: b.

22) How do we change the values of the elements of the array?

Ans : The array subscript expression can be used to change the values of the elements
of the array.

23) What is final varaible?

Ans : If a variable is declared as final variable, then you can not change its value. It
becomes constant.

24) What is static variable?


Ans : Static variables are shared by all instances of a class.

Top

Operators

1) What are operators and what are the various types of operators available in Java?

Ans: Operators are special symbols used in expressions. The following are the types
of operators:

Arithmetic operators,

Assignment operators,

Increment & Decrement operators,

Logical operators,

Biwise operators,

Comparison/Relational operators and

Conditional operators

2) The ++ operator is used for incrementing and the -- operator is used for

decrementing.

a)True

b)False

Ans: a.

3) Comparison/Logical operators are used for testing and magnitude.

a)True

b)False
Ans: a.

4) Character literals are stored as unicode characters.

a)True

b)False

Ans: a.

5) What are the Logical operators?

Ans: OR(|), AND(&), XOR(^) AND NOT(~).

6) What is the % operator?

Ans : % operator is the modulo operator or reminder operator. It returns the reminder
of dividing the first operand by second operand.

7) What is the value of 111 % 13?

1. 3
2. 5
3. 7
4. 9

Ans : c.

8) Is &&= a valid operator?

Ans : No.

9) Can a double value be cast to a byte?

Ans : Yes

10) Can a byte object be cast to a double value ?

Ans : No. An object cannot be cast to a primitive value.

11) What are order of precedence and associativity?

Ans : Order of precedence the order in which operators are evaluated in expressions.
Associativity determines whether an expression is evaluated left-right or right-left.

12) Which Java operator is right associativity?

Ans : = operator.

13) What is the difference between prefix and postfix of -- and ++ operators?

Ans : The prefix form returns the increment or decrement operation and returns the
value of the increment or decrement operation.

The postfix form returns the current value of all of the expression and then

performs the increment or decrement operation on that value.

14) What is the result of expression 5.45 + "3,2"?

1. The double value 8.6


2. The string ""8.6"
3. The long value 8.
4. The String "5.453.2"

Ans : d

15) What are the values of x and y ?

x = 5; y = ++x;

Ans : x = 6; y = 6

16) What are the values of x and z?

x = 5; z = x++;

Ans : x = 6; z = 5

Top

Control Statements

1) What are the programming constructs?


Ans:

a) Sequential

b) Selection -- if and switch statements

c) Iteration -- for loop, while loop and do-while loop

2) class conditional {

public static void main(String args[]) {

int i = 20;

int j = 55;

int z = 0;

z = i < j ? i : j; // ternary operator

System.out.println("The value assigned is " + z);

What is output of the above program?

Ans: The value assigned is 20

3) The switch statement does not require a break.

a)True

b)False

Ans: b.

4) The conditional operator is otherwise known as the ternary operator.

a)True

b)False
Ans: a.

5) The while loop repeats a set of code while the condition is false.

a)True

b)False

Ans: b.

6) The do-while loop repeats a set of code atleast once before the condition is tested.

a)True

b)False

Ans: a.

7) What are difference between break and continue?

Ans: The break keyword halts the execution of the current loop and forces control out
of the loop.

The continue is similar to break, except that instead of halting the execution of the
loop, it starts the next iteration.

8) The for loop repeats a set of statements a certain number of times until a condition
is matched.

a)True

b)False

Ans: a.

9) Can a for statement loop indefintely?

Ans : Yes.

10) What is the difference between while statement and a do statement/

Ans : A while statement checks at the beginning of a loop to see whether the next loop
iteration should occur.
A do statement checks at the end of a loop to see whether the next iteration of a loop
should occur. The do statement will always execute the body of a loop at least once.

Top

Introduction to Classes and Methods

1) Which is used to get the value of the instance variables?

Ans: Dot notation.

2) The new operator creates a single instance named class and returns a reference to
that object.

a)True

b)False

Ans: a.

3) A class is a template for multiple objects with similar features.

a)True

b)False

Ans: a.

4) What is mean by garbage collection?

Ans: When an object is no longer referred to by any variable, Java automatically


reclaims memory used by that object. This is known as garbage collection.

5) What are methods and how are they defined?

Ans: Methods are functions that operate on instances of classes in which they are
defined.Objects can communicate with each other using methods and can call
methods in other classes.
Method definition has four parts. They are name of the method, type of object or
primitive type the method returns, a list of parameters and the body of the method. A
method's signature is a combination of the first three parts mentioned above.

6) What is calling method?

Ans: Calling methods are similar to calling or referring to an instance variable. These
methods are accessed using dot notation.

Ex: obj.methodname(param1,param2)

7) Which method is used to determine the class of an object?

Ans: getClass( ) method can be used to find out what class the belongs to. This class is
defined in the object class and is available to all objects.

8) All the classes in java.lang package are automatically imported when a program is
compiled.

a)True

b)False

Ans: a.

9) How can class be imported to a program?

Ans: To import a class, the import keyword should be used as shown.;

import classname;

10) How can class be imported from a package to a program?

Ans: import java . packagename . classname (or) import java.package name.*;

11) What is a constructor?

Ans: A constructor is a special kind of method that determines how an object is


initialized when created.

12) Which keyword is used to create an instance of a class?

Ans: new.
13) Which method is used to garbage collect an object?

Ans: finalize ().

14) Constructors can be overloaded like regular methods.

a)True

b)False

Ans: a.

15) What is casting?

Ans: Casting is bused to convert the value of one type to another.

16) Casting between primitive types allows conversion of one primitive type to
another.

a)True

b)False

Ans: a.

17) Casting occurs commonly between numeric types.

a)True

b)False

Ans: a.

18) Boolean values can be cast into any other primitive type.

a)True

b)False

Ans: b.

19) Casting does not affect the original object or value.


a)True

b)False

Ans: a.

20) Which cast must be used to convert a larger value into a smaller one?

Ans: Explicit cast.

21) Which cast must be used to cast an object to another class?

Ans: Specific cast.

22) Which of the following features are common to both Java & C++?

A.The class declaration

b.The access modifiers

c.The encapsulation of data & methods with in objects

d.The use of pointers

Ans: a,b,c.

23) Which of the following statements accurately describe the use of access modifiers
within a class definition?

a.They can be applied to both data & methods

b.They must precede a class's data variables or methods

c.They can follow a class's data variables or methods

d.They can appear in any order

e.They must be applied to data variables first and then to methods

Ans: a,b,d.

24) Suppose a given instance variable has been declared private. Can this instance
variable be manipulated by methods out side its class?
a.yes

b.no

Ans: b.

25) Which of the following statements can be used to describe a public method?

a.It is accessible to all other classes in the hierarchy

b.It is accessablde only to subclasses of its parent class

c.It represents the public interface of its class

d.The only way to gain access to this method is by calling one of the public class

methods

Ans: a,c.

26) Which of the following types of class members can be part of the internal part of a
class?

a.Public instance variables

b.Private instance variables

c.Public methods

d.Private methods

Ans: b,d.

27) You would use the ____ operator to create a single instance of a named class.

a.new

b.dot

Ans: a.

28) Which of the following statements correctly describes the relation between an
object and the instance variable it stores?
a.Each new object has its own distinctive set of instance variables

b.Each object has a copy of the instance variables of its class

c.the instance variable of each object are seperate from the variables of other objects

d.The instance variables of each object are stored together with the variables of other
objects

Ans: a,b,c.

29) If no input parameters are specified in a method declaration then the declaration
will include __.

a.an empty set of parantheses

b.the term void

Ans: a.

30) What are the functions of the dot(.) operator?

a.It enables you to access instance variables of any objects within a class

b.It enables you to store values in instance variables of an object

c.It is used to call object methods

d.It is to create a new object

Ans: a,b,c.

31) Which of the following can be referenced by this variable?

a.The instance variables of a class only

b.The methods of a class only

c.The instance variables and methods of a class

Ans: c.

32) The this reference is used in conjunction with ___methods.


a.static

b.non-static

Ans: b.

33) Which of the following operators are used in conjunction with the this and super
references?

a.The new operator

b.The instanceof operator

c.The dot operator

Ans: c.

34) A constructor is automatically called when an object is instantiated

a. true

b. false

Ans: a.

35) When may a constructor be called without specifying arguments?

a. When the default constructor is not called

b. When the name of the constructor differs from that of the class

c. When there are no constructors for the class

Ans: c.

36) Each class in java can have a finalizer method

a. true

b.false

Ans: a.
37) When an object is referenced, does this mean that it has been identified by the
finalizer method for garbage collection?

a.yes

b.no

Ans: b.

38) Because finalize () belongs to the java.lang.Object class, it is present in all ___.

a.objects

b.classes

c.methods

Ans: b.

39) Identify the true statements about finalization.

a.A class may have only one finalize method

b.Finalizers are mostly used with simple classes

c.Finalizer overloading is not allowed

Ans: a,c.

40) When you write finalize() method for your class, you are overriding a finalizer
inherited from a super class.

a.true

b.false

Ans: a.

41) Java memory management mechanism garbage collects objects which are no
longer referenced

a true
b.false

Ans: a.

42) are objects referenced by a variable candidates for garbage collection when the
variable goes out of scope?

a yes

b. no

Ans: a.

43) Java's garbage collector runs as a ___ priority thread waiting for __priority threads
to relinquish the processor.

a.high

b.low

Ans: a,b.

44) The garbage collector will run immediately when the system is out of memory

a.true

b.false

Ans: a.

45) You can explicitly drop a object reference by setting the value of a variable whose
data type is a reference type to ___

Ans: null

46) When might your program wish to run the garbage collecter?

a. before it enters a compute-intense section of code

b. before it enters a memory-intense section of code

c. before objects are finalized


d. when it knows there will be some idle time

Ans: a,b,d

47) For externalizable objects the class is solely responsible for the external format of
its contents

a.true

b.false

Ans: a

48) When an object is stored, are all of the objects that are reachable from that object
stored as well?

a.true

b.false

Ans: a

49) The default__ of objects protects private and trancient data, and supports the __ of
the classes

a.evolution

b.encoding

Ans: b,a.

50) Which are keywords in Java?

a) NULL

b) sizeof

c) friend

d) extends

e) synchronized
Ans : d and e

51) When must the main class and the file name coincide?

Ans :When class is declared public.

52) What are different modifiers?

Ans : public, private, protected, default, static, trancient, volatile, final, abstract.

53) What are access modifiers?

Ans : public, private, protected, default.

54) What is meant by "Passing by value" and " Passing by reference"?

Ans : objects – pass by referrence

Methods - pass by value

55) Is a class a subclass of itself?

Ans : A class is a subclass itself.

56) What modifiers may be used with top-level class?

Ans : public, abstract, final.

57) What is an example of polymorphism?

1. Inner class
2. Anonymous classes
3. Method overloading
4. Method overriding

Ans : c

Top

Packages and interface


1) What are packages ? what is use of packages ?

Ans :The package statement defines a name space in which classes are stored.If you
omit the package, the classes are put into the default package.

Signature... package pkg;

Use: * It specifies to which package the classes defined in a file belongs to. * Package
is both naming and a visibility control mechanism.

2) What is difference between importing "java.applet.Applet" and "java.applet.*;" ?

Ans :"java.applet.Applet" will import only the class Applet from the package
java.applet

Where as "java.applet.*" will import all the classes from java.applet package.

3) What do you understand by package access specifier?

Ans : public: Anything declared as public can be accessed from anywhere

private: Anything declared in the private can’t be seen outside of its class.

default: It is visible to subclasses as well as to other classes in the same package.

4) What is interface? What is use of interface?

Ans : It is similar to class which may contain method’s signature only but not bodies.

Methods declared in interface are abstract methods. We can implement many


interfaces on a class which support the multiple inheritance.

5) Is it is necessary to implement all methods in an interface?

Ans : Yes. All the methods have to be implemented.

6) Which is the default access modifier for an interface method?

Ans : public.

7) Can we define a variable in an interface ?and what type it should be ?

Ans : Yes we can define a variable in an interface. They are implicitly final and static.
8) What is difference between interface and an abstract class?

Ans : All the methods declared inside an Interface are abstract. Where as abstract
class must have at least one abstract method and others may be concrete or abstract.

In Interface we need not use the keyword abstract for the methods.

9) By default, all program import the java.lang package.

True/False

Ans : True

10) Java compiler stores the .class files in the path specified in CLASSPATH

environmental variable.

True/False

Ans : False

11) User-defined package can also be imported just like the standard packages.

True/False

Ans : True

12) When a program does not want to handle exception, the ______class is used.

Ans : Throws

13) The main subclass of the Exception class is _______ class.

Ans : RuntimeException

14) Only subclasses of ______class may be caught or thrown.

Ans : Throwable

15) Any user-defined exception class is a subclass of the _____ class.

Ans : Exception
16) The catch clause of the user-defined exception class should ______ its Base class
catch clause.

Ans : Exception

17) A _______ is used to separate the hierarchy of the class while declaring an Import
statement.

Ans : Package

18) All standard classes of Java are included within a package called _____.

Ans : java.lang

19) All the classes in a package can be simultaneously imported using ____.

Ans : *

20) Can you define a variable inside an Interface. If no, why? If yes, how?

Ans.: YES. final and static

21) How many concrete classes can you have inside an interface?

Ans.: None

22) Can you extend an interface?

Ans.: Yes

23) Is it necessary to implement all the methods of an interface while implementing


the interface?

Ans.: No

24) If you do not implement all the methods of an interface while implementing , what
specifier should you use for the class ?

Ans.: abstract

25) How do you achieve multiple inheritance in Java?

Ans: Using interfaces.


26) How to declare an interface example?

Ans : access class classname implements interface.

27) Can you achieve multiple interface through interface?

a)True

b) false

Ans : a.

28) Can variables be declared in an interface ? If so, what are the modifiers?

Ans : Yes. final and static are the modifiers can be declared in an interface.

29) What are the possible access modifiers when implementing interface methods?

Ans : public.

30) Can anonymous classes be implemented an interface?

Ans : Yes.

31) Interfaces can’t be extended.

a)True

b)False

Ans : b.

32) Name interfaces without a method?

Ans : Serializable, Cloneble & Remote.

33) Is it possible to use few methods of an interface in a class ? If so, how?

Ans : Yes. Declare the class as abstract.

Top
Exception Handling

1) What is the difference between ‘throw’ and ‘throws’ ?And it’s application?

Ans : Exceptions that are thrown by java runtime systems can be handled by Try and
catch blocks. With throw exception we can handle the exceptions thrown by the
program itself. If a method is capable of causing an exception that it does not

handle, it must specify this behavior so the callers of the method can guard

against that exception.

2) What is the difference between ‘Exception’ and ‘error’ in java?

Ans : Exception and Error are the subclasses of the Throwable class. Exception class
is used for exceptional conditions that user program should catch. With exception
class we can subclass to create our own custom exception.

Error defines exceptions that are not excepted to be caught by you program. Example
is Stack Overflow.

3) What is ‘Resource leak’?

Ans : Freeing up other resources that might have been allocated at the beginning of a
method.

4)What is the ‘finally’ block?

Ans : Finally block will execute whether or not an exception is thrown. If an


exception is thrown, the finally block will execute even if no catch statement match
the exception. Any time a method is about to return to the caller from inside try/catch
block, via an uncaught exception or an explicit return statement, the finally clause is
also execute.

5) Can we have catch block with out try block? If so when?

Ans : No. Try/Catch or Try/finally form a unit.

6) What is the difference between the following statements?

Catch (Exception e),

Catch (Error err),


Catch (Throwable t)

Ans :

7) What will happen to the Exception object after exception handling?

Ans : It will go for Garbage Collector. And frees the memory.

8) How many Exceptions we can define in ‘throws’ clause?

Ans : We can define multiple exceptions in throws clause.

Signature is..

type method-name (parameter-list) throws exception-list

9) The finally block is executed when an exception is thrown, even if no catch


matches it.

True/False

Ans : True

10) The subclass exception should precede the base class exception when used within
the catch clause.

True/False

Ans : True

11) Exceptions can be caught or rethrown to a calling method.

True/False

Ans : True

12) The statements following the throw keyword in a program are not executed.

True/False

Ans : True

13) The toString ( ) method in the user-defined exception class is overridden.


True/False

Ans : True

Top

Multi Threading

1) What are the two types of multitasking?

Ans :

1.process-based

2.Thread-based

2) What are the two ways to create the thread?

Ans :

1.by implementing Runnable

2.by extending Thread

3) What is the signature of the constructor of a thread class?

Ans : Thread(Runnable threadob,String threadName)

4) What are all the methods available in the Runnable Interface?

Ans : run()

5) What is the data type for the method isAlive() and this method is available in which
class?

Ans : boolean, Thread

6) What are all the methods available in the Thread class?

Ans :
1.isAlive()

2.join()

3.resume()

4.suspend()

5.stop()

6.start()

7.sleep()

8.destroy()

7) What are all the methods used for Inter Thread communication and what is the
class in which these methods are defined?

Ans :

1. wait(),notify() & notifyall()

2. Object class

8) What is the mechanisam defind by java for the Resources to be used by only one
Thread at a time?

Ans : Synchronisation

9) What is the procedure to own the moniter by many threads?

Ans : not possible

10) What is the unit for 1000 in the below statement?

ob.sleep(1000)

Ans : long milliseconds

11) What is the data type for the parameter of the sleep() method?

Ans : long
12) What are all the values for the following level?

max-priority

min-priority

normal-priority

Ans : 10,1,5

13) What is the method available for setting the priority?

Ans : setPriority()

14) What is the default thread at the time of starting the program?

Ans : main thread

15) The word synchronized can be used with only a method.

True/ False

Ans : False

16) Which priority Thread can prompt the lower primary Thread?

Ans : Higher Priority

17) How many threads at a time can access a monitor?

Ans : one

18) What are all the four states associated in the thread?

Ans : 1. new 2. runnable 3. blocked 4. dead

19) The suspend()method is used to teriminate a thread?

True /False

Ans : False

20) The run() method should necessary exists in clases created as subclass of thread?
True /False

Ans : True

21) When two threads are waiting on each other and can't proceed the programe is
said to be in a deadlock?

True/False

Ans : True

22) Which method waits for the thread to die ?

Ans : join() method

23) Which of the following is true?

1) wait(),notify(),notifyall() are defined as final & can be called only from with in a
synchronized method

2) Among wait(),notify(),notifyall() the wait() method only throws IOException

3) wait(),notify(),notifyall() & sleep() are methods of object class

1. 1
2. 2
3. 3
4. 1&2
5. 1,2 & 3

Ans : D

24) Garbage collector thread belongs to which priority?

Ans : low-priority

25) What is meant by timeslicing or time sharing?

Ans : Timeslicing is the method of allocating CPU time to individual threads in a


priority schedule.

26) What is meant by daemon thread? In java runtime, what is it's role?
Ans : Daemon thread is a low priority thread which runs intermittently in the
background doing the garbage collection operation for the java runtime system.

Top

Inheritance

1) What is the difference between superclass & subclass?

Ans : A super class is a class that is inherited whereas subclass is a class that does the
inheriting.

2) Which keyword is used to inherit a class?

Ans : extends

3) Subclasses methods can access superclass members/ attributes at all times?

True/False

Ans : False

4) When can subclasses not access superclass members?

Ans : When superclass is declared as private.

5) Which class does begin Java class hierarchy?

Ans : Object class

6) Object class is a superclass of all other classes?

True/False

Ans : True

7) Java supports multiple inheritance?

True/False

Ans : False
8) What is inheritance?

Ans : Deriving an object from an existing class. In the other words, Inheritance is the
process of inheriting all the features from a class

9) What are the advantages of inheritance?

Ans : Reusability of code and accessibility of variables and methods of the superclass
by subclasses.

10) Which method is used to call the constructors of the superclass from the subclass?

Ans : super(argument)

11) Which is used to execute any method of the superclass from the subclass?

Ans : super.method-name(arguments)

12) Which methods are used to destroy the objects created by the constructor
methods?

Ans : finalize()

13) What are abstract classes?

Ans : Abstract classes are those for which instances can’t be created.

14) What must a class do to implement an interface?

Ans: It must provide all of the methods in the interface and identify the interface in its
implements clause.

15) Which methods in the Object class are declared as final?

Ans : getClass(), notify(), notifyAll(), and wait()

16) Final methods can be overridden.

True/False

Ans : False

17) Declaration of methods as final results in faster execution of the program?


True/False

Ans: True

18) Final variables should be declared in the beginning?

True/False

Ans : True

19) Can we declare variable inside a method as final variables? Why?

Ans : Cannot because, local variable cannot be declared as final variables.

20) Can an abstract class may be final?

Ans : An abstract class may not be declared as final.

21) Does a class inherit the constructors of it's super class?

Ans: A class does not inherit constructors from any of it's super classes.

22) What restrictions are placed on method overloading?

Ans: Two methods may not have the same name and argument list but different return
types.

23) What restrictions are placed on method overriding?

Ans : Overridden methods must have the same name , argument list , and return type.
The overriding method may not limit the access of the method it overridees.The
overriding method may not throw any exceptions that may not be thrown by the
overridden method.

24) What modifiers may be used with an inner class that is a member of an outer
class?

Ans : a (non-local) inner class may be declared as public, protected, private, static,
final or abstract.

25) How this() is used with constructors?

Ans: this() is used to invoke a constructor of the same class


26) How super() used with constructors?

Ans : super() is used to invoke a super class constructor

27) Which of the following statements correctly describes an interface?

a)It's a concrete class

b)It's a superclass

c)It's a type of abstract class

Ans: c

28) An interface contains __ methods

a)Non-abstract

b)Implemented

c)unimplemented

Ans:c

Top

String Handling

1) Which package does define String and StringBuffer classes?

Ans : java.lang package.

2) Which method can be used to obtain the length of the String?

Ans : length( ) method.

3) How do you concatenate Strings?

Ans : By using " + " operator.

4) Which method can be used to compare two strings for equality?


Ans : equals( ) method.

5) Which method can be used to perform a comparison between strings that ignores
case differences?

Ans : equalsIgnoreCase( ) method.

6) What is the use of valueOf( ) method?

Ans : valueOf( ) method converts data from its internal format into a human-readable
form.

7) What are the uses of toLowerCase( ) and toUpperCase( ) methods?

Ans : The method toLowerCase( ) converts all the characters in a string from
uppercase to

lowercase.

The method toUpperCase( ) converts all the characters in a string from lowercase to

uppercase.

8) Which method can be used to find out the total allocated capacity of a StrinBuffer?

Ans : capacity( ) method.

9) Which method can be used to set the length of the buffer within a StringBuffer
object?

Ans : setLength( ).

10) What is the difference between String and StringBuffer?

Ans : String objects are constants, whereas StringBuffer objects are not.

String class supports constant strings, whereas StringBuffer class supports growable,
modifiable strings.

11) What are wrapper classes?

Ans : Wrapper classes are classes that allow primitive types to be accessed as objects.
12) Which of the following is not a wrapper class?

1. String
2. Integer
3. Boolean
4. Character

Ans : a.

13) What is the output of the following program?

public class Question {

public static void main(String args[]) {

String s1 = "abc";

String s2 = "def";

String s3 = s1.concat(s2.toUpperCase( ) );

System.out.println(s1+s2+s3);

1. abcdefabcdef
2. abcabcDEFDEF
3. abcdefabcDEF
4. None of the above

ANS : c.

14) Which of the following methods are methods of the String class?

1. delete( )
2. append( )
3. reverse( )
4. replace( )

Ans : d.
15) Which of the following methods cause the String object referenced by s to be
changed?

1. s.concat( )
2. s.toUpperCase( )
3. s.replace( )
4. s.valueOf( )

Ans : a and b.

16) String is a wrapper class?

1. True
2. False

Ans : b.

17) If you run the code below, what gets printed out?

String s=new String("Bicycle");

int iBegin=1;

char iEnd=3;

System.out.println(s.substring(iBegin,iEnd));

1. Bic
2. ic
3. icy
4. error: no method matching substring(int,char)

Ans : b.

18) Given the following declarations

String s1=new String("Hello")

String s2=new String("there");

String s3=new String();

Which of the following are legal operations?


1. s3=s1 + s2;
2. s3=s1 - s2;
3. s3=s1 & s2
4. s3=s1 && s2

Ans : a.

19) Which of the following statements are true?

a)The String class is implemented as a char array, elements are addressed using the
stringname[] convention

b) Strings are a primitive type in Java that overloads the + operator for concatenation

c) Strings are a primitive type in Java and the StringBuffer is used as the matching
wrapper type

d) The size of a string can be retrieved using the length property.

Ans : b.

Top

Exploring Java.lang

1) java.lang package is automatically imported into all programs.

1. True
2. False

Ans : a

2) What are the interfaces defined by java.lang?

Ans : Cloneable, Comparable and Runnable.

3) What are the constants defined by both Flaot and Double classes?

Ans : MAX_VALUE,

MIN_VALUE,
NaN ,

POSITIVE_INFINITY,

NEGATIVE_INFINITY and

TYPE.

4) What are the constants defined by Byte, Short, Integer and Long?

Ans : MAX_VALUE,

MIN_VALUE and

TYPE.

5) What are the constants defined by both Float and Double classes?

Ans : MAX_RADIX,

MIN_RADIX,

MAX_VALUE,

MIN_VALUE and

TYPE.

6) What is the purpose of the Runtime class?

Ans : The purpose of the Runtime class is to provide access to the Java runtime
system.

7) What is the purpose of the System class?

Ans : The purpose of the System class is to provide access to system resources.

8) Which class is extended by all other classes?

Ans : Object class is extended by all other classes.

9) Which class can be used to obtain design information about an object?


Ans : The Class class can be used to obtain information about an object’s design.

10) Which method is used to calculate the absolute value of a number?

Ans : abs( ) method.

11) What are E and PI?

Ans : E is the base of the natural logarithm and PI is the mathematical value pi.

12) Which of the following classes is used to perform basic console I/O?

1. System
2. SecurityManager
3. Math
4. Runtime

Ans : a.

13) Which of the following are true?

1. The Class class is the superclass of the Object class.


2. The Object class is final.
3. The Class class can be used to load other classes.
4. The ClassLoader class can be used to load other classes.

Ans : c and d.

14) Which of the following methods are methods of the Math class?

1. absolute( )
2. log( )
3. cosine( )
4. sine( )

Ans : b.

15) Which of the following are true about the Error and Exception classes?

1. Both classes extend Throwable.


2. The Error class is final and the Exception class is not.
3. The Exception class is final and the Error is not.
4. Both classes implement Throwable.
Ans : a.

16) Which of the following are true?

1. The Void class extends the Class class.


2. The Float class extends the Double class.
3. The System class extends the Runtime class.
4. The Integer class extends the Number class.

Ans : d.

17) Which of the following will output -4.0

1. System.out.println(Math.floor(-4.7));
2. System.out.println(Math.round(-4.7));
3. System.out.println(Math.ceil(-4.7));
4. System.out.println(Math.Min(-4.7));

Ans : c.

18) Which of the following are valid statements

a) public class MyCalc extends Math 


b) Math.max(s); 
c) Math.round(9.99,1); 
d) Math.mod(4,10);

e) None of the above.

Ans : e.

19) What will happen if you attempt to compile and run the following code?

Integer ten=new Integer(10);

Long nine=new Long (9);

System.out.println(ten + nine);

int i=1;

System.out.println(i + ten);
1. 19 followed by 20
2. 19 followed by 11
3. Error: Can't convert java lang Integer

d) 10 followed by 1

Ans : c.

Top

Input/Output: Exploring Java.io

1) What is meant by Stream and what are the types of Streams and classes of the
Streams?

Ans : A Stream is an abstraction that either produces or consumes information.

There are two types of Streams. They are:

Byte Streams : Byte Streams provide a convenient means for handling input and
output of bytes.

Character Streams : Character Streams provide a convenient means for handling input
and output of characters.

Byte Stream classes : Byte Streams are defined by using two abstract classes. They
are:InputStream and OutputStream.

Character Stream classes : Character Streams are defined by using two abstract
classes. They are : Reader and Writer.

2) Which of the following statements are true?

1. UTF characters are all 8-bits.


2. UTF characters are all 16-bits.
3. UTF characters are all 24-bits.
4. Unicode characters are all 16-bits.
5. Bytecode characters are all 16-bits.

Ans : d.
3) Which of the following statements are true?

1. When you construct an instance of File, if you do not use the


filenaming semantics of the local machine, the constructor will
throw an IOException.
2. When you construct an instance of File, if the corresponding file
does not exist on the local file system, one will be created.
3. When an instance of File is garbage collected, the corresponding
file on the local file system is deleted.
4. None of the above.

Ans : a,b and c.

4) The File class contains a method that changes the current working directory.

1. True
2. False

Ans : b.

5) It is possible to use the File class to list the contents of the current working
directory.

1. True
2. False

Ans : a.

6) Readers have methods that can read and return floats and doubles.

1. True
2. False

Ans : b.

7) You execute the code below in an empty directory. What is the result?

File f1 = new File("dirname");

File f2 = new File(f1, "filename");

1. A new directory called dirname is created in the current working


directory.
2. A new directory called dirname is created in the current working
directory. A new file called filename is created in directory
dirname.
3. A new directory called dirname and a new file called filename are
created, both in the current working directory.
4. A new file called filename is created in the current working
directory.
5. No directory is created, and no file is created.

Ans : e.

8) What is the difference between the Reader/Writer class hierarchy and the
InputStream/OutputStream class hierarchy?

Ans : The Reader/Writer class hierarchy is character-oriented and the


InputStream/OutputStream class hierarchy is byte-oriented.

9) What is an I/O filter?

Ans : An I/O filter is an object that reads from one stream and writes to another,
usually altering the data in some way as it is passed from one stream to another.

10) What is the purpose of the File class?

Ans : The File class is used to create objects that provide access to the files and
directories of a local file system.

11) What interface must an object implement before it can be written to a stream as an
object?

Ans : An object must implement the Serializable or Externalizable interface before it


can be written to a stream as an object.

12) What is the difference between the File and RandomAccessFile classes?

Ans : The File class encapsulates the files and directories of the local file system. The
RandomAccessFile class provides the methods needed to directly access data
contained in any part of a file.

13) What class allows you to read objects directly from a stream?

Ans : The ObjectInputStream class supports the reading of objects from input streams.
14) What value does read( ) return when it has reached the end of a file?

Ans : The read( ) method returns – 1 when it has reached the end of a file.

15) What value does readLine( ) return when it has reached the end of a file?

Ans : The readLine( ) method returns null when it has reached the end of a file.

16) How many bits are used to represent Unicode, ASCII, UTF-16 and UTF-8
characters?

Ans : Unicode requires 16-bits and ASCII requires 8-bits. Although the ASCII
character set uses only 1-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.

17) Which of the following are true?

1. The InputStream and OutputStream classes are byte-oriented.


2. The ObjectInputStream and ObjectOutputStream do not support
serialized object input and output.
3. The Reader and Writer classes are character-oriented.
4. The Reader and Writer classes are the preferred solution to
serialized object output.

Ans : a and c.

18) Which of the following are true about I/O filters?

1. Filters are supported on input, but not on output.


2. Filters are supported by the InputStream/OutputStream class
hierarchy, but not by the Reader/Writer class hierarchy.
3. Filters read from one stream and write to another.
4. A filter may alter data that is read from one stream and written to
another.

Ans : c and d.

19) Which of the following are true?

1. Any Unicode character is represented using 16-bits.


2. 7-bits are needed to represent any ASCII character.
3. UTF-8 characters are represented using only 8-bits.
4. UTF-16 characters are represented using only 16-bits.

Ans : a and b.

20) Which of the following are true?

1. The Serializable interface is used to identify objects that may be


written to an output stream.
2. The Externalizable interface is implemented by classes that
control the way in which their objects are serialized.
3. The Serializable interface extends the Externalizable interface.
4. The Externalizable interface extends the Serializable interface.

Ans : a, b and d.

21) Which of the following are true about the File class?

1. A File object can be used to change the current working directory.


2. A File object can be used to access the files in the current
directory.
3. When a File object is created, a corresponding directory or file is
created in the local file system.
4. File objects are used to access files and directories on the local file
system.
5. File objects can be garbage collected.
6. When a File object is garbage collected, the corresponding file or
directory is deleted.

Ans : b, d and e.

22) How do you create a Reader object from an InputStream object?

1. Use the static createReader( ) method of InputStream class.


2. Use the static createReader( ) method of Reader class.
3. Create an InputStreamReader object, passing the InputStream
object as an argument to the InputStreamReader constructor.
4. Create an OutputStreamReader object, passing the InputStream
object as an argument to the OutputStreamReader constructor.

Ans : c.

23) Which of the following are true?


1. Writer classes can be used to write characters to output streams
using different character encodings.
2. Writer classes can be used to write Unicode characters to output
streams.
3. Writer classes have methods that support the writing of the values
of any Java primitive type to output streams.
4. Writer classes have methods that support the writing of objects to
output streams.

Ans : a and b.

24) The isFile( ) method returns a boolean value depending on whether the file object
is a file or a directory.

1. True.
2. False.

Ans : a.

25) Reading or writing can be done even after closing the input/output source.

1. True.
2. False.

Ans : b.

26) The ________ method helps in clearing the buffer.

Ans : flush( ).

27) The System.err method is used to print error message.

1. True.
2. False.

Ans : a.

28) What is meant by StreamTokenizer?

Ans : StreamTokenizer breaks up InputStream into tokens that are delimited by sets of
characters.

It has the constructor : StreamTokenizer(Reader inStream).


Here inStream must be some form of Reader.

29) What is Serialization and deserialization?

Ans : Serialization is the process of writing the state of an object to a byte stream.

Deserialization is the process of restoring these objects.

30) Which of the following can you perform using the File class?

a) Change the current directory 


b) Return the name of the parent directory 
c) Delete a file 
d) Find if a file contains text or binary information

Ans : b and c.

31) How can you change the current working directory using an instance of the File
class called FileName?

1. FileName.chdir("DirName").
2. FileName.cd("DirName").
3. FileName.cwd("DirName").
4. The File class does not support directly changing the current
directory.

Ans : d.

Top

Applets

1) What is an Applet? Should applets have constructors?

Ans : Applet is a dynamic and interactive program that runs inside a Web page
displayed by a Java capable browser. We don’t have the concept of Constructors in
Applets.

2) How do we read number information from my applet’s parameters, given that


Applet’s getParameter() method returns a string?
Ans : Use the parseInt() method in the Integer Class, the Float(String) constructor in
the Class Float, or the Double(String) constructor in the class Double.

3) How can I arrange for different applets on a web page to communicate with each
other?

Ans : Name your applets inside the Applet tag and invoke AppletContext’s
getApplet() method in your applet code to obtain references to the other applets on the
page.

4) How do I select a URL from my Applet and send the browser to that page?

Ans : Ask the applet for its applet context and invoke showDocument() on that
context object.

Eg. URL targetURL;

String URLString

AppletContext context = getAppletContext();

try{

targetUR L = new URL(URLString);

} catch (Malformed URLException e){

// Code for recover from the exception

context. showDocument (targetURL);

5) Can applets on different pages communicate with each other?

Ans : No. Not Directly. The applets will exchange the information at one meeting
place

either on the local file system or at remote system.

6) How do Applets differ from Applications?

Ans : Appln: Stand Alone


Applet: Needs no explicit installation on local m/c.

Appln: Execution starts with main() method.

Applet: Execution starts with init() method.

Appln: May or may not be a GUI

Applet: Must run within a GUI (Using AWT)

7) How do I determine the width and height of my application?

Ans : Use the getSize() method, which the Applet class inherits from the Component

class in the Java.awt package. The getSize() method returns the size of the applet as

a Dimension object, from which you extract separate width, height fields.

Eg. Dimension dim = getSize ();

int appletwidth = dim.width ();

8) What is AppletStub Interface?

Ans : The applet stub interface provides the means by which an applet and the
browser communicate. Your code will not typically implement this interface.

9) It is essential to have both the .java file and the .html file of an applet in the same
directory.

1. True.
2. False.

Ans : 2.

10) The <PARAM> tag contains two attributes namely _________ and _______.

Ans : Name , value.

11) Passing values to parameters is done in the _________ file of an applet.

Ans : .html.
12) What tags are mandatory when creating HTML to display an applet

1. name, height, width


2. code, name
3. codebase, height, width
4. code, height, width

Ans : 4.

13) Applet’s getParameter( ) method can be used to get parameter values.

1. True.
2. False.

Ans : a.

14) What are the Applet’s Life Cycle methods? Explain them?

Ans : init( ) method - Can be called when an applet is first loaded.

start( ) method - Can be called each time an applet is started.

paint( ) method - Can be called when the applet is minimized or refreshed.

stop( ) method - Can be called when the browser moves off the applet’s page.

destroy( ) method - Can be called when the browser is finished with the applet.

15) What are the Applet’s information methods?

Ans : getAppletInfo( ) method : Returns a string describing the applet, its author ,copy

right information, etc.

getParameterInfo( ) method : Returns an array of string describing the applet’s


parameters.

16) All Applets are subclasses of Applet.

1. True.
2. False.

Ans : a.
17) All Applets must import java.applet and java.awt.

1. True.
2. False.

Ans : a.

18) What are the steps involved in Applet development?

Ans : a) Edit a Java source file,

b) Compile your program and

c) Execute the appletviewer, specifying the name of your applet’s source file.

19) Applets are executed by the console based Java run-time interpreter.

1. True.
2. False.

Ans : b.

20) Which classes and interfaces does Applet class consist?

Ans : Applet class consists of a single class, the Applet class and three interfaces:
AppletContext,

AppletStub and AudioClip.

21) What is the sequence for calling the methods by AWT for applets?

Ans : When an applet begins, the AWT calls the following methods, in this sequence.

1. init( )
2. start( )
3. paint( )

22) When an applet is terminated, the following sequence of method cals takes place :

1. stop( )
2. destroy( )

23) Which method is used to output a string to an applet?


Ans : drawString ( ) method.

24) Every color is created from an RGB value.

1. True.
2. False

Ans : a.  

Top

Event Handling

1) The event delegation model, introduced in release 1.1 of the JDK, is fully
compatible with the event model.

1. True
2. False

Ans : b.

2) A component subclass that has executed enableEvents( ) to enable processing of a


certain kind of event cannot also use an adapter as a listener for the same kind of
event.

1. True
2. False

Ans : b.

3) What is the highest-level event class of the event-delegation model?

Ans : The java.util.eventObject class is the highest-level class in the event-delegation


hierarchy.

4) What interface is extended by AWT event listeners?

Ans : All AWT event listeners extend the java.util.EventListener interface.

5) What class is the top of the AWT event hierarchy?


Ans : The java.awt.AWTEvent class is the highest-level class in the AWT event class
hierarchy.

6) What event results from the clicking of a button?

Ans : The ActionEvent event is generated as the result of the clicking of a button.

7) What is the relationship between an event-listener interface and an event-adapter


class?

Ans : An event-listener interface defines the methods that must be implemented by an


event handler for a particular kind of event. An event adapter provides a default
implementation of an event-listener interface.

8) In which package are most of the AWT events that support the event-delegation
model defined?

Ans : Most of the AWT–related events of the event-delegation model are defined in
the java.awt.event package. The AWTEvent class is defined in the java.awt package.

9) What is the advantage of the event-delegation model over the earlier event-
inheritance model?

Ans : The event-delegation has two advantages over the event-inheritance model.
They are :

1. It enables event handling by objects other than the ones that


generate the events. This allows a clean separation between a
component’s design and its use.
2. It performs much better in applications where many events are
generated. This performance improvement is due to the fact that
the event-delegation model does not have to repeatedly process
unhandled events, as is the case of the event-inheritance model.

10) What is the purpose of the enableEvents( ) method?

Ans :The enableEvents( ) method is used to enable an event for a particular object.

11) Which of the following are true?

1. The event-inheritance model has replaced the event-delegation


model.
2. The event-inheritance model is more efficient than the event-
delegation model.
3. The event-delegation model uses event listeners to define the
methods of event-handling classes.
4. The event-delegation model uses the handleEvent( ) method to
support event handling.

Ans : c.

12) Which of the following is the highest class in the event-delegation model?

1. java.util.EventListener
2. java.util.EventObject
3. java.awt.AWTEvent
4. java.awt.event.AWTEvent

Ans : b.

13) When two or more objects are added as listeners for the same event, which
listener is first invoked to handle the event?

1. The first object that was added as listener.


2. The last object that was added as listener.
3. There is no way to determine which listener will be invoked first.
4. It is impossible to have more than one listener for a given event.

Ans : c.

14) Which of the following components generate action events?

1. Buttons
2. Labels
3. Check boxes
4. Windows

Ans : a.

15) Which of the following are true?

1. A TextField object may generate an ActionEvent.


2. A TextArea object may generate an ActionEvent.
3. A Button object may generate an ActionEvent.
4. A MenuItem object may generate an ActionEvent.

Ans : a,c and d.

16) Which of the following are true?

1. The MouseListener interface defines methods for handling mouse


clicks.
2. The MouseMotionListener interface defines methods for handling
mouse clicks.
3. The MouseClickListener interface defines methods for handling
mouse clicks.
4. The ActionListener interface defines methods for handling the
clicking of a button.

Ans : a and d.

17) Suppose that you want to have an object eh handle the TextEvent of a TextArea
object t. How should you add eh as the event handler for t?

1. t.addTextListener(eh);
2. eh.addTextListener(t);
3. addTextListener(eh.t);
4. addTextListener(t,eh);

Ans : a.

18) What is the preferred way to handle an object’s events in Java 2?

1. Override the object’s handleEvent( ) method.


2. Add one or more event listeners to handle the events.
3. Have the object override its processEvent( ) methods.
4. Have the object override its dispatchEvent( ) methods.

Ans : b.

19) Which of the following are true?

1. A component may handle its own events by adding itself as an


event listener.
2. A component may handle its own events by overriding its event-
dispatching method.
3. A component may not handle oits own events.
4. A component may handle its own events only if it implements the
handleEvent( ) method.

Ans : a and b.

20) How many types of events are provided by AWT? Explain them?

Ans : The AWT provides two types of events. They are :

21) Low-level event : A low-level event is the one that represents a low-level input or
window-system occurrence on a visual component on the screen.

22) Semantic event : Semantic event is defined at a higher-level to encapsulate the


semantics of a user interface component’s model.

23) A __________ is an object that originates or "fire" events.

Ans : source.

24) The event listener corresponding to handling keyboard events is the _________ .

Ans : KeyListener.

25) What are the types of mouse event listeners?

Ans : MouseListener and MouseMotionListener.

26) Which of the following are correct event handling methods

a) mousePressed(MouseEvent e){}
b) MousePressed(MouseClick e){}
c) functionKey(KeyPress k){}
d) componentAdded(ContainerEvent e){}

Ans : a and d.

27) Which of the following are true?

a) A component may have only one event listener attached at a time 


b) An event listener may be removed from a component 
c) The ActionListener interface has no corresponding Adapter class 
d) The processing of an event listener requires a try/catch block
Ans : b and c.

Top

AWT : windows, graphics and fonts

1) How would you set the color of a graphics context called g to cyan?

1. g.setColor(Color.cyan);
2. g.setCurrentColor(cyan);
3. g.setColor("Color.cyan");
4. g.setColor("cyan’);
5. g.setColor(new Color(cyan));

Ans : a.

2) The code below draws a line. What color is the line?

g.setColor(Color.red.green.yellow.red.cyan);

g.drawLine(0, 0, 100,100);

1. Red
2. Green
3. Yellow
4. Cyan
5. Black

Ans : d.

3) What does the following code draw?

g.setColor(Color.black);

g.drawLine(10, 10, 10, 50);

g.setColor(Color.RED);

g.drawRect(100, 100, 150, 150);


1. A red vertical line that is 40 pixels long and a red square with
sides of 150 pixels
2. A black vertical line that is 40 pixels long and a red square with
sides of 150 pixels
3. A black vertical line that is 50 pixels long and a red square with
sides of 150 pixels
4. A red vertical line that is 50 pixels long and a red square with
sides of 150 pixels
5. A black vertical line that is 40 pixels long and a red square with
sides of 100 pixel

Ans : b.

4) Which of the statements below are true?

a) A polyline is always filled.

b) A polyline can not be filled.

c) A polygon is always filled.

d) A polygon is always closed

e) A polygon may be filled or not filled

Ans : b, d and e.

5) What code would you use to construct a 24-point bold serif font?

1. new Font(Font.SERIF, 24,Font.BOLD);


2. new Font("SERIF", 24, BOLD");
3. new Font("BOLD ", 24,Font.SERIF);
4. new Font("SERIF", Font.BOLD,24);
5. new Font(Font.SERIF, "BOLD", 24);

Ans : 4.

6) What does the following paint( ) method draw?

Public void paint(Graphics g) {

g.drawString("question #6",10,0);
}

1. The string "question #6", with its top-left corner at 10,0


2. A little squiggle coming down from the top of the component, a
little way in from the left edge

Ans : 2.

7) What does the following paint( ) method draw?

Public void paint(Graphics g) {

g.drawString("question #6",10,0);

1. A circle at (100, 100) with radius of 44


2. A circle at (100, 44) with radius of 100
3. A circle at (100, 44) with radius of 44
4. The code does not compile

Ans : 4.

8) What is relationship between the Canvas class and the Graphics class?

Ans : A Canvas object provides access to a Graphics object via its paint( ) method.

9) What are the Component subclasses that support painting.

Ans : The Canvas, Frame, Panel and Applet classes support painting.

10) What is the difference between the paint( ) and repaint( ) method?

Ans : The paint( ) method supports painting via a Graphics object. The repaint( )
method is used to cause paint( ) to be invoked by the AWT painting method.

11) What is the difference between the Font and FontMetrics classes?

Ans : The FontMetrics class is used to define implementation-specific properties, such


as ascent and descent, of a Font object.

12) Which of the following are passed as an argument to the paint( ) method?
1. A Canvas object
2. A Graphics object
3. An Image object
4. A paint object

Ans : b.

13) Which of the following methods are invoked by the AWT to support paint and
repaint operations?

1. paint( )
2. repaint( )
3. draw( )
4. redraw( )

Ans : a.

14) Which of the following classes have a paint( ) method?

1. Canvas
2. Image
3. Frame
4. Graphics

Ans : a and c.

15) Which of the following are methods of the Graphics class?

1. drawRect( )
2. drawImage( )
3. drawPoint( )
4. drawString( )

Ans : a, b and d.

16) Which Font attributes are available through the FontMetrics class?

1. ascent
2. leading
3. case
4. height
Ans : a, b and d.

17) Which of the following are true?

1. The AWT automatically causes a window to be repainted when a


portion of a window has been minimized and then maximized.
2. The AWT automatically causes a window to be repainted when a
portion of a window has been covered and then uncovered.
3. The AWT automatically causes a window to be repainted when
application data is changed.
4. The AWT does not support repainting operations.

Ans : a and b.

18) Which method is used to size a graphics object to fit the current size of the
window?

Ans : getSize( ) method.

19) What are the methods to be used to set foreground and background colors?

Ans : setForeground( ) and setBackground( ) methods.

20) You have created a simple Frame and overridden the paint method as follows

public void paint(Graphics g){

g.drawString("Dolly",50,10);

What will be the result when you attempt to compile and run the program?

a) The string "Dolly" will be displayed at the centre of the frame

b) An error at compilation complaining at the signature of the paint method 


c) The lower part of the word Dolly will be seen at the top of the form, with the top
hidden. 
d) The string "Dolly" will be shown at the bottom of the form
Ans : c.

21) Where g is a graphics instance what will the following code draw on the screen.

g.fillArc(45,90,50,50,90,180);

a) An arc bounded by a box of height 45, width 90 with a centre point of 50,50,
starting 
at an angle of 90 degrees traversing through 180 degrees counter clockwise.

b) An arc bounded by a box of height 50, width 50, with a centre point of 45,90
starting 
at an angle of 90 degrees traversing through 180 degrees clockwise.

c) An arc bounded by a box of height 50, width 50, with a top left at coordinates of
45, 
90, starting at 90 degrees and traversing through 180 degrees counter clockwise.

d) An arc starting at 45 degrees, traversing through 90 degrees clockwise bounded by



box of height 50, width 50 with a centre point of 90, 180.

Ans : c.

22) Given the following code 


import java.awt.*;
public class SetF extends Frame{
public static void main(String argv[]){
SetF s = new SetF();
s.setSize(300,200);
s.setVisible(true);
}

How could you set the frame surface color to pink

a)s.setBackground(Color.pink);
b)s.setColor(PINK);
c)s.Background(pink);
d)s.color=Color.pink

Ans : a.  
Top

AWT: Controls, Layout Managers and Menus

1) What is meant by Controls and what are different types of controls?

Ans : Controls are componenets that allow a user to interact with your application.

The AWT supports the following types of controls:

 Labels
 Push buttons
 Check boxes
 Choice lists
 Lists
 Scroll bars
 Text components

These controls are subclasses of Component.

2) You want to construct a text area that is 80 character-widths wide and 10 character-
heights tall. What code do you use?

1. new TextArea(80, 10)


2. new TextArea(10, 80)

Ans: b.

3) A text field has a variable-width font. It is constructed by calling new


TextField("iiiii"). What happens if you change the contents of the text field to
"wwwww"? (Bear in mind that is one of the narrowest characters, and w is one of the
widest.)

1. The text field becomes wider.


2. The text field becomes narrower.
3. The text field stays the same width; to see the entire contents you
will have to scroll by using the ß and à keys.
4. The text field stays the same width; to see the entire contents you
will have to scroll by using the text field’s horizontal scroll bar.

Ans : c.
4) The CheckboxGroup class is a subclass of the Component class.

1. True
2. False

Ans : b.

5) What are the immediate super classes of the following classes?

1. a) Container class
2. b) MenuComponent class
3. c) Dialog class
4. d) Applet class
5. e) Menu class

Ans : a) Container - Component

b) MenuComponent - Object

c) Dialog - Window

d) Applet - Panel

e) Menu - MenuItem

6) What are the SubClass of Textcomponent Class?

Ans : TextField and TextArea

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

Ans : setBounds()

8) Which TextComponent method is used to set a TextComponent to the read-only


state?

Ans : setEditable()

9) How can the Checkbox class be used to create a radio button?

Ans : By associating Checkbox objects with a CheckboxGroup.


10) What Checkbox method allows you to tell if a Checkbox is checked?

Ans : getState()

11) Which Component method is used to access a component's immediate Container?

1. getVisible()
2. getImmediate
3. getParent()
4. getContainer

Ans : c.

12) What methods are used to get and set the text label displayed by a Button object?

Ans : getLabel( ) and setLabel( )

13) What is the difference between a Choice and a List?

Ans : A Choice is displayed in a compact form that requires you to pull it down to see
the list of available choices. Only one item may be selected from a Choice.

A List may be displayed in such a way that several List items are visible. A List
supports the selection of one or more List items.

14) Which Container method is used to cause a container to be laid out and
redisplayed?

Ans : validate( )

15) What is the difference between a Scollbar and a Scrollpane?

Ans : A Scrollbar is a Component, but not a Container.

A Scrollpane is a Container and handles its own events and performs its own

scrolling.

16) Which Component subclass is used for drawing and painting?

Ans : Canvas.

17) Which of the following are direct or indirect subclasses of Component?


1. Button
2. Label
3. CheckboxMenuItem
4. Toolbar
5. Frame

Ans : a, b and e.

18) Which of the following are direct or indirect subclasses of Container?

1. Frame
2. TextArea
3. MenuBar
4. FileDialog
5. Applet

Ans : a,d and e.

19) Which method is used to set the text of a Label object?

1. setText( )
2. setLabel( )
3. setTextLabel( )
4. setLabelText( )

Ans : a.

20) Which constructor creates a TextArea with 10 rows and 20 columns?

1. new TextArea(10, 20)


2. new TextArea(20, 10)
3. new TextArea(new Rows(10), new columns(20))
4. new TextArea(200)

Ans : a.

(Usage is TextArea(rows, columns)

21) Which of the following creates a List with 5 visible items and multiple selection
enabled?

1. new List(5, true)


2. new List(true, 5)
3. new List(5, false)
4. new List(false,5)

Ans : a.

[Usage is List(rows, multipleMode)]

22) Which are true about the Container class?

1. The validate( ) method is used to cause a Container to be laid out


and redisplayed.
2. The add( ) method is used to add a Component to a Container.
3. The getBorder( ) method returns information about a Container’s
insets.
4. The getComponent( ) method is used to access a Component that
is contained in a Container.

Ans : a, b and d.

23) Suppose a Panel is added to a Frame and a Button is added to the Panel. If the
Frame’s font is set to 12-point TimesRoman, the Panel’s font is set to 10-point
TimesRoman, and the Button’s font is not set, what font will be used to dispaly the
Button’s label?

1. 12-point TimesRoman
2. 11-point TimesRoman
3. 10-point TimesRoman
4. 9-point TimesRoman

Ans : c.

24) A Frame’s background color is set to Color.Yellow, and a Button’s background


color is to Color.Blue. Suppose the Button is added to a Panel, which is added to the
Frame. What background color will be used with the Panel?

1. Colr.Yellow
2. Color.Blue
3. Color.Green
4. Color.White

Ans : a.
25) Which method will cause a Frame to be displayed?

1. show( )
2. setVisible( )
3. display( )
4. displayFrame( )

Ans : a and b.

26) All the componenet classes and container classes are derived from _________
class.

Ans : Object.

27) Which method of the container class can be used to add components to a Panel.

Ans : add ( ) method.

28) What are the subclasses of the Container class?

Ans : The Container class has three major subclasses. They are :

1. Window
2. Panel
3. ScrollPane

29) The Choice component allows multiple selection.

1. True.
2. False.

Ans : b.

30) The List component does not generate any events.

1. True.
2. False.

Ans : b.

31) Which components are used to get text input from the user.

Ans : TextField and TextArea.


32) Which object is needed to group Checkboxes to make them exclusive?

Ans : CheckboxGroup.

33) Which of the following components allow multiple selections?

1. Non-exclusive Checkboxes.
2. Radio buttons.
3. Choice.
4. List.

Ans : a and d.

34) What are the types of Checkboxes and what is the difference between them?

Ans : Java supports two types of Checkboxes. They are : Exclusive and Non-
exclusive.

In case of exclusive Checkboxes, only one among a group of items can be selected at
a time. I f an item from the group is selected, the checkbox currently checked is
deselected and the new selection is highlighted. The exclusive Checkboxes are also
called as Radio buttons.

The non-exclusive checkboxes are not grouped together and each one can be selected
independent of the other.

35) What is a Layout Manager and what are the different Layout Managers available
in java.awt and what is the default Layout manager for the panal and the panal
subclasses?

Ans: A layout Manager is an object that is used to organize components in a


container.

The different layouts available in java.awt are :

FlowLayout, BorderLayout, CardLayout, GridLayout and GridBag Layout.

The default Layout Manager of Panal and Panal sub classes is FlowLayout".

36) Can I exert control over the size and placement of components in my interface?

Ans : Yes.
myPanal.setLayout(null);

myPanal.setbounds(20,20,200,200);

37) Can I add the same component to more than one container?

Ans : No. Adding a component to a container automatically removes it from any


previous parent(container).

38) How do I specify where a window is to be placed?

Ans : Use setBounds, setSize, or setLocation methods to implement this.

setBounds(int x, int y, int width, int height)

setBounds(Rectangle r)

setSize(int width, int height)

setSize(Dimension d)

setLocation(int x, int y)

setLocation(Point p)

39) How can we create a borderless window?

Ans : Create an instance of the Window class, give it a size, and show it on the screen.

eg. Frame aFrame = ......

Window aWindow = new Window(aFrame);

aWindow.setLayout(new FlowLayout());

aWindow.add(new Button("Press Me"));

aWindow.getBounds(50,50,200,200);

aWindow.show();
40) Can I create a non-resizable windows? If so, how?

Ans: Yes. By using setResizable() method in class Frame.

41) What is the default Layout Manager for the Window and Window subclasses
(Frame,Dialog)?

Ans : BorderLayout().

42) How are the elements of different layouts organized?

Ans : FlowLayout : The elements of a FlowLayout are organized in a top to bottom,


left to right fashion.

BorderLayout : The elements of a BorderLayout are organized at the

borders (North, South, East and West) and the center of a

container.

CardLayout : The elements of a CardLayout are stacked, one on top of the other, like
a deck of cards.

GridLayout : The elements of a GridLayout are of equal size and are laid out using the
square of a grid.

GridBagLayout : The elements of a GridBagLayout are organized according to a


grid.However, the elements are of different sizes and may occupy

more than one row or column of the grid. In addition, the rows and columns may have
different sizes.

43) Which containers use a BorderLayout as their default layout?

Ans : The Window, Frame and Dialog classes use a BorderLayout as their default
layout.

44) Which containers use a FlowLayout as their default layout?

Ans : The Panel and the Applet classes use the FlowLayout as their default layout.

45) What is the preferred size of a component?


Ans : The preferred size of a component size that will allow the component to display
normally.

46) Which method is method to set the layout of a container?

1. startLayout( )
2. initLayout( )
3. layoutContainer( )
4. setLayout( )

Ans : d.

47) Which method returns the preferred size of a component?

1. getPreferredSize( )
2. getPreferred( )
3. getRequiredSize( )
4. getLayout( )

Ans : a.

48) Which layout should you use to organize the components of a container in a
tabular form?

1. CardLayout
2. BorederLayout
3. FlowLayout
4. GridLayout

Ans : d.

49) An application has a frame that uses a Border layout manager. Why is it probably
not a good idea to put a vertical scroll bar at North in the frame?

1. The scroll bar’s height would be its preferred height, which is not
likely to be enough.
2. The scroll bar’s width would be the entire width of the frame,
which would be much wider than necessary.
3. Both a and b.
4. Neither a nor b. There is no problem with the layout as described.

Ans : c.
50) What is the default layouts for a applet, a frame and a panel?

Ans : For an applet and a panel, Flow layout is the default layout, whereas Border
layout is default layout for a frame.

51) If a frame uses a Grid layout manager and does not contain any panels, then all the
components within the frame are the same width and height.

1. True
2. False.

Ans : a.

52) If a frame uses its default layout manager and does not contain any panels, then all
the components within the frame are the same width and height.

1. True
2. False.

Ans : b.

53) With a Border layout manager, the component at Center gets all the space that is
left over, after the components at North and South have been considered.

1. True
2. False

Ans : b.

54) An Applet has its Layout Manager set to the default of FlowLayout. What code
would be the correct to change to another Layout Manager?

1. setLayoutManager(new GridLayout());
2. setLayout(new GridLayout(2,2));
3. setGridLayout(2,2,))
4. setBorderLayout();

Ans : b.

55) How do you indicate where a component will be positioned using Flowlayout?

a) North, South,East,West
b) Assign a row/column grid reference
c) Pass a X/Y percentage parameter to the add method
d) Do nothing, the FlowLayout will position the component

Ans :d.

56) How do you change the current layout manager for a container?

a) Use the setLayout method


b) Once created you cannot change the current layout manager of a component
c) Use the setLayoutManager method
d) Use the updateLayout method

Ans :a.

57)When using the GridBagLayout manager, each new component requires a new
instance of the GridBagConstraints class. Is this statement true or false?

a) true
b) false

Ans : b.

58) Which of the following statements are true?

a)The default layout manager for an Applet is FlowLayout 


b) The default layout manager for an application is FlowLayout 
c) A layout manager must be assigned to an Applet before the setSize method is
called 
d) The FlowLayout manager attempts to honor the preferred size of any components

Ans : a and d.

59) Which method does display the messages whenever there is an item selection or
deselection of the CheckboxMenuItem menu?

Ans : itemStateChanged method.

60) Which is a dual state menu item?

Ans : CheckboxMenuItem.

61) Which method can be used to enable/diable a checkbox menu item?


Ans : setState(boolean).

62) Which of the following may a menu contain?

1. A separator
2. A check box
3. A menu
4. A button
5. A panel

Ans : a and c.

63) Which of the following may contain a menu bar?

1. A panel
2. A frame
3. An applet
4. A menu bar
5. A menu

Ans : b

64) What is the difference between a MenuItem and a CheckboxMenuItem?

Ans : The CheckboxMenuItem class extends the MenuItem class to support a menu
item

that may be checked or unchecked.

65) Which of the following are true?

1. A Dialog can have a MenuBar.


2. MenuItem extends Menu.
3. A MenuItem can be added to a Menu.
4. A Menu can be added to a Menu.

Ans : c and d.

Top
Utility Package

1) What is the Vector class?

ANSWER : The Vector class provides the capability to implement a growable array
of objects.

2) What is the Set interface?

ANSWER : The Set interface provides methods for accessing the elements of a finite
mathematical set.Sets do not allow duplicate elements.

3) What is Dictionary class?

ANSWER : The Dictionary class is the abstarct super class of Hashtable and
Properties class.Dictionary provides the abstarct functions used to store and retrieve
objects by key-value.This class allows any object to be used as a key or value.

4) What is the Hashtable class?

ANSWER : The Hashtable class implements a hash table data structure. A hash table
indexes and stores objects in a dictionary using hash codes as the objects' keys. Hash
codes are integer values that identify objects.

5) What is the Properties class?

Answer : The properties class is a subclass of Hashtable that can be read from or
written to a stream.It also provides the capability to specify a set of default values to
be used if a specified key is not found in the table. We have two methods load() and
save().

6) What changes are needed to make the following prg to compile?

import java.util.*;

class Ques{

public static void main (String args[]) {

String s1 = "abc";

String s2 = "def";
Vector v = new Vector();

v.add(s1);

v.add(s2);

String s3 = v.elementAt(0) + v.elementAt(1);

System.out.println(s3);

A) Declare Ques as public

B) Cast v.elementAt(0) to a String

C) Cast v.elementAt(1) to an Object.

D) Import java.lang

ANSWER : B) Cast v.elementAt(0) to a String

7) What is the output of the prg.

import java.util.*;

class Ques{

public static void main (String args[]) {

String s1 = "abc";

String s2 = "def";

Stack stack = new Stack();

stack.push(s1);

stack.push(s2);

try{
String s3 = (String) stack.pop() + (String) stack.pop() ;

System.out.println(s3);

}catch (EmptyStackException ex){}

A) abcdef

B) defabc

C) abcabc

D) defdef

ANSWER : B) defabc

9) Which of the following may have duplicate elements?

A)Collection

B) List

C) Map

D) Set

ANSWER : A and B Neither a Map nor a Set may have duplicate elements.

10) Can null value be added to a List?

ANSWER : Yes.A Null value may be added to any List.

11) What is the output of the following prg.

import java.util.*;

class Ques{

public static void main (String args[]) {


HashSet set = new HashSet();

String s1 = "abc";

String s2 = "def";

String s3 = "";

set.add(s1);

set.add(s2);

set.add(s1);

set.add(s2);

Iterator i = set.iterator();

while(i.hasNext())

s3 += (String) i.next();

System.out.println(s3);

A) abcdefabcdef B) defabcdefabc C) fedcbafedcba D) defabc

ANSWER : D) defabc. Sets may not have duplicate elements.

12) Which of the following java.util classes support internationalization?

A) Locale B) ResourceBundle C) Country D) Language

ANSWER : A and B . Country and Language are not java.util classes.

13) What is the ResourceBundle?


1. The ResourceBundle class also supports internationalization.

ResourceBundle subclasses are used to store locale-specific resources that can be


loaded by a program to tailor the program's appearence to the paticular locale in which
it is being run. Resource Bundles provide the capability to isolate a program's locale-
specific resources in a standard and modular manner.

14) How are Observer Interface and Observable class, in java.util package, used?

ANSWER : 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.

15) Which java.util classes and interfaces support event handling?

ANSWER : The EventObject class and the EventListener interface support event
processing.

16) Does java provide standard iterator functions for inspecting a collection of
objects?

ANSWER : The Enumeration interface in the java.util package provides a framework


for stepping once through a collection of objects. We have two methods in that
interface.

public interface Enumeration {

boolean hasMoreElements();

Object nextElement();

17) The Math.random method is too limited for my needs- How can I generate
random numbers more flexibly?

ANSWER : The random method in Math class provide quick, convienient access to
random numbers, but more power and flexibility use the Random class in the java.util
package.

double doubleval = Math.random();


The Random class provide methods returning float, int, double, and long values.

nextFloat() // type float; 0.0 <= value < 1.0

nextDouble() // type double; 0.0 <= value < 1.0

nextInt() // type int; Integer.MIN_VALUE <= value <= Integer.MAX_VALUE

nextLong() // type long; Long.MIN_VALUE <= value <= Long.MAX_VALUE

nextGaussian() // type double; has Gaussian("normal") distribution with mean 0.0 and
standard deviation 1.0)

Eg. Random r = new Random();

float floatval = r.nextFloat();

18) How can we get all public methods of an object dynamically?

ANSWER : By using getMethods(). It return an array of method objects


corresponding to the public methods of this class.

getFields() returns an array of Filed objects corresponding to the public


Fields(variables) of this class.

getConstructors() returns an array of constructor objects corresponding to the public


constructors of this class.

Top

JDBC

1) What are the steps involved in establishing a connection?

ANSWER : This involves two steps: (1) loading the driver and (2) making the
connection.

2) How can you load the drivers?


ANSWER : Loading the driver or drivers you want to use is very simple and involves
just one line of code. If, for example, you want to use the JDBC-ODBC Bridge driver,
the following code will load it:

Eg.

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Your driver documentation will give you the class name to use. For instance, if the
class name is jdbc.DriverXYZ , you would load the driver with the following line of
code:

Eg.

Class.forName("jdbc.DriverXYZ");

3) What Class.forName will do while loading drivers?

ANSWER : It is used to create an instance of a driver and register it with the
DriverManager.

When you have loaded a driver, it is available for making a connection with a DBMS.

4) How can you make the connection?

ANSWER : In establishing a connection is to have the appropriate driver connect to


the DBMS. The following line of code illustrates the general idea:

Eg.

String url = "jdbc:odbc:Fred";

Connection con = DriverManager.getConnection(url, "Fernanda", "J8");

5) How can you create JDBC statements?

ANSWER : A Statement object is what sends your SQL statement to the DBMS. You
simply create a Statement object and then execute it, supplying the appropriate
execute method with the SQL statement you want to send. For a SELECT statement,
the method to use is executeQuery. For statements that create or modify tables, the
method to use is executeUpdate.

Eg.
It takes an instance of an active connection to create a Statement object. In the
following example, we use our Connection object con to create the Statement object
stmt :

Statement stmt = con.createStatement();

6) How can you retrieve data from the ResultSet?

ANSWER : Step 1.

JDBC returns results in a ResultSet object, so we need to declare an instance of the


class ResultSet to hold our results. The following code demonstrates declaring the
ResultSet object rs.

Eg.

ResultSet rs = stmt.executeQuery("SELECT COF_NAME, PRICE FROM


COFFEES");

Step2.

String s = rs.getString("COF_NAME");

The method getString is invoked on the ResultSet object rs , so getString will retrieve
(get) the value stored in the column COF_NAME in the current row of rs

7) What are the different types of Statements?

ANSWER : 1.Statement (use createStatement method) 2. Prepared Statement (Use


prepareStatement method) and 3. Callable Statement (Use prepareCall)

8) How can you use PreparedStatement?

ANSWER : This special type of statement is derived from the more general class,
Statement.If you want to execute a Statement object many times, it will normally
reduce execution time to use a PreparedStatement object instead.

The advantage to this is that in most cases, this SQL statement will be sent to the
DBMS right away, where it will be compiled. As a result, the PreparedStatement
object contains not just an SQL statement, but an SQL statement that has been
precompiled. This means that when the PreparedStatement is executed, the DBMS
can just run the PreparedStatement 's SQL statement without having to compile it
first.
Eg.

PreparedStatement updateSales = con.prepareStatement("UPDATE COFFEES SET


SALES = ? WHERE COF_NAME LIKE ?");

9) What setAutoCommit does?

ANSWER : When a connection is created, it is in auto-commit mode. This means that


each individual SQL statement is treated as a transaction and will be automatically
committed right after it is executed. The way to allow two or more statements to be
grouped into a transaction is to disable auto-commit mode

Eg.

con.setAutoCommit(false);

Once auto-commit mode is disabled, no SQL statements will be committed until you
call the method commit explicitly.

Eg.

con.setAutoCommit(false);

PreparedStatement updateSales = con.prepareStatement(

"UPDATE COFFEES SET SALES = ? WHERE COF_NAME LIKE ?");

updateSales.setInt(1, 50);

updateSales.setString(2, "Colombian");

updateSales.executeUpdate();

PreparedStatement updateTotal = con.prepareStatement("UPDATE COFFEES SET


TOTAL = TOTAL + ? WHERE COF_NAME LIKE ?");

updateTotal.setInt(1, 50);

updateTotal.setString(2, "Colombian");

updateTotal.executeUpdate();

con.commit();
con.setAutoCommit(true);

10) How to call a Strored Procedure from JDBC?

ANSWER : The first step is to create a CallableStatement object. As with Statement


an and PreparedStatement objects, this is done with an open Connection

object. A CallableStatement object contains a call to a stored procedure;

Eg.

CallableStatement cs = con.prepareCall("{call SHOW_SUPPLIERS}");

ResultSet rs = cs.executeQuery();

11) How to Retrieve Warnings?

ANSWER : SQLWarning objects are a subclass of SQLException that deal with


database access warnings. Warnings do not stop the execution of an application, as
exceptions do; they simply alert the user that something did not happen as planned.

A warning can be reported on a Connection object, a Statement object (including


PreparedStatement and CallableStatement objects), or a ResultSet object. Each of
these classes has a getWarnings method, which you must invoke in order to see the
first warning reported on the calling object

Eg.

SQLWarning warning = stmt.getWarnings();

if (warning != null) {

System.out.println("\n---Warning---\n");

while (warning != null) {

System.out.println("Message: " + warning.getMessage());

System.out.println("SQLState: " + warning.getSQLState());

System.out.print("Vendor error code: ");

System.out.println(warning.getErrorCode());
System.out.println("");

warning = warning.getNextWarning();

12) How can you Move the Cursor in Scrollable Result Sets ?

ANSWER : One of the new features in the JDBC 2.0 API is the ability to move a
result set's cursor backward as well as forward. There are also methods that let you
move the cursor to a particular row and check the position of the cursor.

Eg.

Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,

ResultSet.CONCUR_READ_ONLY);

ResultSet srs = stmt.executeQuery("SELECT COF_NAME, PRICE FROM


COFFEES");

The first argument is one of three constants added to the ResultSet API to indicate the
type of a ResultSet object: TYPE_FORWARD_ONLY,
TYPE_SCROLL_INSENSITIVE , and TYPE_SCROLL_SENSITIVE .

The second argument is one of two ResultSet constants for specifying whether a result
set is read-only or updatable: CONCUR_READ_ONLY and
CONCUR_UPDATABLE . The point to remember here is that if you specify a type,
you must also specify whether it is read-only or updatable. Also, you must specify the
type first, and because both parameters are of type int , the compiler will not complain
if you switch the order.

Specifying the constant TYPE_FORWARD_ONLY creates a nonscrollable result set,


that is, one in which the cursor moves only forward. If you do not specify any
constants for the type and updatability of a ResultSet object, you will automatically
get one that is TYPE_FORWARD_ONLY and CONCUR_READ_ONLY

13) What’s the difference between TYPE_SCROLL_INSENSITIVE , and


TYPE_SCROLL_SENSITIVE?
ANSWER : You will get a scrollable ResultSet object if you specify one of these
ResultSet constants.The difference between the two has to do with whether a result set
reflects changes that are made to it while it is open and whether certain methods can
be called to detect these changes. Generally speaking, a result set that is
TYPE_SCROLL_INSENSITIVE does not reflect changes made while it is still open
and one that is TYPE_SCROLL_SENSITIVE does. All three types of result sets will
make changes visible if they are closed and then reopened

Eg.

Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,


ResultSet.CONCUR_READ_ONLY);

ResultSet srs = stmt.executeQuery("SELECT COF_NAME, PRICE FROM


COFFEES");

srs.afterLast();

while (srs.previous()) {

String name = srs.getString("COF_NAME");

float price = srs.getFloat("PRICE");

System.out.println(name + " " + price);

14) How to Make Updates to Updatable Result Sets?

ANSWER : Another new feature in the JDBC 2.0 API is the ability to update rows in
a result set using methods in the Java programming language rather than having to
send an SQL command. But before you can take advantage of this capability, you
need to create a ResultSet object that is updatable. In order to do this, you supply the
ResultSet constant CONCUR_UPDATABLE to the createStatement method.

Eg.

Connection con =
DriverManager.getConnection("jdbc:mySubprotocol:mySubName");

Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,


ResultSet.CONCUR_UPDATABLE);

ResultSet uprs = stmt.executeQuery("SELECT COF_NAME, PRICE FROM


COFFEES");

Top

Networking Concepts

1) The API doesn't list any constructors for InetAddress- How do I create an
InetAddress instance?

ANSWER : In case of InetAddress the three methods getLocalHost, getByName,


getByAllName can be used to create instances.

E.g.

InetAddress add1;

InetAddress add2;

try{

add1 = InetAddress.getByName("java.sun.com");

add2 = InetAddress.getByName("199.22.22.22");

}catch(UnknownHostException e){}

2) Is it possible to get the Local host IP?

ANSWER : Yes. Use InetAddress's getLocalHost method.

3) What's the Factory Method?

ANSWER : Factory methods are merely a convention whereby static methods in a


class return an instance of that class. The InetAddress class has no visible
constructors. To create an InetAddress object, you have to use one of the available
factory methods. In InetAddress the three methods getLocalHost, getByName,
getByAllName can be used to create instances of InetAddress.
4) What’s the difference between TCP and UDP?

ANSWER : These two protocols differ in the way they carry out the action of
communicating. A TCP protocol establishes a two way connection between a pair of
computers, while the UDP protocol is a one-way message sender. The common
analogy is that TCP is like making a phone call and carrying on a two-way
communication, while UDP is like mailing a letter.

5) What is the Proxy Server?

ANSWER : A proxy server speaks the client side of a protocol to another server. This
is often required when clients have certain restrictions on which servers they can
connect to. And when several users are hitting a popular web site, a proxy server can
get the contents of the web server's popular pages once, saving expensive
internetwork transfers while providing faster access to those pages to the clients.

Also, we can get multiple connections for a single server.

6) What are the seven layers of OSI model?

ANSWER : Application, Presentation, Session, Transport, Network, DataLink,


Physical Layer.

7) What Transport Layer does?

ANSWER : It ensures that the mail gets to its destination. If a packet fails to get its
destination, it handles the process of notifying the sender and requesting that another
packet be sent.

8) What is DHCP?

ANSWER : Dynamic Host Configuration Protocol, a piece of the TCP/IP protocol


suite that handles the automatic assignment of IP addresses to clients.

9) What is SMTP?

ANSWER : Simple Mail Transmission Protocol, the TCP/IP Standard for Internet
mails. SMTP exchanges mail between servers; contrast this with POP, which
transmits mail between a server and a client.

10) In OSI N/w architecture, the dialogue control and token management are
responsibilities of...
a) Network b) Session c) Application d) DataLink

ANSWER : b) Session Layer.

11) In OSI N/W Architecture, the routing is performed by ______

a) Network b) Session c) Application d) DataLink

Answer : Network Layer.

Top

Networking

1) What is the difference between URL instance and URLConnection instance?

ANSWER : A URL instance represents the location of a resource, and a


URLConnection instance represents a link for accessing or communicating with the
resource at the location.

2) How do I make a connection to URL?

ANSWER : You obtain a URL instance and then invoke openConnection on it.

URLConnection is an abstract class, which means you can't directly create instances
of it using a constructor. We have to invoke openConnection method on a URL
instance, to get the right kind of connection for your URL.

Eg. URL url;

URLConnection connection;

try{ url = new URL("...");

conection = url.openConnection();

}catch (MalFormedURLException e) { }

3) What Is a Socket?
A socket is one end-point of a two-way communication link between two programs
running on the network. A socket is bound to a port number so that the TCP layer can
identify the application that data is destined to be sent.Socket classes are used to
represent the connection between a client program and a server program. The java.net
package provides two classes--Socket and ServerSocket--which implement the client
side of the connection and the server side of the connection, respectively.

4) What information is needed to create a TCP Socket?

ANSWER : The Local System’s IP Address and Port Number. And the Remote
System's IPAddress and Port Number.

5) What are the two important TCP Socket classes?

ANSWER : Socket and ServerSocket.

ServerSocket is used for normal two-way socket communication. Socket class allows
us to read and write through the sockets. getInputStream() and getOutputStream() are
the two methods available in Socket class.

6) When MalformedURLException and UnknownHostException throws?

ANSWER : When the specified URL is not connected then the URL throw
MalformedURLException and If InetAddress’ methods getByName and getLocalHost
are unabletoresolve the host name they throwan UnknownHostException.  

Top

Servlets

1) What is the servlet?

ANSWER : Servlets are modules that extend request/response-oriented servers, such


as Java-enabled web servers. For example, a servlet might be responsible for taking
data in an HTML order-entry form and applying the business logic used to update a
company's order database.

Servlets are to servers what applets are to browsers. Unlike applets, however, servlets
have no graphical user interface.

2) Whats the advantages using servlets than using CGI?


ANSWER : Servlets provide a way to generate dynamic documents that is both easier
to write and faster to run. Servlets also address the problem of doing server-side
programming with platform-specific APIs: they are developed with the Java Servlet
API, a standard Java extension.

3) What are the uses of Servlets?

ANSWER : A servlet can handle multiple requests concurrently, and can synchronize
requests. This allows servlets to support systems such as on-line conferencing.

Servlets can forward requests to other servers and servlets.Thus servlets can be used
to balance load among several servers that mirror the same content, and to partition a
single logical service over several servers, according to task type or organizational
boundaries.

4) Which pakage provides interfaces and classes for writing servlets?

ANSWER : javax

5) Whats the Servlet Interfcae?

ANSWER : The central abstraction in the Servlet API is the Servlet interface. All
servlets implement this interface, either directly or, more commonly, by extending a
class that implements it such as HttpServlet.

Servlets-->Generic Servlet-->HttpServlet-->MyServlet.

The Servlet interface declares, but does not implement, methods that manage the
servlet and its communications with clients. Servlet writers provide some or all of
these methods when developing a servlet.

6) When a servlet accepts a call from a client, it receives two objects- What are
they?

ANSWER : ServeltRequest: Which encapsulates the communication from the client


to the server. ServletResponse: Whcih encapsulates the communication from the
servlet back to the client. ServletRequest and ServletResponse are interfaces defined
by the javax.servlet package.

7) What information that the ServletRequest interface allows the servlet access
to?
ANSWER : Information such as the names of the parameters passed in by the client,
the protocol (scheme) being used by the client, and the names of the remote host that
made the request and the server that received it.

The input stream, ServletInputStream.Servlets use the input stream to get data from
clients that use application protocols such as the HTTP POST and PUT methods.

8) What information that the ServletResponse interface gives the servlet methods
for replying to the client?

ANSWER : It Allows the servlet to set the content length and MIME type of the
reply.

Provides an output stream, ServletOutputStream and a Writer through which the


servlet can send the reply data.

9) What is the servlet Lifecycle?

ANSWER : Each servlet has the same life cycle:

A server loads and initializes the servlet (init())

The servlet handles zero or more client requests (service())

The server removes the servlet (destroy())

(some servers do this step only when they shut down)

10) How HTTP Servlet handles client requests?

ANSWER : An HTTP Servlet handles client requests through its service method. The
service method supports standard HTTP client requests by dispatching each request to
a method designed to handle that request.

Você também pode gostar