Sie sind auf Seite 1von 116

Table Of Contents

1.List of books to be referred…………………………………………………………..……2


2. List of websites………………………………………………………………...…………..4
3. Verbal section
3.1 Synonyms ……………………………………………………..…………………5
3.2 Often confused words…………………………………..………………………..9
3.3 Fill in the blanks………………………………...………………………………19
4. Technical section
4.1 C aptitude questions…………………………………………………………….25
4.2 General programs asked very often…………………………………………….53
4.3 C/C++ Interview questions…………………………………………………..…68
4.4 Java Interview questions………………………………………………………..74
4.5 Computer Networks Interview questions………………………………….……96
5. H.R. section……………………………………………………………………………..111

NMIT P&T Page 1


Chapter-1 - List of Books

S.No NAME OF THE BOOK AUTHOR

1. PUZZLES TO PUZZLES YOU SHAKUNTHALA DEVI

2. BARRON'S GRE BARRON

3. PUZZLES TEASERS GEORGE SUMMERS

4. MORE PUZZLES SHAKUNTHALA DEVI

5. GENERAL APTITUDE R.S. AGARWAL

6. QUANTITATIVE APTITUDE R.S. AGARWAL

7. LET US C &TEST YOUR 'C' YESHWANT KANITHKAR


SKILLS

8. POINTERS IN 'C' YESHWANT KANITHKAR

9. MBA ENTRANCE GUIDE ANY BOOK

10. QUANTITAVE APTITUDE ABHIJIT GUHA(TMH publications)

11. THE PEARSON GUIDE TO DINESH KHATTAR(Pearson


QUANTITAVE APTITUDE FOR publications)
MBA EXAMS

 Refer all your respective branch text books for technical questions

NMIT P&T Page 2


Technical for IT companies:

1) Let us C by Kanitkar

2) Exploring C by Kanitkar

3) Test your C skills by Kanitkar

4) C++ complete Reference by Herbert Schildth**

5) Test your C++ Skills by kanitkar

6) Datastructures with C by Padmareddy **

7) Data Structures - by Horowiz and Sahani and also Kanitkar, Tanenbaum

8)Unix by S. Das

9) Operating System by Galvin

10) Data and Computer Communication by Tanenbaum

11) Computer Networks By Tanenbaum **

12) Analysis and Design of Algorithms by Levitin

13) Software Engineering bySomarville **i

14) DBMS by Ramkrishna, Navathe, IvonByross.

15) SQL Complete Reference for more on SQL

i
** --- Very important

NMIT P&T Page 3


Chapter-2 : List of Web links
1) www.indiabix.com
2) www.vyomworld.com
3) www.exforsys.com
4) www.freshersworld.com
5) www.placementpapers.com
6) www.bestebooksworld.com
7) www.testsworld.com
8) www.jbigdeal.com

NMIT P&T Page 4


Chapter-3 : Verbal Section
3.1 SYNONYMS:

Admonish= usurp
Adhesive = tenacious, sticky, glue, gum, bonding agent
Alienate = estrange
Bileaf = big screen, big shot, big success
Belief = conviction
Baffle = puzzle
Brim = edge
Covet = to desire
Caprice = whim
Concur = similar, acquiesce
Confiscate = appropriate, to take charge, to annex
Cargo = load, luggage
Dispel = scatter
Divulge = reveal, make known, disclose
Discretion = prudence
Emancipate = liberate
Efface = obliterate
Embrace = hug, hold, cuddle
Furtive = stealthy
Heap = to gather
Hamper = obstruct
Heap = to pile
Hover = linger
Incentive = spur
Instigate = incite
Inert = passive
Latitude = scope
Lethargy = stupor
Lamont = lakes, lamentable
Lament = wail
Latent = potential
Merry = Enjoy
Meager = small, little, scanty
Misery = distress
Momentary = for small time
Merit = to deserve

NMIT P&T Page 5


Miserable = unhappy, sad
Obstinate = stubborn
Overt = obvious, clear, explicit, evident
Pretentious = ostentatious
Potential = ability
Rinaile = rigorous
Renounce= reject
Solicit = Humble, urge
Subside = wane
Stifle = snits
Tranquil = calm, silent, serene
To merit- to deserve
Volume = quantity
Veer = diverge
Wethargy = well wisher
Depreciation = deflation,depression,devaluation,fall,slump
Depricate = feel and express disapproval
Incentive = thing one encourages one to do
Echelon = level of authority or responsibility
Innovation = make changes or introduce new things
Intermittant = externally stopping and then starting
Detrimental = harmful
Mesotiate = ...
Conciliation = make less angry or more friendly
Orthodox = conventional or superstitious
Fallible = liable to err
Volatile = ever changing
Manifestion = clear or obvious
Connotation =
Reciprocal = reverse, opposite
Agrarian = related to agriculture
Vacillate = undecided or dilemma
Experdent = fitting proper , desirable
Simulate = produce artificially resembling an existing one
Access = to approach
Compensation= salary
Truncate = shorten by cutting
Adherance = stick
Heterogenous = non-similar things
Surplus = excessive

NMIT P&T Page 6


Assess = determine the amount or value
Cognezance = knowledge
Retrospective = review
Naive = innocent , rustic
Equivocate = tallying on both sides
Postulate = frame a theory
Latent = dormant,secret
Fluctuate = wavering
Eliminate = to reduce
Affinity = strong liking
Expidite = hasten
Console = to show sympathy
Adversary = opposition
Affable = lovable,approchable
Decomposable = rotten
Agregious = apart from crowd,especially bad
Conglomeration = group
Aberration = deviation
Erudite = wise, profound
Augury = prediction
Credibility = ability to common belief,quality of being credible
admonish = usurp (reprove) merry = gay
alienate = estrange (isolate) instigate = incite
dispel = dissipate (dismiss) belief = conviction
covet= crave (desire) belated = too late
solicit = beseech (seek) brim = border
subside = wane (drop) renounce= reject
hover = linger (stay close) divulge = reveal
heap = to pile (collect) adhesive = tenacious
veer = diverge (turn) hamper = obstruct
caprice = whim (impulse) to merit= to deserve
stifle = suffocate (smother) inert = passive
latent = potential (inactive) latitude = scope
concur = acquiesce (accept) momentary = transient
tranquil = serene (calm) admonish = cautious
lethargy = stupor (lazy) volume = quantity
furtive= stealthy (secret) meager = scanty
cargo = freight(load) baffle = frustrate
efface = obliterate(wipe out) misery = distress
pretentious = ostentatious(affected) discretion = prudence

NMIT P&T Page 7


compunction = remorse (regret) amiable = friendly
cajole = coax (wheedle – sweet talk) incentive = provocation
Embrace = hug (hold-cuddle) latent = potential
Confiscate = appropriate (to take charge) emancipate = liberate
lament = mourn confiscate = appropriate
obstinate = stubborn acumen = exactness
metamorphosis = transform scrutiny = close examination
annihilate = to destroy fuse = combine
whet = sharpen behest = request
adage = proverb penitence = to repeat
Depreciation: deflation, depression, devaluation, fall, slump
Deprecate : feel and express disapproval,
Incentive : thing one encourages one to do (stimulus)
Echelon : level of authority or responsibility
Innovation : make changes or introduce new things
Intermittent : externally stopping and then starting
Detrimental: harmful
Conciliation : make less angry or more friendly
Orthodox: conventional or traditional, superstitious
Fallible : liable to error
Volatile : ever changing
Manifest: clear and obvious
Connotation : suggest or implied meaning of expression
Reciprocal: reverse or opposite
Agrarian : related to agriculture
Vacillate : undecided or dilemma
Expedient : fitting proper, desirable
Simulate : produce artificially resembling an existing one.

NMIT P&T Page 8


3.2 Often Confused Words
Part I :

Words Meanings/ Usage


Accede If you drive too fast, you exceed the speed limit.
Exceed "Accede" is a much rarer word meaning "give in," "agree."
Accept If you offer me chocolates I will gladly accept them--except for
Except the ones with caramel in them!
Just remember that the "X" in "except" excludes things.
And be careful; when typing "except" it often comes out
"expect."
Adapt You can adopt a child or a custom; in all of these cases you are
Adopt making the object of the adoption your own, accepting it.
If you adapt something, however, you are changing it. Or you
may changing yourself to “adapt” to a new situation!
Adverse The word "adverse" turns up most frequently in the phrase
Averse "adverse circumstances," meaning difficult circumstances,
circumstances which act as an adversary; but people often
confuse this word with "averse," a much rarer word, meaning
having a strong feeling against, or aversion toward.
Advice Advice" is the noun, "advise" the verb. When your teacher
Advise advises you, she gives you advice.

Affect There are four distinct words here. When "affect" is accented on
Effect the final syllable (a-FECT), it is a verb meaning "have an
influence on" "The million-dollar donation from the industrialist
did not affect my vote against the Clean Air Act." A much rarer
meaning is indicated when the word is accented on the first
syllable (AFF-ect), meaning "emotion." In this case the word is
used mostly by psychiatrists and social scientists-- people who
normally know how to spell it. The real problem arises when
people confuse the first spelling with the second: "effect." This
too can be two different words. The more common one is a
noun: "When I left the stove on, the effect was that the house
filled with smoke." When you affect a situation, you have an
effect on it. The less common is a verb meaning "to create": "I'm
trying to effect a change in the way we purchase widgets." No
wonder people are confused. Hey, nobody ever said English was
logical: just memorize it and get on with your life.

NMIT P&T Page 9


Altogether "Altogether" is an adverb meaning "completely," "entirely." For
All Together example: "When he first saw the examination questions, he was
altogether baffled." "All together," in contrast, is a phrase
meaning "in a group." For example: "The wedding guests were
gathered all together in the garden."
Allude You can allude (refer) to your daughter's membership in the
Elude honor society when boasting about her, but a criminal tries to
elude (escape) captivity. There is no such word as "illude."
Allusion An allusion is a reference, something you allude to: "Her
Illusion allusion to flowers reminded me that Valentine's Day was
coming." In that English paper, don't write "literary illusions"
when you mean "allusions." A mirage, hallucination, or a magic
trick is an illusion. (Doesn't being fooled just make you ill?)
Amoral "Amoral" is a rather technical word meaning "unrelated to
Immoral morality." When you mean to denounce someone's behavior, call
it "immoral."
Anecdote A humorist relates "anecdotes." The doctor prescribes
Antidote "antidotes" for children who have swallowed poison. Laughter
may be the best medicine, but that's no reason to confuse these
two with each other.
Appraise When you estimate the value of something, you appraise it.
Apprise When you inform people of a situation, you apprise them of it.

Capital A "capitol" is always a building. Cities and all other uses are
Capitol spelled with an A in the last syllable.

Cite You cite the author in an endnote; you visit a Web site or the site
Site of the crime, and you sight your car being towed away from the
Sight gate you parked in front of!

Click Students lamenting the division of their schools into snobbish


Clique factions often misspell "clique" as "click." In the original French,
"clique" was synonymous with "claque"--an organized group of
supporters at a theatrical event who tried to prompt positive
audience response by clapping enthusiastically.
Collaborate People who work together on a project collaborate (share their
Corroborate labor); people who support your testimony as a witness
corroborate (strengthen by confirming) it.

NMIT P&T Page 10


Compare To These are sometimes interchangeable, but when you are stressing
Compare With similarities between the items compared, the most common word
is "to": "She compared his home-made wine to toxic waste." If
you are examining both similarities and differences, use "with":
"The teacher compared Steve's exam with Robert's to see
whether they had cheated."

Complement Originally these two spellings were used interchangeably, but


Compliment they have come to be distinguished from each other in modern
times. Most of the time the word people intend is "compliment":
nice things said about someone ("She paid me the compliment of
admiring the way I shined my shoes."). "Complement," much
less common, has a number of meanings associated with
matching or completing. Complements supplement each other,
each adding something the others lack, so we can say that
"Alice's love for entertaining and Mike's love for washing dishes
complement each other."

Continual "Continuous" refers to actions which are uninterrupted: "My


Continuous upstairs neighbor played his stereo continuously from 6:00 PM
to 3:30 AM." Continual actions, however, need not be
uninterrupted, only repeated: "My father continually urges me to
get a job."

Credible "Credible" means "believable" or "trustworthy." It is also used in


Credulous a more abstract sense, meaning something like "worthy": "She
made a credible lyric soprano." Don't confuse "credible" with
"credulous," a much rarer word which means "gullible." "He was
incredulous" means "he didn't believe it" whereas "he was
incredible" means "he was wonderful" (but use the latter
expression only in casual speech).
Criteria There are several words with Latin or Greek roots whose plural
Criterion forms ending in A are constantly mistaken for singular ones. You
can have one criterion or many criteria. Don't confuse them.
Same rule applies for words such as Phenomenon & Phenomena.

NMIT P&T Page 11


Critique A critique is a detailed evaluation of something. The formal way
Criticize to request one is "give me your critique," though people often
say informally "critique this"--meaning "evaluate it thoroughly."
But "critique" as a verb is not synonymous with "criticize" and
should not be routinely substituted for it. "Josh critiqued my
backhand" means Josh evaluated your tennis technique but not
necessarily that he found it lacking. "Josh criticized my
backhand" means that he had a low opinion of it.
You can write criticism on a subject, but you don't criticize on
something, you just criticize it.

Defuse You defuse a dangerous situation by treating it like a bomb and


Diffuse removing its fuse; to diffuse, in contrast, is to spread something
out: "Bob's cheap cologne diffused throughout the room,
wrecking the wine-tasting."
Depreciate To depreciate something is to actually make it worse, whereas to
Deprecate deprecate something is simply to speak or think of it in a manner
that demonstrates your low opinion of it.
Device "Device" is a noun. A can-opener is a device. "Devise" is a verb.
Devise You can devise a plan for opening a can with a sharp rock
instead. Only in law is "devise" properly used as a noun,
meaning something deeded in a will.
Disburse You disburse money by taking it out of your purse (French
Disperse "bourse") and distributing it. If you refuse to hand out any
money, the eager mob of beggars before you may disperse
(scatter).
Discreet The more common word is "discreet," meaning "prudent,
Discrete circumspect": "When arranging the party for Agnes, be sure to
be discreet; we want her to be surprised." "Discrete" means
"separate, distinct": "He arranged the guest list into two discrete
groups: meat-eaters and vegetarians." Note how the T separates
the two Es in "discrete."
Disinterested A bored person is uninterested. Do not confuse this word with
Uninterested the much rarer disinterested, which means "objective, neutral".

Drastic "Drastic" means "severe" and is always negative. Drastic


Dramatic measures are not just extreme, they are likely to have harmful
side-effects. Don't use this word or "drastically" in a positive or
neutral sense. A drastic rise in temperature should be seen as
downright dangerous, not just surprisingly large. Often people
mean "dramatic" instead.
Dual "Dual" is an adjective describing the two-ness of something--
Duel dual carburetors, for instance. A "duel" is a formal battle
intended to settle a dispute.

NMIT P&T Page 12


Elicit The lawyer tries to elicit a description of the attacker from the
Illicit witness. "Elicit" is always a verb. "Illicit," in contrast, is always
an adjective describing something illegal or naughty.
Emigrate To "emigrate" is to leave a country. The E at the beginning of the
Immigrate word is related to the E in other words having to do with going
out, such as "exit." "Immigrate," in contrast, looks as if it might
have something to do with going in, and indeed it does: it means
to move into a new country. The same distinction applies to
"emigration" and "immigration A migrant is someone who
continually moves about.
Eminent By far the most common of these words is "eminent," meaning
Imminent "prominent, famous." "Imminent," in phrases like "facing
Immanent imminent disaster," means "threatening." It comes from Latin
minere, meaning "to project or overhang." Positive events can
also be imminent: they just need to be coming soon. The rarest
of the three is "immanent," used by philosophers to mean
"inherent" and by theologians to mean "present throughout the
universe" when referring to God. It comes from Latin manere,
"remain."

Enquire These are alternative spellings of the same word. "Enquire" is


Inquire more common in the U.K., but either is acceptable in the U.S.
Assure To "assure" a person of something is to make him or her
Ensure confident of it. To "ensure" that something happens is to make
Insure certain that it does, and to "insure" is to issue an insurance
policy. However, many consider "ensure" and "insure"
interchangeable. To please conservatives, make the distinction.
Epigram An epigram is a pithy saying, usually humorous. Mark Twain
Epigraph was responsible for many striking, mostly cynical epigrams,
Epitaph such as "Always do right. That will gratify some of the people,
Epithet and astonish the rest."
An epigraph is a brief quotation used to introduce a piece of
writing or the inscription on a statue or building.
An epitaph is the inscription on a tombstone or some other
tribute to a dead person.
In literature, an epithet is a term that replaces or is added to the
name of a person, like "clear-eyed Athena," in which "clear-
eyed" is the epithet. You are more likely to encounter the term in
its negative sense, as a term of insult or abuse: "the shoplifter
hurled epithets at the guard who had arrested her."
Exalt When you celebrate joyfully, you exult. When you raise
Exult something high (even if only in your opinion), you exalt it.

NMIT P&T Page 13


Foreboding "Foreboding" means "ominous," as in "The sky was a foreboding
Forbidding shade of gray" (i.e. predictive of a storm). The prefix "fore-"
Formidable with an E, often indicates futurity, e. g. "forecast,"
"foreshadowing" and "foreword. A forbidding person or task is
hostile or dangerous: "The trek across the desert to the nearest
latte stand was forbidding."
"Formidable," which originally meant "fear-inducing" ("Mike
Tyson is a formidable opponent") has come to be used primarily
as a compliment meaning "awe-inducing" ("Gary Kasparov's
formidable skills as a chess player were of no avail against Deep
Blue").
Forego The E in "forego" tells you it has to do with going before. It
Forgo occurs mainly in the expression "foregone conclusion," a
conclusion arrived at in advance. "Forgo" means to abstain from
or do without. "After finishing his steak, he decided to forgo the
blueberry cheesecake."

Part II :

Words Meanings/ Usage


Fortuitous "Fortuitous" events happen by chance; they need not be
Fortunate fortunate events, only random ones: "It was purely fortuitous
that the meter reader came along five minutes before I
returned to my car." Although fortunate events may be
fortuitous, when you mean "lucky," use "fortunate."
Gaff Gaffe is a French word meaning "embarrassing mistake," and
Gaffe should not be mixed up with "gaff": a large hook.

Gild You gild an object by covering it with gold; you can join an
Guild organization like the Theatre Guild.

Grisly "Grisly" means "horrible"; a "grizzly" is a bear. "The grizzly


Grizzly left behind the grisly remains of his victim." "Grizzled,"
means "having gray hairs," not to be confused with "gristly,"
full of gristle.
Hero In ordinary usage "hero" has two meanings: "leading
Protagonist character in a story" and "brave, admirable person." In
simple tales the two meanings may work together, but in
modern literature and film the leading character or
"protagonist" (a technical term common in literary criticism)
may behave in a very unheroic fashion.

NMIT P&T Page 14


Hold Your Peace Some folks imagine that since these expressions are
Say Your Piece opposites, the last word in each should be the same; but in
fact they are unrelated expressions. The first means
"maintain your silence," and the other means literally "speak
aloud a piece of writing" but is used to express the idea of
making a statement.
Impertinent "Impertinent" looks as if it ought to mean the opposite of
Irrelevant "pertinent," and indeed it once did; but for centuries now its
meaning in ordinary speech has been narrowed to
"impudent," specifically in regard to actions or speech
toward someone regarded as socially superior. Only snobs
and very old-fashioned people use "impertinent" correctly;
most people would be well advised to forget it and use
"irrelevant" instead to mean the opposite of "pertinent."
Install You install equipment, you instill feelings or attitudes.
Instill

Liable If you are likely to do something you are liable to do it; and
Libel if a debt can legitimately be charged to you, you are liable
for it. A person who defames you with a false accusation
libels you.
Lose This confusion can easily be avoided if you pronounce the
Loose word intended aloud. If it has a voiced Z sound, then it's
"lose." If it has a hissy S sound, then it's "loose." Here are
examples of correct usage: "He tends to lose his keys." "She
lets her dog run loose." Note that when "lose" turns into
"losing" it loses its "E."
Mantle Though they stem from the same word, a "mantle" today is
Mantel usually a cloak, while the shelf over a fireplace is most often
spelled "mantel."
Marital "Marital" refers to marriage, "martial" to war, whose ancient
Martial god was Mars.

Moral If you are trying to make people behave properly, you are
Morale policing their morals; if you are just trying to keep their
spirits up, you are trying to maintain their morale. "Moral" is
accented on the first syllable, "morale" on the second.
Oppress Dictators commonly oppress their citizens and repress
Repress dissent, but these words don't mean exactly the same thing.
"Repress" just means "keep under control." Sometimes
repression is a good thing: "During the job interview, repress
the temptation to tell Mr. Brown that he has toilet paper
stuck to his shoe." Oppression is always bad, and implies
serious persecution.

NMIT P&T Page 15


Ordinance A law is an ordinance, but a gun is a piece of ordnance.
Ordnance

Oversee When you oversee the preparation of dinner, you take control
Overlook and manage the operation closely. But if you overlook the
preparation of dinner you forget to prepare the meal entirely-
-better order pizza.
Palate Your "palate" is the roof of your mouth, and by extension,
Palette your sense of taste. A "palette" is the flat board an artist
Pallet mixes paint on (or by extension, a range of colors). A
"pallet" is either a bed (now rare) or a flat platform onto
which goods are loaded.
Peak It is tempting to think that your attention might be aroused to
Peek a high point by "peaking" your curiosity; but in fact, "pique"
Pique is a French word meaning "prick," in the sense of
"stimulate." The expression has nothing to do with "peek,"
either. Therefore the expression is "my curiosity was
piqued."
Persecute When you persecute someone, you're treating them badly,
Prosecute whether they deserve it or not; but only legal officers can
prosecute someone for a crime.
Perspective "Perspective" has to do with sight, as in painting, and is
Prospective usually a noun. "Prospective" generally has to do with the
future (compare with "What are your prospects, young
man?") and is usually an adjective. But beware: there is also
a rather old-fashioned but fairly common meaning of the
word "prospect" that has to do with sight: "as he climbed the
mountain, a vast prospect opened up before him."
Practice In the United Kingdom, "practice" is the noun, "practise" the
Practise verb; but in the U.S. the spelling "practice" is commonly
used for both, though the distinction is sometimes observed.
"Practise" as a noun is, however, always wrong in both
places: a doctor always has a "practice," never a "practise."
Precede "Precede" means "to go before." "Proceed" means to go on.
Proceed Let your companion precede you through the door, then
proceed to follow her.
Precedence Although these words sound the same, they work differently.
Precedent The pop star is given precedence over the factory worker at
the entrance to the dance club. "Precedent" is an example or
standard or pattern.

NMIT P&T Page 16


Premier These words are, respectively, the masculine and feminine
Premiere forms of the word for "first" in French; but they have become
differentiated in English. Only the masculine form is used as
an adjective, as in "Tidy-Pool is the premier pool-cleaning
firm in Orange County." "Premiere" as a verb is common in
the arts and in show business ("the show premiered on
PBS"), but it is less acceptable in other contexts ("the state
government premiered its new welfare system"). Use
"introduced," or, if real innovation is involved, "pioneered."
Prescribe You recommend something when you prescribe it, but you
Proscribe forbid it when you proscribe it. The usually positive function
of "pro-" confuses many people.
Principal "Principal" is a noun and adjective referring to someone or
Principle something which is highest in rank or importance. (In a loan,
the principal is the more substantial part of the money, the
interest is--or should be--the lesser.) "Principle" is only a
noun, and has to do with law or doctrine: "The workers
fought hard for the principle of collective bargaining."
Prostate The gland men have is called the prostate. "Prostrate" is an
Prostrate adjective meaning "lying face downward."

Ravaging To ravage is to pillage, sack, or devastate. The only time


Ravishing "ravaging" is properly used is in phrases like "when the
Ravenous pirates had finished ravaging the town, they turned to
ravishing the women." Which brings us to "ravish": meaning
to rape, or rob violently. A trailer court can be ravaged by a
storm (nothing is stolen, but a lot of damage is done) but not
ravished. The crown jewels of Ruritania can be ravished
(stolen using violence) without being ravaged (damaged).
Originally, "raven" as a verb was synonymous with "ravish"
in the sense of "to steal by force." One of its specialized
meanings became "devour," as in "the lion ravened her
prey." By analogy, hungry people became "ravenous" (as
hungry as beasts), and that remains the only common use of
the word today.
If a woman smashes your apartment up, she ravages it. If she
looks stunningly beautiful, she is ravishing. If she eats the
whole platter of hors d'oeuvres you've set out for the party
before the other guests come, she's ravenous.

Reign A king or queen reigns, but you rein in a horse. The


Rein expression "to give rein" means to give in to an impulse as a
spirited horse gives in to its impulse to gallop when you
slacken the reins. Similarly, the correct expression is "free
rein," not "free reign."

NMIT P&T Page 17


Revue You can attend a musical revue in a theatre, but when you
Review write up your reactions for a newspaper, you're writing a
review.
Risky People unfamiliar with the French-derived word "risqué"
Risqué ("slightly indecent") often write "risky" by mistake. Bungee-
jumping is risky, but nude bungee-jumping is risqué.

Sensual "Sensual" usually relates to physical desires and experiences,


Sensuous and often means "sexy." But "sensuous" is more often used
for esthetic pleasures, like "sensuous music." The two words
do overlap a good deal. The leather seats in your new car
may be sensuous; but if they turn you on, they might be
sensual. "Sensual" often has a slightly racy or even
judgmental tone lacking in "sensuous."
Stationary When something is standing still, it's stationary. That piece
Stationery of paper you write a letter on is stationery.

Summary When the weather is warm and summery and you don't feel
Summery like spending a lot of time reading that long report from the
restructuring committee, just read the summary.
Setup Technical writers sometimes confuse "setup" as a noun
Set Up ("check the setup") with the phrase "set up" ("set up the
experiment").

Troop A group of performers is a troupe. Any other group of


Troupe people, military or otherwise, is a troop

Verses The "vs." in a law case like "Brown vs. The Board of
Versus Education" stands for Latin versus (meaning "against").
Don't confuse it with the word for lines of poetry--"verses"--
when describing other conflicts, like the upcoming football
game featuring Oakesdale versus Pinewood.
Warrantee Confused by the spelling of "guarantee," people often
Warranty misspell the related word "warrantee" rather than the correct
"warranty." "Warrantee" is a rare legal term that means "the
person to whom a warrant is made." Although "guarantee"
can be a verb ("we guarantee your satisfaction"), "warranty"
is not. The rarely used verb form is "to warrant."

Wet Your Appetite It is natural to think that something mouth-watering "wets


Whet Your Appetite your appetite," but actually the expression is "whet your
appetite"-- sharpen your appetite, as a whetstone sharpens a
knife.

NMIT P&T Page 18


Yoke The yellow center of an egg is its yolk. The link that holds
Yolk two oxen together is a yoke; they are yoked.

3.3Ex 1. Tick mark the correct alternative for each of the sentences given
below:
a. Foreboding
1. A contractual agreement _________________ disclosure of b. Forbidding
information as signed with the consultant.

a. Expect
2. Brenda decided to _______________ the challenge of solving the b. Accept
problem c. Except

a. Collaborate
3. The lawyer interviewed family and friends extensively to b. Corroborate
___________ the history given by the defendant.

a. Foreboding
4. Climbing the towering mountain seemed a very ___________ b. Forbidding
task to the group of boy scouts

a. Allusive
5. Despite all our questions about her new job, Tina was very b. Elusive
________________. c. Illusive

a. Criticize
6. Don't _____________ your neighbor until you have walked a b. Critique
mile in his moccasins

a. Emigrated
7. Engineers born and often trained in India have, for years, b. Immigrated
_________ to the U.S. to staff the research and development labs

a. Diffuse
8. Even Sera’s humor did not help ______________ the tensions in b. Defuse
negotiation with the workers

a. Council
9. The village __________________ met each evening near the b. Counsel
temple c. Consul

NMIT P&T Page 19


a. Cited
10. I could not find any of the references you _________________ in b. Sited
your research.

a. Advice
11. I decided to take the statistical course this year despite my guide’s b. Advise
________________ to take it next semester.

a. Compliment
12. In a team, its important that people’ skills ______________ each b. Complement
other

a. Credible
13. It is important that the client sees you as very ___________ b. Credulous

a. Effect
14. It is important to understand how deforestation will b. Affect
_______________ the tribals in this area.

a. Disinterested
15. John seemed rather ______________ in the movie. b. Uninterested

a. Dramatically
16. Most behavioral researcher do believe that any individual’s b. Drastically
beliefs, attitudes and behavior can change rather _____________
irrespective of age

a. appraise
17. My manager’s just back from a vacation, I need to b. apprise
______________ her of all the work the team has done.

a. Depreciate
18. No one ever imagined that the value of real estate would b. Deprecate
___________ to this extent!

a. Disburse
19. Only after the cops had arrived did the crowd ____________ b. Disperse
from the scene.

a. Accedes
20. Only when the expected return meets or ______________the b. Exceeds
required expense is the risk considered worth taking in business

NMIT P&T Page 20


a. Assure
21. Please ___________ that the letter is delivered to Mr. Smith this b. Ensure
evening. c. Insure

a. Continually
22. Problem solving is a recursive process; you must ___________ b. Continuously
go back and forth between steps and do some parts again

a. Adverse
23. Some people have an ___________________ reaction to b. Averse
Penicillin even though it is widely used.

a. Epitaph
24. The ____________________ at the entrance of the monument b. Epigram
said that it was built in 740 A.D. c. Epigraph

a. Consul
25. The current state of software contracting law makes it difficult to b. Council
_____________ clients c. Counsel

a. Forgo
26. We decided to _____________ the play in favor of the game b. Forego

a. adapt
27. When you are working in a new country, it is important to b. adopt
__________ to the new culture

a. Criterion
28. While buying a house, one needs to have several ____________ b. Criteria
in mind

a. Assure
29. You need to ____________the client that we will deliver the b. Ensure
time. c. Insure

a. Devices
30. You will find all the ___________ you need in the tool box. b. Devises

Answers – Exercise 1:

NMIT P&T Page 21


1. B 7. B 13. A 19. B 25. C

2. B 8. B 14. B 20. B 26. A

3. B 9. A 15. B 21. B 27. A

4. B 10. A 16. A 22. A 28. B

5. B 11. A 17. B 23. A 29. A

6. A 12. B 18. A 24. C 30. A

3.3 Ex 2. Tick mark the correct alternative for each of the sentences given
below:

a. Irrelevant
1. Jane went through all the information and eliminated all that b. Impertinent
seemed _______.

a. Ravishing
2. After the five-hour trek through the forest, the women were b. Ravenous
______________

a. Overlook
3. After the industrialist’s death, his wife decided to ____________ b. Oversee
the business

a. Stationery
4. Can you please get some _____________ from the store? b. Stationary

a. Persecuted
5. The poor tenants were _______________ by the landlord despite b. Prosecuted
paying the dues on time

a. Risky
6. For women to be in public without their veils is rather __________ b. Risqué
in this country

a. Repressed
7. For years, the farmers had been ______________ by the village b. Oppressed
landlord

NMIT P&T Page 22


a. Rein
8. Having a pre-decided agenda makes it easier for the meeting leader b. Reign
or facilitator to ______________ in those who go off –track

a. Mantel
9. He placed all the family pictures on the ______________ b. Mantle

a. Peaked
10. Tecrowd outside the gate _____________ my curiosity and I went b. Piqued
to investigate. c. Peeked

a. Libel
11. If you do something wrong, you are ______________to get caught! b. Liable

a. Proceed
12. In any proposal, the executive summary has to _____________ the b. Precede
actual document

a. Principal
13. It is possible in _____________ to prove the correctness of b. Principle
program elements using mathematical techniques.

a. Oversee
14. Make sure you do not _______________ any of the mistakes in the b. Overlook
editing

a. Versus
15. The poem had too many _____________ to memorize. b. Verses

a. Loose
16. Please carry a bag or else you may ______________ those papers b. Lose

a. Prescribed
17. Smoking has been __________________ in a lot of public places b. Proscribed

a. Marital
18. Steve was of the strong opinion that he should not interfere in his b. Martial
friend’s ____________ problems

a. Prospective
19. Susan’s suggestions helped us look at the problem from a different b. Perspective
________________

a. Fortunate
20. The company's profits were enhanced as the result of a b. Fortuitous
_____________drop in the cost of paper.

NMIT P&T Page 23


a. Troupe
21. The _________________ marched on braving the rough weather . b. Troops

a. Premier
22. The agency has still not sent us the passes for the show’s b. Premiere
____________

a. Moral
23. The Christmas bonus sure helped raise the team’s ____________ b. Morale

a. Practice
24. The more you ________________, the better you’ll get the game! b. Practise

a. Wet
25. The soup helped ______________ my appetite b. Whet

a. Warranty
26. There is no reasonably convenient way for shoppers to compare the b. Warrantee
______________ policies and support policies of competing
products.

a. Grizzly
27. The ____________murder of five Dalits in a Haryana village b. Grisly
arising reportedly from police action needs to condemned in the
strongest terms

a. Summery
28. I just finished working on the _____________ of my report b. Summary

a. Installing
29. This school believes in ____________ high level of discipline even b. Instilling
in the younger children

a. Precedence
30. You seem to have set a ___________________ in your team by b. Precedent
coming late everyday!

Answers : Exercise 2

NMIT P&T Page 24


1. A 7. B 13. B 19. B 25. B

2. B 8. A 14. B 20. B 26. A

3. B 9. A 15. B 21. B 27. B

4. A 10. B 16. B 22. B 28. B

5. A 11. B 17. B 23. B 29. B

6. B 12. A 18. A 24. B 30. B

Chapter-4 : Technical Section (C, C++, Java)

4.1 C Aptitude questions

1.
func()
{
static int i = 10;
printf("%d",i);
i++;
}

What is the value of i if the function is called twice ?

2.
func(int *i, int*j)
{*i=*i * *i;
*j=*j* *j;
}

main()
{ int i = 5, j = 2;
func(&i,&j);
printf("%d %d", i, j);}

What is the output?

NMIT P&T Page 25


3.
int a[4]={1,2,3,4};
int *ptr;
ptr=a;
*(a+3)=*(++ptr)+(*ptr++);
A part of code is shown. The elements in A after the execution of this code.

4.
void f(char *p)
{p=(char *) malloc(6);
strcpy(p,"hello");
}

void main( )
{char *P="bye";
f(p);
printf("%s',p);
}

5.
int x(char *a)
{a=(char *) malloc(10*sizeof(char));
*a="hello";
}

main()
{char *a="new";
x(a);
printf("%s",a);
}

6.
intarr[] = {1,2,3,4}
int *ptr=arr;
*(arr+3) = *++ptr + *ptr++;

Final contents of arr[] Ans. {1,2,3,4}

7.
f(char *p)
{

NMIT P&T Page 26


p[0]? f(++p):1;
printf("%c",*p);
}
if call that fuction with f(Aabcd) what is the output??

8.

f(char *p)
{
p=(char *)malloc(sizeof(6));
strcpy(p,"HELLO");
}
main()
{
char *p="BYE";
f(p)
printf("%s",p);
}

9.
f(int n)
{
int c;
while(n)
{
n&=n-1;
c++;
}
print c;
}

10.
In a compiler there is 36 bit for a word and to store a character 8bits are needed. IN this
to store a character two words are appended .Then for storing a K characters string,
How many words are needed.
[a] 2k/9 [b] (2k+8)/9 [c] (k+8)/9 [d] 2*(k+8)/9 [e] none

11.

int zap(int n)
{
if(n<=1)then zap=1;
else zap=zap(n-3)+zap(n-1);
}
then the call zap(6) gives the values of zap

NMIT P&T Page 27


[a] 8 [b] 9 [c] 6 [d] 12 [e] 15

12.

char a =0xAA ;
int b ;
b = (int) a ;
b = b >> 4 ;
printf("%x",b);

13.
struct s1 { struct { struct { int x; } s2 } s3 }y;
How does one access x in the above given structure definition ?

14.
void f(int y)
{
struct s *ptr;
ptr = malloc (sizeof (struct)+99*sizeof(int));
}

struct s{
int i;
float p;
};

when free (ptr) is executed, then what will happen?

15.

#include<stdio.h>
main()
{
char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
}

16.

#include<stdio.h>
main()

NMIT P&T Page 28


{
int i=0;
fork();
printf("%d",i++);
fork();
printf("%d",i++);
fork();
wait();
}

17.
What is the memory allocated by the following definition ?
int (*x)[10];

18.
What is the memory allocated by the following definition ?
int (*x)();

19. In the following program segment

#include<stdio.h>
main()
{
int a=2;
int b=9;
int c=1;
while(b)
{
if(odd(b))
c=c*a;
a=a*a;
b=b/2;
}
printf("%d\n",c);
}

How many times is c=c*a calculated?

20.

typedefenum grade{GOOD,BAD,WORST,}BAD;
main()

NMIT P&T Page 29


{
BAD g1;
g1=1;
printf("%d",g1);
}

21.
#define STYLE1 char
main()
{
typedef char STYLE2;
STYLE1 x;
STYLE2 y;
clrscr();
x=255;
y=255;
printf("%d %d\n",x,y);
}

22.

#ifdef TRUE
int I=0;
#endif

main()
{
int j=0;
printf("%d %d\n",i,j);
}

23. In the following program

#include<stdio.h>
main()
{
char *pDestn,*pSource="I Love You Daddy";
pDestn=malloc(strlen(pSource));
strcpy(pDestn,pSource);
printf("%s",pDestn);
free(pDestn);
}

NMIT P&T Page 30


(a)Free() fails
(b)Strcpy() fails
(c)prints I love You Daddy
(d)error

24.

#include<stdio.h>
main()
{
char a[5][5],flag;
a[0][0]='A';
flag=((a==*a)&&(*a==a[0]));
printf("%d\n",flag);
}

25.

main()
{int i=0;
for(i=0;i<20;i++)
{switch(i)
case 0:i+=5;
case 1:i+=2;
case 5:i+=5;
default i+=4;
break;}
printf("%d,",i);
}
}

a) 0,5,9,13,17
b) 5,9,13,17
c) 12,17,22
d) 16,21
e) Syntax error

26.

main()
{char c=-64;
int i=-32

NMIT P&T Page 31


unsigned int u =-16;
if(c>i)
{printf("pass1,");
if(c<u)
printf("pass2");
else
printf("Fail2");
}
else
printf("Fail1);
if(i<u)
printf("pass2");
else
printf("Fail2")
}

a) Pass1,Pass2
b) Pass1,Fail2
c) Fail1,Pass2
d) Fail1,Fail2
e) None of these

27.

void main()
{
int i;
char a[]="String";
char *p="New Sring";
char *Temp;
Temp=a;
a=malloc(strlen(p) + 1);
strcpy(a,p); //Line number:9//
p = malloc(strlen(Temp) + 1);
strcpy(p,Temp);
printf("(%s, %s)",a,p);
free(p);
free(a);
} //Line number 15//

a) Swap contents of p & a and print:(New string, string)


b) Generate compilation error in line number 8
c) Generate compilation error in line number 5
d) Generate compilation error in line number 7
e) Generate compilation error in line number 1

NMIT P&T Page 32


28.
In the following code segment what will be the result of the function, value of x , value of
y
{unsigned int x=-1;
int y;
y = ~0;
if(x == y)
printf("same");
else
printf("not same");
}

a) same, MAXINT, -1
b) not same, MAXINT, -MAXINT
c) same , MAXUNIT, -1
d) same, MAXUNIT, MAXUNIT
e) not same, MAXINT, MAXUNIT

29.

char *gxxx()
{static char xxx[1024];
return xxx;
}

main()
{char *g="string";
strcpy(gxxx(),g);
g = gxxx();
strcpy(g,"oldstring");
printf("The string is : %s",gxxx());
}

a) The string is : string


b) The string is :Oldstring
c) Run time error/Core dump
d) Syntax error during compilation
e) None of these

30.

void myalloc(char *x, int n)


{x= (char *)malloc(n*sizeof(char));
memset(x,\0,n*sizeof(char));

NMIT P&T Page 33


}

main()
{char *g="String";
myalloc(g,20);
strcpy(g,"Oldstring");
printf("The string is %s",g);
}

a) The string is : String


b) Run time error/Core dump
c) The string is : Oldstring
d) Syntax error during compilation
e) None of these

31.

main()
{char p[]="String";
int x=0;
if(p=="String")
{printf("Pass 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
else
{
printf("Fail 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
}

a) Pass 1, Pass 2
b) Fail 1, Fail 2
c) Pass 1, Fail 2
d) Fail 1, Pass 2
e) syntax error during compilation

32. Which of the choices is true for the mentioned declaration ?

NMIT P&T Page 34


const char *p;
and
char * const p;

a) You can't change the character in both


b) First : You can't change the characterr& Second : You can;t change
the pointer
c) You can't change the pointer in both
d) First : You can't change the pointer & Second : You can't chanage
the character
e) None

33. The redirection operators > and >>

a) do the same function


b) differ : > overwrites, while >> appends
c) differ : > is used for input while >> is used for output
d) differ : > write to any file while >> write only to standard output
e) None of these

34).
enum number { a=-1, b= 4,c,d,e}
what is the value of e ?
7,4,5,15,3

35) Result of the following program is


main()
{
int i=0;
for(i=0;i<20;i++)
{
switch(i)
case 0:i+=5;
case 1:i+=2;
case 5:i+=5;
default i+=4;
break;}
printf("%d,",i);
}
}

NMIT P&T Page 35


a)0,5,9,13,17
b)5,9,13,17
c)12,17,22
d)16,21
e)syntax error

36) What is the result


main()
{
char c=-64;
int i=-32
unsigned int u =-16;
if(c>i){
printf("pass1,");
if(c<u)
printf("pass2");
else
printf("Fail2");}
else
printf("Fail1);
if(i<u)
printf("pass2");
else
printf("Fail2")
}
a)Pass1,Pass2
b)Pass1,Fail2
c)Fail1,Pass2
d)Fail1,Fail2
e)none

37) what will the following program do?


void main()
{
int i;
char a[]="String";
char *p="New Sring";
char *Temp;
Temp=a;
a=malloc(strlen(p) + 1);
strcpy(a,p); //Line no:9//
p = malloc(strlen(Temp) + 1);
strcpy(p,Temp);
printf("(%s, %s)",a,p);

NMIT P&T Page 36


free(p);
free(a);
} //Line no 5//

a) Swap contents of p & a and print:(New string, string)


b) Generate compilation error in line number 8
c) Generate compilation error in line number 5
d) Generate compilation error in line number 7
e) Generate compilation error in line number 1

38) In the following code segment what will be the result of the function,
value of x , value of y

{
unsigned int x=-1;
int y;
y = ~0;
if(x == y)
printf("same");
else
printf("not same");
}

a) same, MAXINT, -1
b) not same, MAXINT, -MAXINT
c) same , MAXUNIT, -1
d) same, MAXUNIT, MAXUNIT
e) not same, MAXINT, MAXUNIT

39.

find(intx,int y)
{ return ((x<y)?0:(x-y)):}
call find(a,find(a,b)) use to find
(a) maximum of a,b
(b) minimum of a,b
(c) positive difference of a,b
(d) sum of a,b

40. integer needs 2bytes , maximum value of an unsigned integer is

(a) { 2 power 16 } -1
(b) {2 power 15}-1
(c) {2 power16}
(d) {2 power 15}

NMIT P&T Page 37


41.y is of integer type then expression 3*(y-8)/9 and (y-8)/9*3 yields same value if

(a)must yields same value


(b)must yields different value
(c)may or may not yields same value
(d) none of the above

42. 5-2-3*5-2 will give 18 if

(a)- is left associative,* has precedence over -


(b) - is right associative,* has precedence over -
(c) - is right associative,- has precedence over *
(d)- is left associative,- has precedence over *

43.
printf("%f", 9/5);
prints
(a) 1.8,
(b) 1.0,
(c) 2.0,
(d) none
.
44.
if (a=7)
printf(" a is 7 ");
else
printf("a is not 7");
prints
(a) a is 7,
(b) a is not 7,
(c) nothing,
(d) garbage.

45.
if (a>b)
if(b>c)
s1;
else s2;
s2 will be executed if
(a) a<= b,
(b) b>c,
(c) b<=c and a<=b,
(d) a>b and b<=c.

NMIT P&T Page 38


46.
main()
{
inc(); ,inc(); , inc();
}
inc()
{ static int x;
printf("%d", ++x);
}
prints
(a) 012,
(b) 123,
(c) 3 consecutive unprectiable numbers
(d) 111.

47.preprocessing is done

(a) either before or at begining of compilation process


(b) after compilation before execution
(c) after loading
(d) none of the above.

48.
printf("%d", sizeof(""));
prints
(a) error
(b)0
(c) garbage
(d) 1.

49.
main()
{
int a=5,b=2;
printf("%d", a+++b);
}

(a) results in syntax,


(b) print 7,
(c) print 8,
(d) none,

50. process by which one bit patten in to another by bit wise operation is

(a) masking,

NMIT P&T Page 39


(b) pruning,
(c) biting,
(d) chopping,

51.value of automatic variable that is declared but not initialized will be

(a) 0,
(b) -1,
(c) unpredictable,
(d) none,

52.
int v=3, *pv=&v;
printf(" %d %d ", v,*pv);
output will be
(a) error
(b) 3 address of v,
(c) 3 3
(d) none.

53.

declaration
enum cities{bethlehem,jericho,nazareth=1,jerusalem}
assian value 1 to
(a) bethlehem
(b) nazareth
(c)bethlehem&nazareth
(d)jericho&nazareth

54.
#include<conio.h>
#include<stdio.h>
void main()
{
char buffer[82]={80};
char *result;
printf( "input line of text, followed by carriage return :\n");
result = cgets(buffer);
printf("text=%s\n",result);
}
(a) printf("length=%d",buffer[1]);
(b) printf("length=%d",buffer[0]);
(c) printf("length=%d",buffer[81]);
(d) printf("length=%d",buffer[2]);

NMIT P&T Page 40


55. consider scanf and sscanf function , which is true

(a) no standard function called sscanf


(b) sscanf(s,...) is equivalent to scanf(...) except that
inputcharecter are taken from string s.
(c) sscanf is equivalent to scanf.
(d) none of above.

56.
#include <stdio.h>
main()
{
char line[80];
scanf("%[^\n]",line);
printf("%s",line);
}
whatscanf do ?
(a) compilation error . illegal format string.
(b) terminates reading input into variable line.
(c) and (d) other two options.

57.
ceil(-2.8) ?
(a) 0
(b) -3.0
(c) -2.0
(d) 2

58.
for( p=head; p!=null; p= p -> next)
free(p);

(a) program run smooth.


(b) compilation error.
(c) run time error.
(d) none of above.

59.
int x[3][4] ={
{1,2,3},
{4,5,6},
{7,8,9}
}
(a) x[2][1] = x[2][2] =x[2][3] = 0

NMIT P&T Page 41


(b) value in fourth column is zero
(c) value in last row is zero
(d) none of above.

60.
main ()
{
printf("%u" , main());
}
(a) print garbage.
(b) execution error
(c) printing of starting address of function main.
(d) infinite loop.

61.

i =5;
i= (++i)/(i++);
printf( "%d" , i);
prints ,
(a) 2
(b) 5
(c) 1
(d) 6

62)
main()
{
clrscr();
}
clrscr();
63)
enum colors {BLACK,BLUE,GREEN}
main()
{
printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);
}
64)
void main()
{
char far *farther,*farthest;
printf("%d..%d",sizeof(farther),sizeof(farthest));

NMIT P&T Page 42


}
65)
main()
{
int i=400,j=300;
printf("%d..%d");
}

66)
main()
{
char *p;
p="Hello";
printf("%c\n",*&*p);
}

67)
main()
{
int i=1;
while (i<=5)
{
printf("%d",i);
if (i>2)
goto here;
i++;
}
}
fun()
{
here:
printf("PP");
}

68)
main()
{
int i=0;
for(;i++;printf("%d",i)) ;
printf("%d",i);
}

69)
#include<stdio.h>
main()

NMIT P&T Page 43


{
char s[]={'a','b','c','\n','c','\0'};
char *p,*str,*str1;
p=&s[3];
str=p;
str1=s;
printf("%d",++*p + ++*str1-32);
}

70)
#include<stdio.h>
main()
{
struct xx
{
int x=3;
char name[]="hello";
};
struct xx *s=malloc(sizeof(struct xx));
printf("%d",s->x);
printf("%s",s->name);
}

71)

#include<stdio.h>
main()
{
struct xx
{
int x;
structyy
{
char s;
struct xx *p;
};
structyy *q;
};
}

72)
main()
{
extern int i;
i=20;

NMIT P&T Page 44


printf("%d",sizeof(i));
}

73)
main()
{
printf("%d", out);
}
int out=100;

74)
main()
{
extern out;
printf("%d", out);
}
int out=100;

75)
main()
{
show();
}
void show()
{
printf("I'm the greatest");
}

76)
main()
{
static char names[5][20]={"pascal","ada","cobol","fortran","perl"};
int i;
char *t;
t=names[3];
names[3]=names[4];
names[4]=t;
for (i=0;i<=4;i++)
printf("%s",names[i]);
}

77)

void main()
{

NMIT P&T Page 45


int i=5;
printf("%d",i++ + ++i);
}

78)
main()
{
char string[]="Hello World";
display(string);
}
void display(char *string)
{
printf("%s",string);
}

79)
main()
{
int c=- -2;
printf("c=%d",c);
}

80)
#define int char
main()
{
int i=65;
printf("sizeof(i)=%d",sizeof(i));
}

81)
main()
{
int i=10;
i=!i>14;
Printf ("i=%d",i);
}

82)
#include<stdio.h>
main()
{
char s[]={'a','b','c','\n','c','\0'};
char *p,*str,*str1;
p=&s[3];

NMIT P&T Page 46


str=p;
str1=s;
printf("%d",++*p + ++*str1-32);
}

83)
#include<stdio.h>
main()
{
int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} };
int *p,*q;
p=&a[2][2][2];
*q=***a;
printf("%d----%d",*p,*q);
}

84)
#include<stdio.h>
main()
{
struct xx
{
int x=3;
char name[]="hello";
};
struct xx *s;
printf("%d",s->x);
printf("%s",s->name);
}

85)
#include<stdio.h>
main()
{
struct xx
{
int x;
structyy
{
char s;
struct xx *p;
};
structyy *q;
};
}

NMIT P&T Page 47


86)
main()
{
printf("\nab");
printf("\bsi");
printf("\rha");
}

87)
main()
{
int i=5;
printf("%d%d%d%d%d%d",i++,i--,++i,--i,i);
}

88)
#define square(x) x*x
main()
{
int i;
i = 64/square(4);
printf("%d",i);
}

89)
main()
{
char *p="hai friends",*p1;
p1=p;
while(*p!='\0') ++*p++;
printf("%s %s",p,p1);
}

90)
#include <stdio.h>
#define a 10
main()
{
#define a 50
printf("%d",a);
}

91)

NMIT P&T Page 48


#define clrscr() 100
main()
{
clrscr();
printf("%d\n",clrscr());
}

92)
main()
{
printf("%p",main);
}

93)
void main()
{
int i=5;
printf("%d",i+++++i);
}

94)
#include<stdio.h>
main()
{
int i=1,j=2;
switch(i)
{
case 1: printf("GOOD");
break;
case j: printf("BAD");
break;
}
}

95)
main()
{
int i;
printf("%d",scanf("%d",&i)); // value 10 is given as input here
}

96)
#define f(g,g2) g##g2
main()
{

NMIT P&T Page 49


int var12=100;
printf("%d",f(var,12));
}

97)
main( )
{
int a[ ] = {10,20,30,40,50},j,*p;
for(j=0; j<5; j++)
{
printf(“%d” ,*a);
a++;
}
p = a;
for(j=0; j<5; j++)
{
printf(“%d ” ,*p);
p++;
}
}

98)
main( )
{
void *vp;
char ch = ‘g’, *cp = “goofy”;
int j = 20;
vp = &ch;
printf(“%c”, *(char *)vp);
vp = &j;
printf(“%d”,*(int *)vp);
vp = cp;
printf(“%s”,(char *)vp + 3);
}

99)
main ( )
{
static char *s[ ] = {“black”, “white”, “yellow”, “violet”};
char **ptr[ ] = {s+3, s+2, s+1, s}, ***p;
p = ptr;
**++p;
printf(“%s”,*--*++p + 3);
}

NMIT P&T Page 50


100)
main()
{
int i, n;
char *x = “girl”;
n = strlen(x);
*x = x[n];
for(i=0; i<n; ++i)
{
printf(“%s\n”,x);
x++;
}
}

101)
void main()
{
intconst * p=5;
printf("%d",++(*p));
}

102)
main()
{
char s[ ]="man";
int i;
for(i=0;s[ i ];i++)
printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]);
}

103)
main()
{
float me = 1.1;
double you = 1.1;
if(me==you)
printf("I love U");
else
printf("I hate U");
}

104)
main()
{

NMIT P&T Page 51


static intvar = 5;
printf("%d ",var--);
if(var)
main();
}

105)
main()
{
int c[ ]={2.8,3.4,4,6.7,5};
int j,*p=c,*q=c;
for(j=0;j<5;j++) {
printf(" %d ",*c);
++q; }
for(j=0;j<5;j++){
printf(" %d ",*p);
++p; }
}

106)
main()
{
extern int i;
i=20;
printf("%d",i);
}

107)
main()
{
int i=-1,j=-1,k=0,l=2,m;
m=i++&&j++&&k++||l++;
printf("%d %d %d %d %d",i,j,k,l,m);
}

108)
main()
{
char *p;
printf("%d %d ",sizeof(*p),sizeof(p));
}

109)
main()
{

NMIT P&T Page 52


int i=3;
switch(i)
{
default:printf("zero");
case 1: printf("one");
break;
case 2:printf("two");
break;
case 3: printf("three");
break;
}
}

110)
main()
{
printf("%x",-1<<4);
}

111)
int i,j;
for(i=0;i<=10;i++)
{
j+=5;
assert(i<5);
}

4.2 Generally asked C programs

1.BUBBLE SORTING

2.INSERTION SORTING

3.SELECTION SORT

4.PROGRAM TO DISPLAY IN FOLLOWING WAY


A2 B3

OUTPUT: AA BBB

5.PROGRAM TO DISPLAY IN FOLLOWING WAY


AABBB

NMIT P&T Page 53


OUTPUT: A2 B3

6. PROGRAM TO ALLOCATE SEATS IN FLIGHT(AIRLINE SYSTEM)

7. PROGRAM TO DISPLAY THE ALPHABETICAL TRIANGLE

/* OUTPUT IS ABCDCBA
ABC CBA
AB BA
A A */

8. BINARY SEARCH

9. DECIMAL TO BINARY

10. FACTORIAL TABLE

11.
THIS PROGRAM FINDS THE LARGEST PALINDROME IN THE GIVEN STRING,
THE LENGTH OF THE LARGEST PALENDROME HAS TO BE >=2;
IF THERE ARE MORE THAN ONE PALENDROMES SATISFYING THE LARGEST
LENGTH CRITERIA
THEN BOTH OF THEM ARE PRINTED

12. TO FIND THE TOTAL NO OF DAYS BETWEEN 2 DATES

13. FRACTION CALCULATOR ( ADDING AND MULTIPLYING)

14. TO INSERT A STRING IN ANOTHER STRING DEPENDING ON POSITION

15. TO CHECK LEAP YEAR

16. MERGING 2 INTEGER ARRAYS

17. NEAREST PRIME NUMBER

18. TO CONVERT NUMBER TO WORDS

NMIT P&T Page 54


19. PASCAL TRIANGLE GIVEN THE NO OF LINES

20. PERFECT NUMBER

21. PIGLATIN

22: PRIME NUMBERS BETWEEN 2 GIVEN NUMBERS

23. PRINT DATE AFTER N DAYS

24. PRINT THE NUMBER AND ITS POSITION

25. REPLACE SPACE BY STAR IF 2 SPACES FOUND

26. REVERSE A STRING

27. TO SORT THE NAMES IN ALPHABETICAL ORDER GIVEN THE NO AND

28. TO REPLACE THE SPACES PROVIDED WITH NUMBER OF SPACES

29. SQUARE ROOT OF A NUMBER

30. STANDARD DEVIATION OF A NUMBER

31. CHANGE THE CASE OF FIRST LETTER

32. TO CHECK THE EXISTENCE OF SUBSTRING IN A STRING

33. SUM OF DIGITS OF A NUMBER

34. TO SWAP FIRST AND SECOND WORDS

35. TOTAL TIME GIVEN THE PERIMETER OF A TRIANGLE

36. QUICK SORTING

37. TO DISPLAY THOSE WORDS AFTER SPACE FOUND

38. PRINT THE LARGEST NUMBER WITH ITS POSITION ENTERED

NMIT P&T Page 55


39. COMPARING PALINDROMES

40. MERGE SORT

41. SALES PROGRAM

42. WRITE A PROGRAM FOR SWAPPING 2 NUMBERS(USING 3 VARIABLES).

43.WRITE A PROGRAM FOR SWAPPING 2 NUMBERS(USING 2 VARIABLES).

44.WRITE A PROGRAM TO FIND WHETHER THE GIVEN IS A PERFECT SQUARE OR


NOT.

45.WRITE A PROGRAM TO FIND WHETHER THE GIVEN NUMBER IS A ARMSTRONG


OR NOT.\

46.WRITE A PROGRAM TO PRINT ALL DIVISORS OF A GIVEN NUMBER.

47.WRITE A PROGRAM TO SOLVE SIMULTANEOUS EQUATIONS USING GAUSS


ELIMINATION.

48. SELECTION OF PLAYERS IN A FOOTBALL TEAM

49. BAKERY PROBLEM( NOVEMBER COMPRE EXAM)

50. DISPLAYING IN THE FOLL. FORMAT


AA
B
AA

(DEPENDING ON NO OF CHARACTERS)

51. AIRLINE RESERVATION SYSTEM

52. MEAN AND STANDARD DEVIATION OF A NUMBER

53.TO FIND THE NCR OF A NUMBER

NMIT P&T Page 56


54. TO FIND THE VALUE OF X TO THE POWER N

55. TO FIND THE AVERAGE OF FIRST N NATURAL NUMBERS USING GAUSS


METHOD

56. TO FIND A NUMBER WHETHER IT'S A PALINDROME

57. TO COUNT THE NO OF DIGITS IN AN INTEGER

58. MULTIPLICATION TABLE

59. ROOTS OF A QUADRATIC EQUATION

60. BINARY TO DECIMAL

61. DECIMAL TO OCTAL

62. OCTAL TO DECIMAL

63. TO PRINT MAGIC SQUARES

64. TO CALCULATE X POWER N

65.TO CALCULATE THE SQUARE OF FIRST N NUMBERS AND TO FIND ITS

66.BINARY SEARCH USING RECURSIVE FUNCTION

67.FIBONACCI SERIES USING RECURSION

68.FIBONACCI SEREIS WITH AN ARRAY

69.TRIBONACCI SERIES

70./*PROGRAM TO REPLACE THE CHARACTER OF THE STRING*/

71./*PROGRAM TO COUNT VOWELS*/

72./*PROGRAM TO CALCULATE THE STRING LENGTH*/

73./*PROGRAM TO COPY A STRING FROM ONE VARIABLE TO ANOTHER*/

NMIT P&T Page 57


74./*TO COMPARE TWO STRINGS*/

75./*PROGRAM TO REVERSE A STRING*/

76./*SORT THE CHARACTERS IN A STRING*/

77./*PROGRAM TO REPLACE THE CHARACTER OF THE STRING*/

78. SECOND LARGEST NUMBER IN AN ARRAY

79.SMALLEST NUMBER AND ITS POSITION IN AN ARRAY

80.TO REMOVE THE DUPLICATE ELEMENTS IN AN ARRAY

81. SUM OF POSITIVE AND NEGATIVE ELEMENTS IN AN ARRAY

82. INSERT AN ELEMENT INTO AN ARRAY OF INTEGERS

83. TO PRINT THE TRANSPOSE OF A MATRIX

84. TO MULTIPLY 2 MATRICES

85.TO FIND THE DIAGONAL OF MATRIX AND TO FIND THE SUM OF DIAGONAL
ELEMENTS

86. TO DISPLAY IN THIS FORMAT


1
121
12321

87. TO ADD FIRST 2 NOS AND DISPLAY IN 3RD POSITION

88. TO CHNAGE THE CASE OF A STRING

89. COUNTING THE NUMBER OF OCCURRENCE OF CHARACTER IN A STRING

90. TO DISPLAY LIKE

NMIT P&T Page 58


I/P: 65
O/P : 6556

91. TO CHECK A TRIANGLE

92. TO PRINT THE TIME IN SEC:MIN:HR

93. TO TRIM EXTRA SPACES IN A STRING

94. DUPLICATE STRING IN AN ARRAY

95. TO DISPLAY THE NUMBER IN WORDS

96. PRINT THE LAST WORD IN A STRING

97. DELETING DUPLICATE WORDS IN A STRING

98. SENTENCE CASE

99.
ACCEPT A STRING OF 'N' CHARACTERS LENGTH. 'N' CAN BE FIXED USING
#DEFINE. REPLACE CHARACTERS IN THE STRING AS FOLLOWS:
VOWELS: A BY 1 , E BY 2 , I BY 3 , O BY 4, U BY 5
ALL CONSONANTS TO BE REPLACED BY 9
ALL OTHER CHARACTERS INCLUDING SPECIAL CHARACTERS TO BE REPLACED
BY 8

100.
CREATE AN ARRAY TO STORE THE EMPLOYEE NUMBERS. CREATE ANOTHER
ARRAY THAT HOLDS THE EMPLOYEE NAMES. WRITE A LOOP TO ACCEPT 'N' EMP
NOS AND NAMES AND STORE THEM IN THE RESPECTIVE ARRAYS.SORT THE
EMPLOYEES BY THEIR NAMES. NOTE: AS THE NAMES ARE SORTED,
ACCORDINGLY THE EMP NOS. TOO SHOULD BE SORTED.

101.

WRITE A FUNCTION THAT ACCEPTS THREE PARAMETERS:


1. AN INTEGER ARRAY
2. AN INTEGER SPECIFYING THE NUMBER OF ELEMENTS IN THE ARRAY
3. AN INTEGER

NMIT P&T Page 59


THE FUNCTION SHOULD RETURN AN INTEGER THAT IS GREATER THAN THE
THIRD PARAMETER PASSED TO THE FUNCTION. IF SUCH AN INTEGER IS NOT
FOUND THEN THE FUNCTION SHOULD RETURN 0 (ZER0).
TEST THE FUNCTION YOU HAVE WRITTEN.

102)

WRITE A FUNCTION THAT TAKES TWO INTEGER PARAMETERS. THE FUNCTION


SHOULD RETURN THE SUM OF ALL THE PRIME NUMBERS IN THE RANGE OF THE
PARAMETERS PASSED. TEST YOUR FUNCTION IN MAIN.

103)

PERFECT NUMBER. A NUMBER IS SAID TO BE A PERFECT NUMBER IF THE SUM OF


ALL ITS FACTORS INCLUDING 1 IS THE NUMBER ITSELF. WRITE A FUNCTION
THAT FINDS THE PERFECT NUMBERS IN THE SPECIFIED RANGE.
EX: 6 IS A PERFECT NUMBER. FACTORS OF 6 ARE 1,2,3 AND 1+2+3 = 6.

104)

ACCEPT AN INTEGER. EXTRACT EVERY DIGIT IN THE INTEGER AND PRINT THEM
IN WORDS IN THE REVERSED ORDER

105)

CREATE A ARRAY THAT STORES THE NAMES OF 5 STUDENTS.


CREATE A 2D ARRAY THAT STORES THE MARKS OF 5 STUDENTS IN 5 DIFFERENT
SUBJECTS. WRITE A FUNCTION THAT FINDS THE TOTAL MARKS OF THE
STUDENTS. ALSO FIND WHICH STUDENT HAS SCORED THE HIGHEST TOTAL.

106)

ACCEPT A SENTENCE AND WRITE FUNCTIONS TO CONVERT THE STRING TO


1. ALL UPPER CASE
2. ALL LOWER CASE
3. SENTENCE CASE
4. TITLE CASE
5. TOGGLE CASE

NMIT P&T Page 60


107)
CREATE TWO INTEGER ARRAYS. MERGE THE ELEMENTS OF BOTH THE ARRAYS
INTO THE THIRD ARRAY AS GIVEN IN THE EXAMPLE BELOW:
EX: ARRAY1 = { 0,1,2,3,4 }
ARRAY2 = { 5,6,7,8,9 }
RESULTANT ARRAY = { 0,5,1,6,2,7,3,8,4,9}

108.
TO COUNT THE NO OF VOWELS,CONSONANTS,DIGITS,WORDS AND SPECIAL
CHARACTERS

109. TO COUNT THE NO OF SPACES IN A GIVEN TEXT

110. TO DISPLAY IN THIS FORMAT


EG: RAMBA

O/P: QZLAZ

(A REPLACED BY Z,B REPLACED BY A ETC)

111.TO DELETE A STRING IN A STRING

112. TO PRINT THE ABBREVIATION OF THE GIVEN TEXT

113. TO EXTRACT THE MIDDLE WORD OF ANY STRING

EG: GOOD MORNING INDIA

O/P: MORNING

114.TO DISPLAY VARIOUS COMBINATIONS OF THE CHARACTERS IN GIVEN


STRING

115. TO SORT A SINGLE INTEGER

116. SHELL SORTING

117. TO CALCULATE SIN(X)

NMIT P&T Page 61


118. TO CALCULATE COS(X)=1-X^2/2!+X^4/4!-.........

119. TO CALCULATE E^X=(1+X+X^2/2!+X^4/4!+........)


SIN(X)=X-X^3/3! + X^5/5!-......

120.GENERATION OF PRIME NUMBERS

121. QUICK SORTING

122. LINEAR SEARCH(SEQUENTIAL SEARCH)

123. GENERATION OF ARMSTRONG NUMBERS

124. GENERATION OF FIBONACCI SERIES

125. GENERATION OF TRIBONACCI SERIES

126. TO DELETE A STRING

127. TO DISPLAY IN THE FOLLOWING FORMAT

$$$$
$ $
$ $
$$$$

128. TO PRINT THE STRING LIKE


COUNTRY
OUNTR
UNT
N

129. TO FIND ALL THE SUNDAYS IN A YEAR

NMIT P&T Page 62


130. TO GENERATE NUMBERS AS
1
22
333

131. TO GENERATE NUMBERS AS


1
12
123
1234

132. 1
23
456
7 8 9 10

133. 1

1 1
1 2 1
1 3 3 1

134. 1
232
34543
4567654

135. 3 2 1 0 1 2 3

136. 1
252
36963
4 7 10 13 10 7 4

137. 1

NMIT P&T Page 63


11
111
1111

138. 1
21
321
4321

139. 1 0 0 0
0200
0030
0004

140. * * * *
****
****
****

141. SORTING OF STRINGS

142. SORTING OF CHARACTERS IN A STRING

143. TO CHECK IF IDENTITY MATRIX

144.LONGEST WORD IN A SENTENCE

145. THE LEAP YEARS BETWEEN TWO GIVEN YEARS

146. TO PRINT THE LEVELS OF THE EMPLOYEES

147.LIBRARY DUE DATE

148.TO PRINT THE UNIQUE SIDES

149.COMMON STRING FUNCTIONS


//SOME COMMON STRING FUNCTIONS

NMIT P&T Page 64


INT IFINDSTRLEN(CHAR []);
INT IFINDSTRINGCASEWHOLE(CHAR [],CHAR [],INT,INT,INT);
INT IFINDSTRING(CHAR [],CHAR [],INT);
VOID DELSTRPART(CHAR [],INT,INT);
VOID ADDSTRPART(CHAR [],INT,CHAR []);
CHAR CTOLOWER(CHAR);
VOID DELEXTRASPACES(CHAR []);
VOID COPYSTR(CHAR [],CHAR [],INT,INT);
INT ICOMPARESTRING(CHAR [],CHAR []);

150. TO FIND AND REPLACE A STRING IN A STRING

151.ENCRYPTION OF WORDS

152. COUNTING NO OF WORDS IN A SENTENCE

153. GCD AND LCM

154. MENU CALCULATOR

155. /*WRITE A FUNCTION THAT TAKES TWO INTEGER PARAMETERS.


THE FUNCTION SHOULD RETURN THE SUM OF ALL THE PRIME NUMBERS
IN THE RANGE OF THE PARAMETERS PASSED. TEST YOUR FUNCTION IN MAIN.*/

156. LOWER PRIME

157. PRIME FACTOR

158.
/*WRITE A FUNCTION FINDNTHMIN IN C THAT USES THE FUNCTION FINDMIN TO
FIND THE NTH SMALLEST NUMBER IN AN ARRAY.
THE PROTOTYPE OF THE FUNCTIONS ARE GIVEN BELOW
INT FINDNTHMIN (INT A[], INT N)
EXAMPLE: A[4] = { 15 , 12 , 20 , 10 }
FINDNTHMIN(A,2) WILL RETURN THE SECOND SMALLEST ELEMENT IN THE
ARRAY A WHICH IS 12
INT FINDMIN (INT A[], INT MIN) - A FUNCTION THAT FINDS THE MINIMUM
NUMBER IN AN ARRAY

NMIT P&T Page 65


GREATER THAN OR EQUAL TO MIN AND RETURNS IT.
EXAMPLE: A[4] = { 15 , 12 , 20 , 10 }
FINDMIN (A, 10) SHOULD RETURN 10
FINDMIN (A, 19) SHOULD RETURN 20
NOTE: ASSUME THAT THE SMALLEST INTEGER THAT CAN BE STORED IN AN INT
VARIABLE IS -32767.*/

159.
*ACCEPT THREE INTEGERS THAT REPRESENT THE DATE.
VALIDATE THE DATE AND PRINT THE DATE IN THE FOLL. FORMAT:
MONTH DATE, YEAR
EX: 22/7/2003 ----> JULY 21, 2003*/

160

//CREATE AN ARRAY TO STORE THE EMPLOYEE NUMBERS. CREATE ANOTHER


ARRAY THAT HOLDS
//THE EMPLOYEE NAMES. WRITE A LOOP TO ACCEPT 'N' EMP NOS AND NAMES
AND STORE
//THEM IN THE RESPECTIVE ARRAYS.SORT THE EMPLOYEES BY THEIR NAMES.
//NOTE: AS THE NAMES ARE SORTED, ACCORDINGLY THE EMP NOS. TOO SHOULD
BE SORTED.

161. WRITE A FUNCTION THAT ACCEPTS THREE PARAMETERS:


1. AN INTEGER ARRAY
2. AN INTEGER SPECIFYING THE NUMBER OF ELEMENTS IN THE ARRAY
3. AN INTEGER
THE FUNCTION SHOULD RETURN AN INTEGER THAT IS GREATER THAN THE
THIRD PARAMETER PASSED TO THE FUNCTION. IF SUCH AN INTEGER IS NOT
FOUND THEN THE FUNCTION SHOULD RETURN 0 (ZER0).
TEST THE FUNCTION YOU HAVE WRITTEN. */

162.
//REPLACE THE SUBSTRING

163. REPLACE A NEW STRING

NMIT P&T Page 66


164. REGULATING PACE

165. RANDOM NUMBER GENERATION

166. TO PRINT A PYRAMID OF '*'

167. PRINT CHAR BY NUMBER

168. COUNTING NO OF WORDS IN A STRING

169. COUNTING NO OF TIMES SUBSTRING OCCUR IN A STRING

170./*
SQUARE OF 12 IS 144.21 WHICH IA A REVERSE OF 12 HAS A SQUARE 441.
PROGRAM TO FIND ANY SUCH PAIRS B/N 10 AND 100

171. MATRIX MAGIC

172. VALIDATION OF A GIVEN DATE

173. ROTATE A STRING

NMIT P&T Page 67


4.3 C/C++ Interview Questions

1. What is the output of printf("%d")


2. Difference between "C structure" and "C++ structure".
3. Difference between a "assignment operator" and a "copy constructor"
4. What is the difference between "overloading" and "overriding"?
5. Explain the need for "Virtual Destructor".
6. Can we have "Virtual Constructors"?
7. What are the different types of polymorphism?
8. What are Virtual Functions? How to implement virtual functions in "C"
9. What are the different types of Storage classes?
10. What is Namespace?
11. What are the types of STL containers?.
12. Difference between "vector" and "array"?
13. How to write a program such that it will delete itself after execution?
14. Can we generate a C++ source code from the binary file?
15. What are inline functions?
16. Talk something about profiling?
17. How many lines of code you have written for a single program?
18. What is "strstream" ?
19. How to write Multithreaded applications using C++?
20. Explain "passing by value", "passing by pointer" and "passing by reference"
21. Write any small program that will compile in "C" but not in "C++"
22. Have you heard of "mutable" keyword?
23. What is a "RTTI"?
24. Is there something that I can do in C and not in C++?
25. Why preincrement operator is faster than postincrement?
26. What is the difference between "calloc" and "malloc"?
27. What will happen if I allocate memory using "new" and free it using "free" or
allocate sing "calloc" and free it using "delete"?
28. What is Memory Alignment?

NMIT P&T Page 68


29. Explain working of printf.
30. Difference between "printf" and "sprintf".
31. What is "map" in STL?
32. When shall I use Multiple Inheritance?
33. What are the techniques you use for debugging?
34. How to reduce a final size of executable?
35. Give 2 examples of a code optimization.

1. What is virtual constructors/destructors?


Virtual destructors: If an object (with a non-virtual destructor) is destroyed explicitly by
applying
the delete operator to a base-class pointer to the object, the base-class destructor function
(matching the pointer type) is called on the object.
There is a simple solution to this problem – declare a virtual base-class destructor. This makes all
derived-class destructors virtual even though they don’t have the same name as the base-class
destructor. Now, if the object in the hierarchy is destroyed explicitly by applying the delete
operator
to a base-class pointer to a derived-class object, the destructor for the appropriate class is called.
Virtual constructor: Constructors cannot be virtual. Declaring a constructor as a virtual function
isa syntax error. Does c++ support multilevel and multiple inheritance?
Yes.
What are the advantages of inheritance?
• It permits code reusability.
• Reusability saves time in program development.
• It encourages the reuse of proven and debugged high-quality software, thus reducing problem
after a system becomes functional.
What is the difference between declaration and definition?
The declaration tells the compiler that at some later point we plan to present the definition of this
declaration.
E.g.: void stars () //function declaration
NMIT P&T Page 69
The definition contains the actual implementation.
E.g.: void stars () // declarator
{
for(int j=10; j>=0; j--) //function body
cout<<”*”;
cout<<endl;
}
2. What do you mean by pure virtual functions?
A pure virtual member function is a member function that the base class forces derived classes to
provide. Normally these member functions have no implementation. Pure virtual functions are
equated to zero.
class Shape { public: virtual void draw() = 0; };
3. What is namespace?
Namespaces allow us to group a set of global classes, objects and/or functions under a name. To
sayit somehow, they serve to split the global scope in sub-scopes knownas namespaces.The form
to use namespaces is:namespace identifier { namespace-body }
Where identifier is any valid identifier and namespace-body is the set of classes, objects and
functions that are included within the namespace. For example:
namespace general { int a, b; } In this case, a and b are normal variables integrated within the
generalnamespace. In order to access to these variables from outside the namespace we have to
use the scope operator ::. For example, to access the previous variables we would have to put:
general::a general::b
The functionality of namespaces is specially useful in case that there is a possibility that a global
object or function can have the same name than another one, causing aredefinition error.
4. What is RTTI?
Runtime type identification (RTTI) lets you find the dynamic type of an object when you have
only apointer or a reference to the base type. RTTI is the official way instandard C++ to discover
the type of an object and to convert the type of a pointer or reference
(that is, dynamic typing). The need came from practical experience withC++. RTTI replaces
many homegrown versions with a solid, consistent approach.

NMIT P&T Page 70


5. What is a template?
Templates allow to create generic functions that admit any data type as parameters and return
valuewithout having to overload the function with all the possible data types. Until certain point
they fulfillthe functionality of a macro. Its prototype is any of the two following ones:
template <class indetifier>function_declaration; template <typenameindetifier>
function_declaration;
The only difference between both prototypes is the use of keyword class or typename, its use is
indistinct since both expressions have exactly the same meaning and behave exactly the same
way.
6. What do you mean by inline function?
The idea behind inline functions is to insert the code of a called function at the point where the
function is called. If done carefully, this can improve the application'sperformance in exchange
for increased compile time and possibly (but not always) an increase in thesize of the generated
binary executables.
7. What is virtual class and friend class?
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 worldshouldn't be allowed to have. In
other words, they help keep private things private. For instance, itmay be desirable for class
DatabaseCursor to have more privilege to the internals of class Databasethan main() has.
8. What is function overloading and operator overloading?
Function overloading: C++ enables several functions of the same name to be defined, as long as
these functions have different sets of parameters (at least as far as their types are concerned).
Thiscapability is called function overloading. When an overloaded function is called, the C++
compilerselects the proper function by examining the number, types and order of the arguments
in the call.Function overloading is commonly used to create several functions of the same name
that performsimilar tasks but on different data types.
Operator overloading allows existing C++ operators to be redefined so that they work on objects
of user-defined classes. Overloaded operators are syntactic sugar forequivalent function calls.
They form a pleasant facade that doesn't add anything fundamental to thelanguage (but they can
improve understandability and reducemaintenance costs).

NMIT P&T Page 71


9. Difference between realloc() and free()?
The free subroutine frees a block of memory previously allocated by the malloc subroutine.
Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is
anull value, no action will occur. The realloc subroutine changes the size of the block of memory
pointed to by the Pointer parameter to the number of bytes specified by the Size parameter and
returns a new pointer to the block. The pointer specified by the Pointer parameter must have
beencreated with the malloc, calloc, or realloc subroutines and not been deallocated with the free
orrealloc subroutines. Undefined results occur if the Pointer parameter is not a valid pointer
10. What do you mean by binding of data and functions?
Encapsulation.
11. What is abstraction?
Abstraction is of the process of hiding unwanted details from the user.
12. What is encapsulation?
Packaging an object’s variables within its methods is called encapsulation.
13. What is the difference between an object and a class?
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
ofa 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
rightup 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.
14. What is polymorphism? Explain with an example?
"Poly" means "many" and "morph" means "form". Polymorphism is the ability of an object (or
reference) to assume (be replaced by) or become many different forms of
object.
Example: function overloading, function overriding, virtual functions. Another example can be a
plus‘+’ sign, used for adding two integers or for using it to concatenate two strings.

NMIT P&T Page 72


15. What do you mean by inheritance?
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.
16. What is a scope resolution operator?
A scope resolution operator (::), can be used to define the member functions of a class outside
theclass.
17. What are virtual functions?
A virtual function allows derived classes to replace the implementation provided by the base
class.The compiler makes sure the replacement is always called wheneverthe object in question
is actually of the derived class, even if the object is accessed by a base pointerrather than a
derived pointer. This allows algorithms in the base class to be replaced in the derivedclass, even
if users don't know about the derived class.
18. What is friend function?
As the name suggests, the function acts as a friend to a class. As a friend of a class, it can access
itsprivate and protected members. A friend function is not a member ofthe class. But it must be
listed in the class definition.
19. What is the difference between class and structure?
Structure: Initially (in C) a structure was used to bundle different type of data types together to
perform a particular functionality. But C++ extended the structure to contain functions also. The
major difference is that all declarations inside a structure are by default public.
Class: Class is a successor of Structure. By default all the members inside the class are private.
20. What is public, protected, private?
Ø Public, protected and private are three access specifiers in C++.
Ø Public data members and member functions are accessible outside the class.
Ø Protected data members and member functions are only available to derived classes.
Ø Private data members and member functions can’t be accessed outside the class.
However there is an exception can be using friend classes.
21. What is an object?
Object is a software bundle of variables and related methods. Objects have state and behavior.

NMIT P&T Page 73


22. What is a class?
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.

4.4 Core Java Interview Questions (198 Questions with Answers)


1. what is a transient variable?
A transient variable is a variable that may not be serialized.
2.which containers use a border Layout as their default layout?
The window, Frame and Dialog classes use a border layout as their default layout.
3.Why do threads block on I/O?
Threads block on i/o (that is enters the waiting state) so that other threads may execute
while the i/oOperation is performed.
4. How are Observer and Observable used?
Objects that subclass the Observable class maintain a list of observers. When anObservable
object isupdated it invokes the update() method of each of its observers to notify the observers
that it has changedstate. The Observer interface is implemented by objects that observe
Observable objects.
5. What is synchronization and why is it important?
With respect to multithreading, synchronization is the capability to control the access of
multiple threads toshared resources. Without synchronization, it is possible for one thread to
modify ashared object whileanother thread is in the process of using or updating that object's
value. This often leadsto significanterrors.
6. Can a lock be acquired on a class?
Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object.
7. What's new with the stop(), suspend() and resume() methods in JDK 1.2?
The stop(), suspend() and resume() methods have been deprecated in JDK 1.2.
8. Is null a keyword?
The null value is not a keyword.
9. What is the preferred size of a component?
NMIT P&T Page 74
The preferred size of a component is the minimum component size that will allow the
component to displaynormally.
10. What method is used to specify a container's layout?
The setLayout() method is used to specify a container's layout.
11. Which containers use a FlowLayout as their default layout?
The Panel and Applet classes use the FlowLayout as their default layout.
12. What state does a thread enter when it terminates its processing?
When a thread terminates its processing, it enters the dead state.
13. What is the Collections API?
The Collections API is a set of classes and interfaces that support operations on
collections of objects.
14. Which characters may be used as the second character of an identifier, but not
as the firstcharacter of an identifier?
The digits 0 through 9 may not be used as the first character of an identifier but they may
be used after thefirst character of an identifier.
15. What is the List interface?
The List interface provides support for ordered collections of objects.
16. How does Java handle integer overflows and underflows?
It uses those low order bytes of the result that can fit into the size of the type allowed by
the operation.
17. What is the Vector class?
The Vector class provides the capability to implement a growable array of objects
18. What modifiers may be used with an inner class that is a member of an outer
class?
A (non-local) inner class may be declared as public, protected, private, static, final, or
abstract.
19. What is an Iterator interface?
The Iterator interface is used to step through the elements of a Collection.
20. What is the difference between the >> and >>> operators?
The >> operator carries the sign bit when shifting right. The >>> zero-fills bits that have

NMIT P&T Page 75


been shifted out.
21. Which method of the Component class is used to set the position and size of a
component?
setBounds()
22. How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8
characters?
Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses
only 7 bits, it isusually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit
patterns.UTF-16 uses 16-bit and larger bit patterns.
23. What is the difference between yielding and sleeping?
When a task invokes its yield() method, it returns to the ready state. When a task invokes
its sleep()method, it returns to the waiting state.
24. Which java.util classes and interfaces support event handling?
The EventObject class and the EventListener interface support event processing.
25. Is sizeof a keyword?
The sizeof operator is not a keyword.
26. What are wrapped classes?
Wrapped classes are classes that allow primitive types to be accessed as objects.
27. Does garbage collection guarantee that a program will not run out of memory?
Garbage collection does not guarantee that a program will not run out of memory. It is
possible forprograms to use up memory resources faster than they are garbage collected. It is
alsopossible forprograms to create objects that are not subject to garbage collection
28. What restrictions are placed on the location of a package statement within a
source code file?
A package statement must appear as the first line in a source code file (excluding blank
lines andcomments).
29. Can an object's finalize() method be invoked while it is reachable?
An object's finalize() method cannot be invoked by the garbage collector while the object
is still reachable.However, an object's finalize() method may be invoked by other objects.
30. What is the immediate superclass of the Applet class?

NMIT P&T Page 76


Panel
31. What is the difference between preemptive scheduling and time slicing?
Under preemptive scheduling, the highest priority task executes until it enters the waiting
or dead states ora higher priority task comes into existence. Under time slicing, a task executes
for apredefined slice oftime and then reenters the pool of ready tasks. The scheduler then
determines which taskshould executenext, based on priority and other factors.
32. Name three Component subclasses that support painting.
The Canvas, Frame, Panel, and Applet classes support painting.
33. What value does readLine() return when it has reached the end of a file?
The readLine() method returns null when it has reached the end of a file.
34. What is the immediate superclass of the Dialog class?
Window
35. What is clipping?
Clipping is the process of confining paint operations to a limited area or shape.
36. What is a native method?
A native method is a method that is implemented in a language other than Java.
37. Can a for statement loop indefinitely?
Yes, a for statement can loop indefinitely. For example, consider the following:
for(;;) ;
38. What are order of precedence and associativity, and how are they used?
Order of precedence determines the order in which operators are evaluated inexpressions.
Associatitydetermines whether an expression is evaluated left-to-right or right-to-left
39. When a thread blocks on I/O, what state does it enter?
A thread enters the waiting state when it blocks on I/O.
40. To what value is a variable of the String type automatically initialized?
The default value of an String type is null.
41. What is the catch or declare rule for method declarations?
If a checked exception may be thrown within the body of a method, the method must
either catch theexception or declare it in its throws clause.
42. What is the difference between a MenuItem and a CheckboxMenuItem?

NMIT P&T Page 77


The CheckboxMenuItem class extends the MenuItem class to support a menu item that
may be checked orunchecked.
43. What is a task's priority and how is it used in scheduling?
A task's priority is an integer value that identifies the relative order in which it should be
executed withrespect to other tasks. The scheduler attempts to schedule higher priority tasks
beforelower priority tasks.
44. What class is the top of the AWT event hierarchy?
The java.awt.AWTEvent class is the highest-level class in the AWT event-classhierarchy.
45. When a thread is created and started, what is its initial state?
A thread is in the ready state after it has been created and started.
46. Can an anonymous class be declared as implementing an interface andextending a class?
An anonymous class may implement an interface or extend a superclass, but may not be
declared to doboth.
47. What is the range of the short type?
The range of the short type is -(2^15) to 2^15 - 1.
48. What is the range of the char type?
The range of the char type is 0 to 2^16 - 1.
49. In which package are most of the AWT events that support the event-delegation
model defined?
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.
50. What is the immediate superclass of Menu?
MenuItem
51. What is the purpose of finalization?
The purpose of finalization is to give an unreachable object the opportunity to perform
any cleanupprocessing before the object is garbage collected.
52. Which class is the immediate superclass of the MenuComponentclass.
Object
53. What invokes a thread's run() method?
After a thread is started, via its start() method or that of the Thread class, the JVM

NMIT P&T Page 78


invokes the thread'srun() method when the thread is initially executed.
54. What is the difference between the Boolean & operator and the && operator?
If an expression involving the Boolean & operator is evaluated, both operands are
evaluated. Then the &operator is applied to the operand. When an expression involving the &&
operator isevaluated, the firstoperand is evaluated. If the first operand returns a value of true then
the second operandis evaluated. The&& operator is then applied to the first and second operands.
If the first operandevaluates to false, theevaluation of the second operand is skipped.
55. Name three subclasses of the Component class.
Box.Filler, Button, Canvas, Checkbox, Choice, Container, Label, List, Scrollbar,
orTextComponent
56. What is the GregorianCalendar class?
The GregorianCalendar provides support for traditional Western calendars.
57. Which Container method is used to cause a container to be laid out andredisplayed?
validate()
58. What is the purpose of the Runtime class?
The purpose of the Runtime class is to provide access to the Java runtime system.
59. How many times may an object's finalize() method be invoked by the garbagecollector?
An object's finalize() method may only be invoked once by the garbage collector.
60. What is the purpose of the finally clause of a try-catch-finally statement?
The finally clause is used to provide the capability to execute code no matter whether or
not an exception isthrown or caught.
61. What is the argument type of a program's main() method?
A program's main() method takes an argument of the String[] type.
62. Which Java operator is right associative?
The = operator is right associative.
63. What is the Locale class?
The Locale class is used to tailor program output to the conventions of a particular
geographic, political, orcultural region.
64. Can a double value be cast to a byte?
Yes, a double value can be cast to a byte.

NMIT P&T Page 79


65. What is the difference between a break statement and a continue statement?
A break statement results in the termination of the statement to which it applies (switch,
for, do, or while).A continue statement is used to end the current loop iteration and return control
to theloop statement.
66. What must a class do to implement an interface?
It must provide all of the methods in the interface and identify the interface in its
implements clause.
67. What method is invoked to cause an object to begin executing as a separatethread?
The start() method of the Thread class is invoked to cause an object to begin executing as
a separate thread.
68. Name two subclasses of the TextComponent class.
TextField and TextArea
69. What is the advantage of the event-delegation model over the earlier eventinheritance
model?
The event-delegation model has two advantages over the event-inheritance model. First,
it enables eventhandling to be handled by objects other than the ones that generate the events (or
theircontainers). Thisallows a clean separation between a component's design and its use. The
other advantageof the eventdelegationmodel is that it performs much better in applications where
many events aregenerated. Thisperformance improvement is due to the fact that the event-
delegation model does nothave to repeatedlyprocess unhandled events, as is the case of the
event-inheritance model.
70. Which containers may have a MenuBar?
Frame
71. How are commas used in the initialization and iteration parts of a for statement?
Commas are used to separate multiple statements within the initialization and iteration
parts of a forstatement.
72. What is the purpose of the wait(), notify(), and notifyAll() methods?
The wait(),notify(), and notifyAll() methods are used to provide an efficient way for

NMIT P&T Page 80


threads to wait for ashared resource. When a thread executes an object's wait() method, it enters
the waitingstate. It only entersthe ready state after another thread invokes the object's notify() or
notifyAll() methods.
73. What is an abstract method?
An abstract method is a method whose implementation is deferred to a subclass.
74. How are Java source code files named?
A Java source code file takes the name of a public class or interface that is defined within
the file. A sourcecode file may contain at most one public class or interface. If a public class or
interface isdefined within asource code file, then the source code file must take the name of the
public class orinterface. If no publicclass or interface is defined within a source code file, then
the file must take on a namethat is different thanits classes and interfaces. Source code files use
the .java extension.
75. What is the relationship between the Canvas class and the Graphics class?
A Canvas object provides access to a Graphics object via its paint() method.
76. What are the high-level thread states?
The high-level thread states are ready, running, waiting, and dead.
77. What value does read() return when it has reached the end of a file?
The read() method returns -1 when it has reached the end of a file.
78. Can a Byte object be cast to a double value?
No, an object cannot be cast to a primitive value.
79. What is the difference between a static and a non-static inner class?
A non-static inner class may have object instances that are associated with instances of
the class's outerclass. A static inner class does not have any object instances.
80. What is the difference between the String and StringBuffer classes?
String objects are constants. StringBuffer objects are not.
81. If a variable is declared as private, where may the variable be accessed?
A private variable may only be accessed within the class in which it is declared.
82. What is an object's lock and which object's have locks?
An object's lock is a mechanism that is used by multiple threads to obtain synchronized

NMIT P&T Page 81


access to the object.A thread may execute a synchronized method of an object only after it has
acquired theobject's lock. Allobjects and classes have locks. A class's lock is acquired on the
class's Class object.
83. What is the Dictionary class?
The Dictionary class provides the capability to store key-value pairs.
84. How are the elements of a BorderLayout organized?
The elements of a BorderLayout are organized at the borders (North, South, East, and
West) and the centerof a container.
85. What is the % operator?
It is referred to as the modulo or remainder operator. It returns the remainder of dividing
the first operandby the second operand.
86. When can an object reference be cast to an interface reference?
An object reference be cast to an interface reference when the object implements thereferenced
interface.
87. What is the difference between a Window and a Frame?
The Frame class extends Window to define a main application window that can have amenu bar.
88. Which class is extended by all other classes?
The Object class is extended by all other classes.
89. Can an object be garbage collected while it is still reachable?
A reachable object cannot be garbage collected. Only unreachable objects may begarbage
collected..
90. Is the ternary operator written x : y ? z or x ? y : z ?
It is written x ?y : z.
91. What is the difference between the Font and FontMetrics classes?
The FontMetrics class is used to define implementation-specific properties, such asascent and
descent, of aFont object.
92. How is rounding performed under integer division?
The fractional part of the result is truncated. This is known as rounding toward zero.
93. What happens when a thread cannot acquire a lock on an object?
If a thread attempts to execute a synchronized method or synchronized statement and is

NMIT P&T Page 82


unable to acquirean object's lock, it enters the waiting state until the lock becomes available.
94. What is the difference between the Reader/Writer class hierarchy and the
InputStream/OutputStream class hierarchy?
The Reader/Writer class hierarchy is character-oriented, and theInputStream/OutputStream class
hierarchyis byte-oriented.
95. What classes of exceptions may be caught by a catch clause?
A catch clause can catch any exception that may be assigned to the Throwable type. This
includes the Errorand Exception types.
96. If a class is declared without any access modifiers, where may the class beaccessed?
A class that is declared without any access modifiers is said to have package access. This
means that theclass can only be accessed by other classes and interfaces that are defined within
thesame package.
97. What is the SimpleTimeZone class?
The SimpleTimeZone class provides support for a Gregorian calendar.
98. What is the Map interface?
The Map interface replaces the JDK 1.1 Dictionary class and is used associate keys withvalues.
99. Does a class inherit the constructors of its superclass?
A class does not inherit constructors from any of its superclasses.
100. For which statements does it make sense to use a label?
The only statements for which it makes sense to use a label are those statements that canenclose
a break orcontinue statement.
101. What is the purpose of the System class?
The purpose of the System class is to provide access to system resources.
102. Which TextComponent method is used to set a TextComponent to the readonlystate?
setEditable()
103. How are the elements of a CardLayout organized?
The elements of a CardLayout are stacked, one on top of the other, like a deck of cards.
104. Is &&= a valid Java operator?
No, it is not.
105. Name the eight primitive Java types.

NMIT P&T Page 83


The eight primitive types are byte, char, short, int, long, float, double, and boolean.
106. Which class should you use to obtain design information about an object?
The Class class is used to obtain information about an object's design.
107. What is the relationship between clipping and repainting?
When a window is repainted by the AWT painting thread, it sets the clipping regions to
the area of thewindow that requires repainting.
108. Is "abc" a primitive value?
The String literal "abc" is not a primitive value. It is a String object.
109. What is the relationship between an event-listener interface and an eventadapterclass?
An event-listener interface defines the methods that must be implemented by an event
handler for aparticular kind of event. An event adapter provides a default implementation of an
eventlistenerinterface.
110. What restrictions are placed on the values of each case of a switch statement?
During compilation, the values of each case of a switch statement must evaluate to avalue that
can bepromoted to an int value.
111. What modifiers may be used with an interface declaration?
An interface may be declared as public or abstract.
112. Is a class a subclass of itself?
A class is a subclass of itself.
113. What is the highest-level event class of the event-delegation model?
The java.util.EventObject class is the highest-level class in the event-delegation classhierarchy.
114. What event results from the clicking of a button?
The ActionEvent event is generated as the result of the clicking of a button.
115. How can a GUI component handle its own events?
A component can handle its own events by implementing the required event-listenerinterface and
addingitself as its own event listener.
116. What is the difference between a while statement and a do statement?
A while statement checks at the beginning of a loop to see whether the next loop iteration
should occur. Ado statement checks at the end of a loop to see whether the next iteration of a
loop shouldoccur. The dostatement will always execute the body of a loop at least once.

NMIT P&T Page 84


117. How are the elements of a GridBagLayout organized?
The elements of a GridBagLayout are organized according to a grid. However, theelements are
of differentsizes and may occupy more than one row or column of the grid. In addition, the rows
andcolumns mayhave different sizes.
118. What advantage do Java's layout managers provide over traditional windowingsystems?
Java uses layout managers to lay out components in a consistent manner across all
windowing platforms.Since Java's layout managers aren't tied to absolute sizing and positioning,
they are ableto accommodate platform-specific differences among windowing systems.
119. What is the Collection interface?
The Collection interface provides support for the implementation of a mathematical bag -
an unorderedcollection of objects that may contain duplicates.
120. What modifiers can be used with a local inner class?
A local inner class may be final or abstract.
121. What is the difference between static and non-static variables?
A static variable is associated with the class as a whole rather than with specific instances
of a class. Nonstaticvariables take on unique values with each object instance.
122. What is the difference between the paint() and repaint() methods?
The paint() method supports painting via a Graphics object. The repaint() method is used
to cause paint() tobe invoked by the AWT painting thread.
123. What is the purpose of the File class?
The File class is used to create objects that provide access to the files and directories of alocal
file system.
124. Can an exception be rethrown?
Yes, an exception can be rethrown.
125. Which Math method is used to calculate the absolute value of a number?
The abs() method is used to calculate absolute values.
126. How does multithreading take place on a computer with a single CPU?
The operating system's task scheduler allocates execution time to multiple tasks. Byquickly
switchingbetween executing tasks, it creates the impression that tasks execute sequentially.
127. When does the compiler supply a default constructor for a class?

NMIT P&T Page 85


The compiler supplies a default constructor for a class if no other constructors areprovided.
128. When is the finally clause of a try-catch-finally statement executed?
The finally clause of the try-catch-finally statement is always executed unless the thread
of executionterminates or an exception occurs within the execution of the finally clause.
129. Which class is the immediate superclass of the Container class?
Component
130. If a method is declared as protected, where may the method be accessed?
A protected method may only be accessed by classes or interfaces of the same package or
by subclasses ofthe class in which it is declared.
131. How can the Checkbox class be used to create a radio button?
By associating Checkbox objects with a CheckboxGroup.
132. Which non-Unicode letter characters may be used as the first character of anidentifier?
The non-Unicode letter characters $ and _ may appear as the first character of anidentifier
133. What restrictions are placed on method overloading?
Two methods may not have the same name and argument list but different return types.
134. What happens when you invoke a thread's interrupt method while it issleeping or waiting?
When a task's interrupt() method is executed, the task enters the ready state. The nexttime the
task entersthe running state, an InterruptedException is thrown.
135. What is casting?
There are two types of casting, casting between primitive numeric types and castingbetween
objectreferences. Casting between numeric types is used to convert larger values, such as
double values, tosmaller values, such as byte values. Casting between object references is used to
refer toan object by acompatible class, interface, or array type reference.
136. What is the return type of a program's main() method?
A program's main() method has a void return type.
137. Name four Container classes.
Window, Frame, Dialog, FileDialog, Panel, Applet, or ScrollPane
138. What is the difference between a Choice and a List?
A Choice is displayed in a compact form that requires you to pull it down to see the list

NMIT P&T Page 86


of availablechoices. Only one item may be selected from a Choice. A List may be displayed in
such away that severalList items are visible. A List supports the selection of one or more List
items.
139. What class of exceptions are generated by the Java run-time system?
The Java runtime system generates RuntimeException and Error exceptions.
140. What class allows you to read objects directly from a stream?
The ObjectInputStream class supports the reading of objects from input streams.
141. What is the difference between a field variable and a local variable?
A field variable is a variable that is declared as a member of a class. A local variable is a
variable that isdeclared local to a method.
142. Under what conditions is an object's finalize() method invoked by the garbagecollector?
The garbage collector invokes an object's finalize() method when it detects that the object
has becomeunreachable.
143. How are this() and super() used with constructors?
this() is used to invoke a constructor of the same class. super() is used to invoke asuperclass
constructor.
144. What is the relationship between a method's throws clause and the exceptionsthat can be
thrown during the method's execution?
A method's throws clause must declare any checked exceptions that are not caught within
the body of themethod.
145. What is the difference between the JDK 1.02 event model and the eventdelegationmodel
introduced with JDK 1.1?
The JDK 1.02 event model uses an event inheritance or bubbling approach. In this model,
components arerequired to handle their own events. If they do not handle a particular event, the
event isinherited by (orbubbled up to) the component's container. The container then either
handles the event orit is bubbled up toits container and so on, until the highest-level container
has been tried.In the event-delegation model, specific objects are designated as event handlers
for GUIcomponents.These objects implement event-listener interfaces. The event-delegation
model is moreefficient than theevent-inheritance model because it eliminates the processing
required to support thebubbling of unhandledevents.

NMIT P&T Page 87


146. How is it possible for two String objects with identical values not to be equalunder the ==
operator?
The == operator compares two objects to determine if they are the same object inmemory. It is
possible fortwo String objects to have the same value, but located indifferent areas of memory.
147. Why are the methods of the Math class static?
So they can be invoked as if they are a mathematical code library.
148. What Checkbox method allows you to tell if a Checkbox is checked?
getState()
149. What state is a thread in when it is executing?
An executing thread is in the running state.
150. What are the legal operands of the instanceof operator?
The left operand is an object reference or null value and the right operand is a class,
interface, or array type.
151. How are the elements of a GridLayout organized?
The elements of a GridBad layout are of equal size and are laid out using the squares of a
grid.
152. What an I/O filter?
An I/O filter is an object that reads from one stream and writes to another, usuallyaltering the
data in someway as it is passed from one stream to another.
153. If an object is garbage collected, can it become reachable again?
Once an object is garbage collected, it ceases to exist. It can no longer become reachableagain.
154. What is the Set interface?
The Set interface provides methods for accessing the elements of a finite mathematicalset. Sets
do notallow duplicate elements.
155. What classes of exceptions may be thrown by a throw statement?
A throw statement may throw any expression that may be assigned to the Throwabletype.
156. What are E and PI?
E is the base of the natural logarithm and PI is mathematical value pi.
157. Are true and false keywords?
The values true and false are not keywords.

NMIT P&T Page 88


158. What is a void return type?
A void return type indicates that a method does not return a value.
159. What is the purpose of the enableEvents() method?
The enableEvents() method is used to enable an event for a particular object. Normally,an event
is enabledwhen a listener is added to an object for a particular event. The enableEvents() method
isused by objectsthat handle events by overriding their event-dispatch methods.
160. What is the difference between the File and RandomAccessFile classes?
The File class encapsulates the files and directories of the local file system.
TheRandomAccessFile classprovides the methods needed to directly access data contained in
any part of a file.
161. What happens when you add a double value to a String?
The result is a String object.
162. What is your platform's default character encoding?
If you are running Java on English Windows platforms, it is probably Cp1252. If you are
running Java onEnglish Solaris platforms, it is most likely 8859_1..
163. Which package is always imported by default?
The java.lang package is always imported by default.
164. What interface must an object implement before it can be written to a streamas an object?
An object must implement the Serializable or Externalizable interface before it can bewritten to a
stream asan object.
165. How are this and super used?
this is used to refer to the current object instance. super is used to refer to the variables
and methods of thesuperclass of the current object instance.
166. What is the purpose of garbage collection?
The purpose of garbage collection is to identify and discard objects that are no longerneeded by a
programso that their resources may be reclaimed and reused.
167. What is a compilation unit?
A compilation unit is a Java source code file.
168. What interface is extended by AWT event listeners?
All AWT event listeners extend the java.util.EventListener interface.

NMIT P&T Page 89


169. What restrictions are placed on method overriding?
Overridden methods must have the same name, argument list, and return type. Theoverriding
method maynot limit the access of the method it overrides. The overriding method may not
throwany exceptions thatmay not be thrown by the overridden method.
170. How can a dead thread be restarted?
A dead thread cannot be restarted.
171. What happens if an exception is not caught?
An uncaught exception results in the uncaughtException() method of the thread'sThreadGroup
beinginvoked, which eventually results in the termination of the program in which it is thrown.
172. What is a layout manager?
A layout manager is an object that is used to organize components in a container.
173. Which arithmetic operations can result in the throwing of anArithmeticException?
Integer / and % can result in the throwing of an ArithmeticException.
174. What are three ways in which a thread can enter the waiting state?
A thread can enter the waiting state by invoking its sleep() method, by blocking on I/O,
by unsuccessfullyattempting to acquire an object's lock, or by invoking an object's wait()
method. It canalso enter thewaiting state by invoking its (deprecated) suspend() method.
175. Can an abstract class be final?
An abstract class may not be declared as final.
176. What is the ResourceBundle class?
The ResourceBundle class is used to store locale-specific resources that can be loaded bya
program totailor the program's appearance to the particular locale in which it is being run.
177. What happens if a try-catch-finally statement does not have a catch clause to
handle anexception that is thrown within the body of the try statement?The exception propagates
up to the next higher level try-catch statement (if any) orresults in the program'stermination.
178. What is numeric promotion?
Numeric promotion is the conversion of a smaller numeric type to a larger numeric type,so that
integer andfloating-point operations may take place. In numerical promotion, byte, char, and
shortvalues areconverted to int values. The int values are also converted to long values, if
necessary.The long and floatvalues are converted to double values, as required.

NMIT P&T Page 90


179. What is the difference between a Scrollbar and a ScrollPane?
A Scrollbar is a Component, but not a Container. A ScrollPane is a Container. AScrollPane
handles itsown events and performs its own scrolling.
180. What is the difference between a public and a non-public class?
A public class may be accessed outside of its package. A non-public class may not beaccessed
outside ofits package.
181. To what value is a variable of the boolean type automatically initialized?
The default value of the boolean type is false.
182. Can try statements be nested?
Try statements may be tested.
183. What is the difference between the prefix and postfix forms of the ++ operator?
The prefix form performs the increment operation and returns the value of the
incrementoperation. Thepostfix form returns the current value all of the expression and then
performs the increment opeation onthat value.
184. What is the purpose of a statement block?
A statement block is used to organize a sequence of statements as a single statementgroup.
185. What is a Java package and how is it used?
A Java package is a naming context for classes and interfaces. A package is used tocreate a
separate namespace for groups of classes and interfaces. Packages are also used to organize
relatedclasses and interfacesinto a single API unit and to control accessibility to these classes and
interfaces.
186. What modifiers may be used with a top-level class?
A top-level class may be public, abstract, or final.
187. What are the Object and Class classes used for?
The Object class is the highest-level class in the Java class hierarchy. The Class class isused to
representthe classes and interfaces that are loaded by a Java program.
188. How does a try statement determine which catch clause should be used tohandle an
exception?
When an exception is thrown within the body of a try statement, the catch clauses of thetry
statement areexamined in the order in which they appear. The first catch clause that is capable of

NMIT P&T Page 91


handling the exceptionis executed. The remaining catch clauses are ignored.
189. Can an unreachable object become reachable again?
An unreachable object may become reachable again. This can happen when the object'sfinalize()
method isinvoked and the object performs an operation which causes it to become accessible to
reachable objects.
190. When is an object subject to garbage collection?
An object is subject to garbage collection when it becomes unreachable to the program inwhich
it is used.
191. What method must be implemented by all threads?
All tasks must implement the run() method, whether they are a subclass of Thread orimplement
theRunnable interface.
192. What methods are used to get and set the text label displayed by a Buttonobject?
getLabel() and setLabel()
193. Which Component subclass is used for drawing and painting?
Canvas
194. What are synchronized methods and synchronized statements?
Synchronized methods are methods that are used to control access to an object. A threadonly
executes asynchronized method after it has acquired the lock for the method's object or class.
Synchronizedstatements are similar to synchronized methods. A synchronized statement can
only beexecuted after athread has acquired the lock for the object or class referenced in the
synchronizedstatement.
195. What are the two basic ways in which classes that can be run as threads may bedefined?
A thread class may be declared as a subclass of Thread, or it may implement theRunnable
interface.
196. What are the problems faced by Java programmers who don't use layoutmanagers?
Without layout managers, Java programmers are faced with determining how their GUIwill be
displayedacross multiple windowing systems and finding a common sizing and positioning that
will work within theconstraints imposed by each windowing system.
197. What is the difference between an if statement and a switch statement?

NMIT P&T Page 92


The if statement is used to select among two alternatives. It uses a boolean expression todecide
whichalternative should be executed. The switch statement is used to select among multiple
alternatives. It usesan int expression to determine which alternative should be executed.
198. What is the List interface?
The List interface provides support for ordered collections of objects.

4.4a ForJava/J2EEDevelopers, which occurs frequently in the interview.


Java:-
1)What is static variable.
2)What is transient variable.
3)What is final variable.
4)What is final method.
5)What is native method.
6)What is abstract method
7)What is innerclass.
8)What is static class.
9)What is final class.
10)What is anonymous class.
11)What is casting.
12)What are wrapper classes.
13)What is Singleton class.
14)What is JVM.
15)What is JNI.
16)What is JAR file.
17)What is garbage collection.
18)What is Socket. How will you create a connection.
19)What is ServerSocket. How will you create a connection.
20)What is DatagramSocket.How will you create a connection.

NMIT P&T Page 93


21)What is Synchronisation in threads.
22)What is Collection.
23)What is JavaMail.
24)What is Serialization and Deserialization.
25)What is the life cycle of an applet.
26)What is Reflection. Uses of Reflection.
27)What is the purpose of finalisation.
28)What is the functionality of try, catch and finally blocks (*)
29)What is the difference between Abstract class and Interface. (*)
30)What is the difference between overloading and overriding.
31)What is the difference between Hashmap and Hashtable. (*)
32)What is the difference between Vector, Array and Arraylist. (*)
33)What is the difference between final, finally and finalized. (*)
34)What is the difference between String and StringBuffer. (*)
35)What is the difference between exception and error.
36)What is the difference between List, Set and Map. (*)
37)What is the difference between Observable and Observer.
38)What is the difference between Eventlistener and Eventadapter.
39)What is the difference between Classpath and Import.
40)What is the difference between Iterator and Enumeration.
41)What is the difference between Comparable and Comparator.
42)What is the difference between applet and application.
43)What is the difference between applet and swing.
44)What is the difference between HashMap and TreeMap. (*)
http://www.exforsys.com
45)What is the difference between wait(), join(), sleep(), notify() &notifyall()
methods. (*)
46)What is the difference between Reader/Writer classes.
47)What is the difference between InputStream/Outputstream classes.
48)What is the difference between File and RandomFileAccess classes.

NMIT P&T Page 94


49)What is the difference between paint() and repaint() methods.
50)What is the difference between yielding and sleeping.
51)What is the difference between preemptive scheduling and time slicing.
52)What is the difference between static and non-static variables.
53)What is the difference between Delegation event model and Inheritance event
model.
54)What are the various access modifiers in Java. Differences between them. (*)
55)What are the various ways of creating a thread. What is difference between
them. (*)
56)What are the various Collection classes available. (*)
57)What are the various layouts available. What is the difference between them.
58)Which Collection class is used for FIFO in Java.
59)Which Collection class is used for LIFO in Java.
60)When should i used notify() and notifyall() methods on threads.
61)Can the abstract class be final.
62)What is the command to know which version of java you are using.
63)Can we add Hashtable/HashMap to a vector.
64)How do you handle events in Java.
65)What is class loader.
66)What is the difference between function synchronization and object
synchronization.
67)What is the difference between .equals and ==

4.5 Computer Networks Common Interview Questions:

NMIT P&T Page 95


1. What are 10Base2, 10Base5 and 10BaseT Ethernet LANs
10Base2—An Ethernet term meaning a maximum transfer rate of 10 Megabits per second that
uses baseband
signaling, with a contiguous cable segment length of 100
meters and a maximum of 2 segments.
10Base5—An Ethernet term meaning a maximum transfer rate of 10 Megabits per second that
uses baseband
signaling, with 5 continuous segments not exceeding 100
meters per segment.
10BaseT—An Ethernet term meaning a maximum transfer rate of 10 Megabits per second that
uses baseband
signaling and twisted pair cabling.
2. What is the difference between an unspecified passive open and a fully specified passive
open
An unspecified passive open has the server waiting for a connection request from a client. A
fully specified passive
open has the server waiting for a connection from a
specific client.
3. Explain the function of Transmission Control Block
A TCB is a complex data structure that contains a considerable amount of information about
each connection.
4. What is a Management Information Base (MIB)
A Management Information Base is part of every SNMP-managed device. Each SNMP agent has
the MIB database that
contains information about the device's status, its
performance, connections, and configuration. The MIB is queried by SNMP.
5. What is anonymous FTP and why would you use it
Anonymous FTP enables users to connect to a host without using a valid login and password.
Usually, anonymous FTP
uses a login called anonymous or guest, with the

NMIT P&T Page 96


password usually requesting the user's ID for tracking purposes only. Anonymous FTP is used to
enable a large number
of users to access files on the host without having
to go to the trouble of setting up logins for them all. Anonymous FTP systems usually have strict
controls over the areas
an anonymous user can access.
6. What is a pseudo tty
A pseudo tty or false terminal enables external machines to connect through Telnet or rlogin.
Without a pseudo tty, no
connection can take place.
7. What is REX
What advantage does REX offer other similar utilities
8. What does the Mount protocol do
The Mount protocol returns a file handle and the name of the file system in which a requested
file resides. The message
is sent to the client from the server after reception
of a client's request.
9. What is External Data Representation
External Data Representation is a method of encoding data within an RPC message, used to
ensure that the data is not
system-dependent.
10. What is the Network Time Protocol ?
11. BOOTP helps a diskless workstation boot. How does it get a message to the network
looking for its IP
address and the location of its operating system boot files
BOOTP sends a UDP message with a subnetwork broadcast address and waits for a reply from a
server that gives it
the IP address. The same message might contain the
name of the machine that has the boot files on it. If the boot image location is not specified, the
workstation sends

NMIT P&T Page 97


another UDP message to query the server.
12. What is a DNS resource record
A resource record is an entry in a name server's database. There are several types of resource
records used, including
name-to-address resolution information. Resource
records are maintained as ASCII files.
13. What protocol is used by DNS name servers
DNS uses UDP for communication between servers. It is a better choice than TCP because of the
improved speed a
connectionless protocol offers. Of course,
transmission reliability suffers with UDP.
14. What is the difference between interior and exterior neighbor gateways
Interior gateways connect LANs of one organization, whereas exterior gateways connect the
organization to the outside
world.
15. What is the HELLO protocol used for
The HELLO protocol uses time instead of distance to determine optimal routing. It is an
alternative to the Routing
Information Protocol.
16. What are the advantages and disadvantages of the three types of routing tables
The three types of routing tables are fixed, dynamic, and fixed central. The fixed table must be
manually modified every
time there is a change. A dynamic table changes its
information based on network traffic, reducing the amount of manual maintenance. A fixed
central table lets a manager
modify only one table, which is then read by other
devices. The fixed central table reduces the need to update each machine's table, as with the fixed
table. Usually a
dynamic table causes the fewest problems for a network

NMIT P&T Page 98


administrator, although the table's contents can change without the administrator being aware of
the change.
17. What is a TCP connection table
18. What is source route
It is a sequence of IP addresses identifying the route a datagram must follow. A source route may
optionally be included in an IP datagram header.
19. What is RIP (Routing Information Protocol)
It is a simple protocol used to exchange information between the routers.
20. What is SLIP (Serial Line Interface Protocol)
It is a very simple protocol used for transmission of IP datagrams across a serial line.
21. What is Proxy ARP
It is using a router to answer ARP requests. This will be done when the originating host believes
that a destination is
local, when in fact is lies beyond router.
22. What is OSPF
It is an Internet routing protocol that scales well, can route traffic along multiple paths, and uses
knowledge of an
Internet's topology to make accurate routing decisions.
23. What is Kerberos
It is an authentication service developed at the Massachusetts Institute of Technology. Kerberos
uses encryption to
prevent intruders from discovering passwords and
gaining unauthorized access to files.
24. What is a Multi-homed Host
It is a host that has a multiple network interfaces and that requires multiple IP addresses is called
as a Multi-homed
Host.
25. What is NVT (Network Virtual Terminal)
It is a set of rules defining a very simple virtual terminal interaction. The NVT is used in the start
of a Telnet session.

NMIT P&T Page 99


26. What is Gateway-to-Gateway protocol
It is a protocol formerly used to exchange routing information between Internet core routers.
27. What is BGP (Border Gateway Protocol)
It is a protocol used to advertise the set of networks that can be reached with in an autonomous
system. BGP enables
this information to be shared with the autonomous
system. This is newer than EGP (Exterior Gateway Protocol).
28. What is autonomous system
It is a collection of routers under the control of a single administrative authority and that uses a
common Interior
Gateway Protocol.
29. What is EGP (Exterior Gateway Protocol)
It is the protocol the routers in neighboring autonomous systems use to identify the set of
networks that can be reached
within or via each autonomous system.
30. What is IGP (Interior Gateway Protocol)
It is any routing protocol used within an autonomous system.
31. What is Mail Gateway
It is a system that performs a protocol translation between different electronic mail delivery
protocols.
32. What is wide-mouth frog
Wide-mouth frog is the simplest known key distribution center (KDC) authentication protocol.
33. What are Digrams and Trigrams
The most common two letter combinations are called as digrams. e.g. th, in, er, re and an. The
most common three
letter combinations are called as trigrams. e.g. the, ing,
and, and ion.
34. What is silly window syndrome
It is a problem that can ruin TCP performance. This problem occurs when data are passed to the
sending TCP entity in

NMIT P&T Page 100


large blocks, but an interactive application on the
receiving side reads 1 byte at a time.
35. What is region
When hierarchical routing is used, the routers are divided into what we call regions, with each
router knowing all the
details about how to route packets to destinations
within its own region, but knowing nothing about the internal structure of other regions.
36. What is multicast routing
Sending a message to a group is called multicasting, and its routing algorithm is called multicast
routing.
37. What is traffic shaping
One of the main causes of congestion is that traffic is often busy. If hosts could be made to
transmit at a uniform rate,
congestion would be less common. Another open loop
method to help manage congestion is forcing the packet to be transmitted at a more predictable
rate. This is called
traffic shaping.
38. What is packet filter
Packet filter is a standard router equipped with some extra functionality. The extra functionality
allows every incoming or
outgoing packet to be inspected. Packets meeting
some criterion are forwarded normally. Those that fail the test are dropped.
39. What is virtual path
Along any transmission path from a given source to a given destination, a group of virtual
circuits can be grouped
together into what is called path.
40. What is virtual channel
Virtual channel is normally a connection from one source to one destination, although multicast
connections are also
permitted. The other name for virtual channel is virtual

NMIT P&T Page 101


circuit.
41. What is logical link control
One of two sublayers of the data link layer of OSI reference model, as defined by the IEEE 802
standard. This sublayer
is responsible for maintaining the link between
computers when they are sending data across the physical network connection.
42. Why should you care about the OSI Reference Model
It provides a framework for discussing network operations and design.
43. What is the difference between routable and non- routable protocols
Routable protocols can work with a router and can be used to build large networks. Non-
Routable protocols are
designed to work on small, local networks and cannot be
used with a router
44. What is MAU
In token Ring , hub is called Multistation Access Unit(MAU).
45. Explain 5-4-3 rule
In a Ethernet network, between any two points on the network, there can be no more than five
network segments or four
repeaters, and of those five segments only three of
segments can be populated.
46. What is the difference between TFTP and FTP application layer protocols
The Trivial File Transfer Protocol (TFTP) allows a local host to obtain files from a remote host
but does not provide
reliability or security. It uses the fundamental packet
delivery services offered by UDP.
The File Transfer Protocol (FTP) is the standard mechanism provided by TCP / IP for copying a
file from one host to
another. It uses the services offered by TCP and so is
reliable and secure. It establishes two connections (virtual circuits) between the hosts, one for
data transfer and another

NMIT P&T Page 102


for control information.
47. What is the range of addresses in the classes of internet addresses
Class A 0.0.0.0 - 127.255.255.255
Class B 128.0.0.0 - 191.255.255.255
Class C 192.0.0.0 - 223.255.255.255
Class D 224.0.0.0 - 239.255.255.255
Class E 240.0.0.0 - 247.255.255.255
48. What is the minimum and maximum length of the header in the TCP segment and IP
datagram
The header should have a minimum length of 20 bytes and can have a maximum length of 60
bytes.
49. What is difference between ARP and RARP
The address resolution protocol (ARP) is used to associate the 32 bit IP address with the 48 bit
physical address, used
by a host or a router to find the physical address of
another host on its network by sending a ARP query packet that includes the IP address of the
receiver.
The reverse address resolution protocol (RARP) allows a host to discover its Internet address
when it knows only its
physical address.
50. What is ICMP
ICMP is Internet Control Message Protocol, a network layer protocol of the TCP/IP suite used by
hosts and gateways to
send notification of datagram problems back to the
sender. It uses the echo test / reply to test whether a destination is reachable and responding. It
also handles both
control and error messages.
51. What are the data units at different layers of the TCP / IP protocol suite
The data unit created at the application layer is called a message, at the transport layer the data
unit created is called

NMIT P&T Page 103


either a segment or an user datagram, at the network
layer the data unit created is called the datagram, at the data link layer the datagram is
encapsulated in to a frame and
finally transmitted as signals along the transmission
media.
52. What is Project 802
It is a project started by IEEE to set standards that enable intercommunication between
equipment from a variety of
manufacturers. It is a way for specifying functions of the
physical layer, the data link layer and to some extent the network layer to allow for
interconnectivity of major LAN
protocols.
It consists of the following:
802.1 is an internetworking standard for compatibility of different LANs and MANs across
protocols.
802.2 Logical link control (LLC) is the upper sublayer of the data link layer which is non-
architecture-specific, that is
remains the same for all IEEE-defined LANs.
Media access control (MAC) is the lower sublayer of the data link layer that contains some
distinct modules each
carrying proprietary information specific to the LAN product
being used. The modules are Ethernet LAN (802.3), Token ring LAN (802.4), Token bus LAN
(802.5).
802.6 is distributed queue dual bus (DQDB) designed to be used in MANs.
53. What is Bandwidth
Every line has an upper limit and a lower limit on the frequency of signals it can carry. This
limited range is called the
bandwidth.
54. Difference between bit rate and baud rate.

NMIT P&T Page 104


Bit rate is the number of bits transmitted during one second whereas baud rate refers to the
number of signal units per
second that are required to represent
those bits.
baud rate = bit rate / N
where N is no-of-bits represented by each signal shift.
55. What is MAC address
The address for a device as it is identified at the Media Access Control (MAC) layer in the
network architecture. MAC
address is usually stored in ROM on the network
adapter card and is unique.
56. What is attenuation
The degeneration of a signal over distance on a network cable is called attenuation.
57. What is cladding
A layer of a glass surrounding the center fiber of glass inside a fiber-optic cable.
58. What is RAID
A method for providing fault tolerance by using multiple hard disk drives.
59. What is NETBIOS and NETBEUI
NETBIOS is a programming interface that allows I/O requests to be sent to and received from a
remote computer and it
hides the networking hardware from applications.
NETBEUI is NetBIOS extended user interface. A transport protocol designed by microsoft and
IBM for the use on small
subnets.
60. What is redirector
Redirector is software that intercepts file or prints I/O requests and translates them into network
requests. This comes
under presentation layer.
61. What is Beaconing

NMIT P&T Page 105


The process that allows a network to self-repair networks problems. The stations on the network
notify the other
stations on the ring when they are not receiving the
transmissions. Beaconing is used in Token ring and FDDI networks.
62. What is terminal emulation, in which layer it comes
Telnet is also called as terminal emulation. It belongs to application layer.
63. What is frame relay, in which layer it comes
Frame relay is a packet switching technology. It will operate in the data link layer.
64. What do you meant by "triple X" in Networks
The function of PAD (Packet Assembler Disassembler) is described in a document known as
X.3. The standard protocol
has been defined between the terminal and the
PAD, called X.28; another standard protocol exists between hte PAD and the network, called
X.29. Together, these
three recommendations are often called "triple X"
65. What is SAP
Series of interface points that allow other computers to communicate with the other layers of
network protocol stack.
66. What is subnet
A generic term for section of a large networks usually separated by a bridge or router.
67. What is Brouter
Hybrid devices that combine the features of both bridges and routers.
68. How Gateway is different from Routers
A gateway operates at the upper levels of the OSI model and translates information between two
completely different
network architectures or data formats.
69. What are the different type of networking / internetworking devices
Repeater:
Also called a regenerator, it is an electronic device that operates only at physical layer. It
receives the signal in the

NMIT P&T Page 106


network before it becomes weak, regenerates the original
bit pattern and puts the refreshed copy back in to the link.
Bridges:
These operate both in the physical and data link layers of LANs of same type. They divide a
larger network in to smaller
segments. They contain logic that allow them to
keep the traffic for each segment separate and thus are repeaters that relay a frame only the side
of the segment
containing the intended recipent and control congestion.
Routers:
They relay packets among multiple interconnected networks (i.e. LANs of different type). They
operate in the physical,
data link and network layers. They contain software
that enable them to determine which of the several possible paths is the best for a particular
transmission.
Gateways:
They relay packets among networks that have different protocols (e.g. between a LAN and a
WAN). They accept a
packet formatted for one protocol and convert it to a
packet formatted for another protocol before forwarding it. They operate in all seven layers of
the OSI model.
70. What is mesh network
A network in which there are multiple network links between computers to provide multiple
paths for data to travel.
71. What is passive topology
When the computers on the network simply listen and receive the signal, they are referred to as
passive because they
don’t amplify the signal in any way. Example for
passive topology - linear bus.
72. What are the important topologies for networks

NMIT P&T Page 107


BUS topology:
In this each computer is directly connected to primary network cable in a single line.
Advantages:
Inexpensive, easy to install, simple to understand, easy to extend.
STAR topology:
In this all computers are connected using a central hub.
Advantages:
Can be inexpensive, easy to install and reconfigure and easy to trouble shoot physical problems.
RING topology:
In this all computers are connected in loop.
Advantages:
All computers have equal access to network media, installation can be simple, and signal does
not degrade as much as
in other topologies because each computer
regenerates it.
73. What are major types of networks and explain
Server-based network
Peer-to-peer network
Peer-to-peer network, computers can act as both servers sharing resources and as clients using
the resources.
Server-based networks provide centralized control of network resources and rely on server
computers to provide
security and network administration
74. What is Protocol Data Unit
The data unit in the LLC level is called the protocol data unit (PDU). The PDU contains of four
fields a destination
service access point (DSAP), a source service access
point (SSAP), a control field and an information field. DSAP, SSAP are addresses used by the
LLC to identify the
protocol stacks on the receiving and sending machines

NMIT P&T Page 108


that are generating and using the data. The control field specifies whether the PDU frame is a
information frame (I -
frame) or a supervisory frame (S - frame) or a
unnumbered frame (U - frame).
75. What is difference between baseband and broadband transmission
In a baseband transmission, the entire bandwidth of the cable is consumed by a single signal. In
broadband
transmission, signals are sent on multiple frequencies, allowing
multiple signals to be sent simultaneously.
76. What are the possible ways of data exchange
(i) Simplex (ii) Half-duplex (iii) Full-duplex.
77. What are the types of Transmission media
Signals are usually transmitted over some transmission media that are broadly classified in to
two categories.
Guided Media:
These are those that provide a conduit from one device to another that include twisted-pair,
coaxial cable and fiber-optic
cable. A signal traveling along any of these media
is directed and is contained by the physical limits of the medium. Twisted-pair and coaxial cable
use metallic that accept
and transport signals in the form of electrical
current. Optical fiber is a glass or plastic cable that accepts and transports signals in the form of
light.
Unguided Media:
This is the wireless media that transport electromagnetic waves without using a physical
conductor. Signals are
broadcast either through air. This is done through radio
communication, satellite communication and cellular telephony.
78. What is point-to-point protocol

NMIT P&T Page 109


A communications protocol used to connect computers to remote networking services including
Internet service
providers.
79. What are the two types of transmission technology available
(i) Broadcast and (ii) point-to-point
80. Difference between the communication and transmission.
Transmission is a physical movement of information and concern issues like bit polarity,
synchronization, clock etc.
Communication means the meaning full exchange of information between two communication
media.

NMIT P&T Page 110


Chapter- 5 : HR and Interview Related Questions

Review these typical interview questions and think about how you would answer them. Read
the questions listed; you will also find some strategy suggestions with it.
1. Tell me about yourself:
The most often asked question in interviews. You need to have a short statement prepared
in your mind. Be careful that it does not sound rehearsed. Limit it to work-related items
unless instructed otherwise. Talk about things you have done and jobs you have held that
relate to the position you are interviewing for. Start with the item farthest back and work up
to the present.
2. Why did you leave your last job?
Stay positive regardless of the circumstances. Never refer to a major problem with
management and never speak ill of supervisors, co-workers or the organization. If you do,
you will be the one looking bad. Keep smiling and talk about leaving for a positive reason
such as an opportunity, a chance to do something special or other forward-looking reasons.
3. What experience do you have in this field?
Speak about specifics that relate to the position you are applying for. If you do not have
specific experience, get as close as you can.
4. Do you consider yourself successful?
You should always answer yes and briefly explain why. A good explanation is that you have
set goals, and you have met some and are on track to achieve the others.
5. What do co-workers say about you?
Be prepared with a quote or two from co-workers. Either a specific statement or a
paraphrase will work. Jill Clark, a co-worker at Smith Company, always said I was the
hardest workers she had ever known. It is as powerful as Jill having said it at the interview
herself.
6. What do you know about this organization?
This question is one reason to do some research on the organization before the interview.
Find out where they have been and where they are going. What are the current issues and
who are the major players?

NMIT P&T Page 111


7. What have you done to improve your knowledge in the last year?
Try to include improvement activities that relate to the job. A wide variety of activities can
be mentioned as positive self-improvement. Have some good ones handy to mention.
8. Are you applying for other jobs?
Be honest but do not spend a lot of time in this area. Keep the focus on this job and what
you can do for this organization. Anything else is a distraction.
9. Why do you want to work for this organization?
This may take some thought and certainly, should be based on the research you have done
on the organization. Sincerity is extremely important here and will easily be sensed. Relate
it to your long-term career goals.
10. Do you know anyone who works for us?
Be aware of the policy on relatives working for the organization. This can affect your answer
even though they asked about friends not relatives. Be careful to mention a friend only if
they are well thought of.
11. What kind of salary do you need?
A loaded question.A nasty little game that you will probably lose if you answer first. So, do
not answer it. Instead, say something like, That's a tough question. Can you tell me the
range for this position? In most cases, the interviewer, taken off guard, will tell you. If not,
say that it can depend on the details of the job. Then give a wide range.
12. Are you a team player?
You are, of course, a team player. Be sure to have examples ready. Specifics that show you
often perform for the good of the team rather than for yourself are good evidence of your
team attitude. Do not brag, just say it in a matter-of-fact tone. This is a key point.
13. How long would you expect to work for us if hired?
Specifics here are not good. Something like this should work: I'd like it to be a long time. Or
As long as we both feel I'm doing a good job.
14. Have you ever had to fire anyone? How did you feel about that?
This is serious. Do not make light of it or in any way seem like you like to fire people. At the
same time, you will do it when it is the right thing to do. When it comes to the organization
versus the individual who has created a harmful situation, you will protect the organization.

NMIT P&T Page 112


Remember firing is not the same as layoff or reduction in force.
15. What is your philosophy towards work?
The interviewer is not looking for a long or flowery dissertation here. Do you have strong
feelings that the job gets done? Yes. That's the type of answer that works best here. Short
and positive, showing a benefit to the organization.
16. If you had enough money to retire right now, would you?
Answer yes if you would. But since you need to work, this is the type of work you prefer. Do
not say yes if you do not mean it.
17. Have you ever been asked to leave a position?
If you have not, say no. If you have, be honest, brief and avoid saying negative things
about the people or organization involved.
18. Explain how you would be an asset to this organization
You should be anxious for this question. It gives you a chance to highlight your best points
as they relate to the position being discussed. Give a little advance thought to this
relationship.
19. Why should we hire you?
Point out how your assets meet what the organization needs. Do not mention any other
candidates to make a comparison.
20. Tell me about a suggestion you have made
Have a good one ready. Be sure and use a suggestion that was accepted and was then
considered successful. One related to the type of work applied for is a real plus.
21. What irritates you about co-workers?
This is a trap question. Think real hard but fail to come up with anything that irritates you.
A short statement that you seem to get along with folks is great.
22. What is your greatest strength?
Numerous answers are good, just stay positive. A few good examples:
Your ability to prioritize, Your problem-solving skills, Your ability to work under pressure,
Your ability to focus on projects, Your professional expertise, Your leadership skills, Your
positive attitude .
23. Tell me about your dream job.

NMIT P&T Page 113


Stay away from a specific job. You cannot win. If you say the job you are contending for is
it, you strain credibility. If you say another job is it, you plant the suspicion that you will be
dissatisfied with this position if hired. The best is to stay genetic and say something like: A
job where I love the work, like the people, can contribute and can't wait to get to work.
24. Why do you think you would do well at this job?
Give several reasons and include skills, experience and interest.
25. What are you looking for in a job?
See answer # 23
26. What kind of person would you refuse to work with?
Do not be trivial. It would take disloyalty to the organization, violence or lawbreaking to get
you to object. Minor objections will label you as a whiner.
27. What is more important to you: the money or the work?
Money is always important, but the work is the most important. There is no better answer.
28. What would your previous supervisor say your strongest point is?
There are numerous good possibilities:
Loyalty, Energy, Positive attitude, Leadership, Team player, Expertise, Initiative, Patience,
Hard work, Creativity, Problem solver
29. Tell me about a problem you had with a supervisor
Biggest trap of all. This is a test to see if you will speak ill of your boss. If you fall for it and
tell about a problem with a former boss, you may well below the interview right there. Stay
positive and develop a poor memory about any trouble with a supervisor.
30. What has disappointed you about a job?
Don't get trivial or negative. Safe areas are few but can include:
Not enough of a challenge. You were laid off in a reduction Company did not win a contract,
which would have given you more responsibility.
31. Tell me about your ability to work under pressure.
You may say that you thrive under certain types of pressure. Give an example that relates
to the type of position applied for.
32. Do your skills match this job or another job more closely?
Probably this one. Do not give fuel to the suspicion that you may want another job more

NMIT P&T Page 114


than this one.
33. What motivates you to do your best on the job?
This is a personal trait that only you can say, but good examples are:
Challenge, Achievement, Recognition
34. Are you willing to work overtime? Nights?Weekends?
This is up to you. Be totally honest.
35. How would you know you were successful on this job?
Several ways are good measures:
You set high standards for yourself and meet them. Your outcomes are a success.Your boss
tell you that you are successful
36. Would you be willing to relocate if required?
You should be clear on this with your family prior to the interview if you think there is a
chance it may come up. Do not say yes just to get the job if the real answer is no. This can
create a lot of problems later on in your career. Be honest at this point and save yourself
future grief.
37. Are you willing to put the interests of the organization ahead of your own?
This is a straight loyalty and dedication question. Do not worry about the deep ethical and
philosophical implications. Just say yes.
38. Describe your management style.
Try to avoid labels. Some of the more common labels, like progressive, salesman or
consensus, can have several meanings or descriptions depending on which management
expert you listen to. The situational style is safe, because it says you will manage according
to the situation, instead of one size fits all.
39. What have you learned from mistakes on the job?
Here you have to come up with something or you strain credibility. Make it small, well
intentioned mistake with a positive lesson learned. An example would be working too far
ahead of colleagues on a project and thus throwing coordination off.
40. Do you have any blind spots?
Trick question. If you know about blind spots, they are no longer blind spots. Do not reveal
any personal areas of concern here. Let them do their own discovery on your bad points. Do

NMIT P&T Page 115


not hand it to them.
41. If you were hiring a person for this job, what would you look for?
Be careful to mention traits that are needed and that you have.
42. Do you think you are overqualified for this position?
Regardless of your qualifications, state that you are very well qualified for the position.
43. How do you propose to compensate for your lack of experience?
First, if you have experience that the interviewer does not know about, bring that up: Then,
point out (if true) that you are a hard working quick learner.
44. What qualities do you look for in a boss?
Be generic and positive. Safe qualities are knowledgeable, a sense of humor, fair, loyal to
subordinates and holder of high standards. All bosses think they have these traits.
45. Tell me about a time when you helped resolve a dispute between others.
Pick a specific incident. Concentrate on your problem solving technique and not the dispute
you settled.
46. What position do you prefer on a team working on a project?
Be honest. If you are comfortable in different roles, point that out.
47. Describe your work ethic.
Emphasize benefits to the organization. Things like, determination to get the job done and
work hard but enjoy your work are good.
48. What has been your biggest professional disappointment?
Be sure that you refer to something that was beyond your control. Show acceptance and no
negative feelings.
49. Tell me about the most fun you have had on the job.
Talk about having fun by accomplishing something for the organization.
50. Do you have any questions for me?
Always have some questions prepared. Questions prepared where you will be an asset to
the organization are good. How soon will I be able to be productive? and What type of
projects will I be able to assist on? are examples.

NMIT P&T Page 116

Das könnte Ihnen auch gefallen