1. There​ ​are​ ​11​ ​points​ ​in​ ​a​ ​plane​ ​of​ ​which​ ​no​ ​three​ ​points​ ​are​ ​in​ ​a​ ​straight​ ​line​ ​except​ ​5
points​ ​which​ ​are​ ​all​ ​in​ ​a​ ​straight​ ​line.​ ​How​ ​many​ ​quadrilaterals​ ​can​ ​be​ ​formed​ ​with​ ​the​ ​given
points​ ​as​ ​vertices​ ​is?
Ans:​ ​265
2.​ ​Consider​ ​the​ ​box​ ​contains​ ​32​ ​bulbs​ ​of​ ​which​ ​15​ ​Red,​ ​10​ ​Blue,​ ​5​ ​White,​ ​1Yellow,​ ​1​ ​Orange.
Ramu​ ​picks​ ​a​ ​bulb​ ​randomly​ ​from​ ​a​ ​box,​ ​and​ ​messages​ ​to​ ​lakshman​ ​about​ ​its​ ​color​ ​using​ ​string
of​ ​0’s​ ​and​ ​1’s.​ ​Ramu​ ​replaces​ ​the​ ​bulb​ ​in​ ​the​ ​box,​ ​and​ ​repeats​ ​the​ ​same​ ​experiment​ ​many
times.​ ​What​ ​is​ ​the​ ​expected​ ​minimum​ ​length​ ​of​ ​the​ ​message​ ​that​ ​Ramu​ ​has​ ​to​ ​convey​ ​to
Lakshman?
Ans:​ ​58/32
3.​ ​Let​ ​a​ ​queue​ ​is​ ​implemented​ ​using​ ​a​ ​circular​ ​array​ ​with​ ​9​ ​elements​ ​in​ ​the​ ​queue​ ​stored​ ​at
data[11]​ ​through​ ​data[19].​ ​The​ ​maximum​ ​size​ ​of​ ​the​ ​queue​ ​is​ ​30.​ ​Where​ ​does​ ​the​ ​enqueue
member​ ​function​ ​place​ ​the​ ​new​ ​entry​ ​in​ ​the​ ​array?
Ans:​ ​20
4.​ ​Shikar,​ ​Dhoni​ ​and​ ​Rohit​ ​are​ ​visiting​ ​the​ ​Kohli’s​ ​family​ ​who​ ​are​ ​staying​ ​200​ ​km​ ​away.​ ​Each​ ​of
their​ ​walking​ ​speeds​ ​is​ ​10​ ​kmph.​ ​Initially,​ ​Dhoni​ ​and​ ​Rohit​ ​travel​ ​in​ ​a​ ​car​ ​at​ ​the​ ​rate​ ​of​ ​50​ ​kmph
and​ ​Shikar​ ​walks​ ​the​ ​distance.​ ​After​ ​a​ ​while,​ ​Rohit​ ​gets​ ​off​ ​the​ ​car​ ​as​ ​he​ ​feels​ ​nauseated​ ​and
walks​ ​the​ ​rest​ ​of​ ​the​ ​distance​ ​to​ ​the​ ​house.​ ​Dhoni​ ​goes​ ​back​ ​in​ ​the​ ​car​ ​to​ ​fetch​ ​Shikar​ ​and​ ​they
all​ ​reach​ ​the​ ​house​ ​at​ ​the​ ​same​ ​time.​ ​What​ ​was​ ​the​ ​entire​ ​time​ ​involved​ ​in​ ​travelling(in​ ​hours)?
Ans:​ ​4
5.​ ​In​ ​a​ ​connected​ ​weighted​ ​graph​ ​with​ ​1000​ ​vertices​ ​,​ ​What​ ​is​ ​the​ ​maximum​ ​number​ ​of
minimum​ ​weighted​ ​spanning​ ​trees​ ​in​ ​the​ ​graph?​ ​(Assume​ ​all​ ​the​ ​edges​ ​have​ ​distinct​ ​positive
integer​ ​weights)
Ans:​ ​1
6.​ ​Choose​ ​the​ ​correct​ ​answer​ ​from​ ​the​ ​following?
Ans:​ ​S1:​ ​True,​ ​S2:​ ​False,​ ​S3:​ ​False
7.​ ​Consider​ ​any​ ​six​ ​distinct​ ​positive​ ​integers​ ​a1,​ ​a2,​ ​a3,​ ​a4,​ ​a5,​ ​a6.​ ​Find​ ​out​ ​the​ ​number​ ​of
maximum​ ​distinct​ ​primes​ ​that​ ​can​ ​be​ ​formed​ ​by​ ​the​ ​pairwise​ ​sums​ ​of​ ​{a1,​ ​a2,​ ​a3,​ ​a4,​ ​a5,​ ​a6}?
Ans:​ ​9
8.​ ​What​ ​is​ ​the​ ​number​ ​of​ ​Max​ ​Heaps​ ​possible​ ​in​ ​which​ ​the​ ​numbers​ ​14,​ ​24,​ ​39,​ ​59,​ ​100​ ​can​ ​be
inserted​ ​into​ ​a​ ​Binary​ ​Heap​ ​such​ ​that​ ​resulted​ ​binary​ ​heap​ ​is​ ​a​ ​Max​ ​Heap?
Ans:​ ​8
9.​ ​5​ ​men​ ​and​ ​3​ ​women​ ​together​ ​can​ ​complete​ ​a​ ​piece​ ​of​ ​work​ ​in​ ​6​ ​days.​ ​The​ ​work​ ​done​ ​by​ ​a
man​ ​in​ ​one​ ​day​ ​is​ ​double​ ​the​ ​work​ ​done​ ​by​ ​a​ ​woman​ ​in​ ​one​ ​day.​ ​If​ ​4​ ​men​ ​and​ ​3​ ​women​ ​started
working​ ​and​ ​after​ ​3​ ​days,​ ​​ ​​ ​2​ ​men​ ​left​ ​and​ ​2​ ​women​ ​joined,​ ​in​ ​how​ ​many​ ​more​ ​days​ ​will​ ​the​ ​work
be​ ​completed?
Ans:​ ​5
10:​ ​You​ ​are​ ​in​ ​a​ ​game​ ​show!​ ​There​ ​are​ ​10​ ​closed​ ​doors,​ ​0​ ​leads​ ​to​ ​nothing​ ​and​ ​1​ ​leads​ ​to​ ​an
expensive​ ​sports​ ​car.​ ​You​ ​are​ ​allowed​ ​to​ ​pick​ ​a​ ​door​ ​and​ ​earn​ ​the​ ​sports​ ​car​ ​if​ ​it’s​ ​behind​ ​the
door​ ​you​ ​choose.​ ​You​ ​choose​ ​a​ ​door​ ​and​ ​the​ ​host​ ​tells​ ​you​ ​he​ ​was​ ​preauthorized​ ​to​ ​make​ ​your
chance​ ​of​ ​winning​ ​better!​ ​You​ ​have​ ​two​ ​options.​ ​Option​ ​1:​ ​Get​ ​the​ ​right​ ​to​ ​open​ ​two​ ​doors​ ​and
win​ ​if​ ​the​ ​car​ ​is​ ​behind​ ​either​ ​of​ ​the​ ​ones​ ​you​ ​open.​ ​Option​ ​2:​ ​Have​ ​the​ ​host​ ​open​ ​5​ ​empty​ ​doors
[None​ ​of​ ​them​ ​the​ ​one​ ​you​ ​had​ ​choose]​ ​and​ ​then​ ​get​ ​the​ ​right​ ​to​ ​switch​ ​if​ ​you​ ​want.​ ​If​ ​you​ ​want
to​ ​win​ ​the​ ​car,​ ​what​ ​should​ ​you​ ​do?
Ans:​ ​Go​ ​with​ ​option​ ​2​ ​and​ ​switch
11.​ ​How​ ​many​ ​four​ ​digit​ ​numbers​ ​can​ ​be​ ​formed​ ​using​ ​the​ ​digits​ ​1,​ ​2,​ ​4,​ ​6,​ ​7​ ​and​ ​9​ ​such​ ​that
each​ ​number​ ​is​ ​divisible​ ​by​ ​3​ ​but​ ​not​ ​by​ ​9?​ ​(Repetition​ ​of​ ​digits​ ​is​ ​not​ ​allowed)
Ans:​ ​72
12.​ ​Find​ ​the​ ​time​ ​complexity​ ​for​ ​the​ ​following​ ​program
Ans:​ ​O(n*k)​ ​where​ ​k​ ​is​ ​the​ ​number​ ​of​ ​bits​ ​to​ ​represent​ ​the​ ​number​ ​‘n’
13.​ ​consider​ ​there​ ​is​ ​an​ ​unfair_person​ ​who​ ​tells​ ​​ ​false​ ​60%​ ​of​ ​the​ ​times​ ​and​ ​truth​ ​40%​ ​of​ ​the
times.​ ​Given​ ​this​ ​information​ ​what​ ​thus​ ​the​ ​below​ ​function​ ​will​ ​tell.
Ans:​ ​normal​ ​human​ ​is​ ​a​ ​fair​ ​person
14.​ ​Let​ ​A,​ ​B,​ ​C,​ ​D​ ​are​ ​stationary​ ​points.​ ​Srikanth​ ​standing​ ​at​ ​A​ ​starts​ ​walking.​ ​He​ ​walks​ ​4Km
North-East​ ​to​ ​B,​ ​then​ ​starts​ ​moving​ ​South.​ ​He​ ​walks​ ​18Km​ ​South,​ ​then​ ​turns​ ​towards​ ​right​ ​and
walks​ ​7Km.​ ​He​ ​then​ ​turns​ ​left​ ​and​ ​walks​ ​6​ ​Km​ ​to​ ​point​ ​C.​ ​What​ ​is​ ​the​ ​distance​ ​between​ ​C​ ​and
B?(in​ ​Km)
Ans:​ ​25
15.​ ​Consider​ ​a​ ​hash​ ​table​ ​of​ ​size​ ​‘n’​ ​and​ ​keys​ ​are​ ​ranging​ ​from​ ​0​ ​to​ ​n^2​ ​-​ ​1.​ ​What​ ​is​ ​the
maximum​ ​number​ ​of​ ​distinct​ ​keys​ ​can​ ​be​ ​placed​ ​in​ ​the​ ​hash​ ​table​ ​using​ ​Chaining​ ​method?
Ans:​ ​n^2
16.​ ​Consider​ ​the​ ​following​ ​expression​ ​with​ ​infix​ ​notation:​ ​20*64​ ​-(14​ ​+​ ​98)*(19/65)^51.​ ​What​ ​is
the​ ​maximum​ ​size​ ​of​ ​operator​ ​stack​ ​during​ ​the​ ​conversion​ ​from​ ​infix​ ​to​ ​postfix?
Ans:​ ​4
17.​ ​Given​ ​a​ ​number​ ​P=​ ​12345678910111213...585960​ ​(concatenation​ ​of​ ​first​ ​sixty​ ​positive
natural​ ​numbers).Remove​ ​any​ ​100​ ​digits​ ​from​ ​P​ ​and​ ​without​ ​changing​ ​the​ ​order​ ​of​ ​the
remaining​ ​digits,​ ​and​ ​call​ ​the​ ​resulting​ ​number​ ​as​ ​Q.​ ​What​ ​is​ ​the​ ​largest​ ​possible​ ​value​ ​of​ ​Q?
Ans:​ ​99999785960
18.​ ​What​ ​is​ ​the​ ​value​ ​of​ ​following​ ​recurrence​ ​relation?
Ans:​ ​O(√n​ ​*​ ​logn)
19.​ ​Which​ ​function​ ​among​ ​fun1(),​ ​fun2()​ ​will​ ​be​ ​executed​ ​first?
Ans:​ ​Unspecified
20.​ ​Which​ ​term​ ​should​ ​replace​ ​the​ ​question​ ​mark​ ​in​ ​the​ ​following​ ​series?
450,​ ​180,​ ​90,​ ​60,​ ​?,​ ​120
Ans:​ ​60
21.​ ​Consider​ ​2​ ​arrays​ ​L1,​ ​L2​ ​of​ ​sizes​ ​"n"​ ​and​ ​"m"​ ​respectively.​ ​The​ ​elements​ ​of​ ​L1​ ​are​ ​inserted
into​ ​an​ ​AVL​ ​tree,​ ​then​ ​the​ ​elements​ ​of​ ​L2​ ​are​ ​searched​ ​for​ ​and​ ​deleted​ ​if​ ​the​ ​element​ ​found
from​ ​the​ ​AVL​ ​tree.​ ​The​ ​procedure​ ​returns​ ​1​ ​if​ ​and​ ​only​ ​if​ ​every​ ​element​ ​of​ ​L2​ ​was​ ​found​ ​in​ ​the
tree,​ ​and​ ​the​ ​tree​ ​is​ ​empty​ ​after​ ​the​ ​elements​ ​of​ ​L2​ ​are​ ​removed.​ ​What​ ​is​ ​the​ ​worst​ ​case​ ​time
complexity​ ​implemented​ ​using​ ​AVL​ ​tree?
Ans:​ ​O((m+n)logn)
22.​ ​A​ ​box​ ​contains​ ​three​ ​coins:​ ​two​ ​regular​ ​coins​ ​and​ ​one​ ​two-headed​ ​coin​ ​(P(H)​ ​=​ ​1).You​ ​pick
a​ ​coin​ ​at​ ​random​ ​and​ ​toss​ ​it.​ ​What​ ​is​ ​the​ ​probability​ ​that​ ​it​ ​lands​ ​heads​ ​up?
Ans:​ ​⅔
23.​ ​Let​ ​us​ ​take​ ​4​ ​Matrices​ ​​ ​A1,​ ​A2,​ ​A3​ ​and​ ​A4​ ​of​ ​dimensions​ ​a​ ​×​ ​b,​ ​b​ ​×​ ​c,​ ​c​ ​×​ ​d​ ​and​ ​d​ ​×​ ​e
respectively.​ ​They​ ​can​ ​be​ ​multiplied​ ​in​ ​several​ ​ways​ ​with​ ​different​ ​number​ ​of​ ​total​ ​scalar
multiplications.​ ​For​ ​example​ ​when​ ​multiplied​ ​as​ ​(((A1​ ​×​ ​A2)​ ​×​ ​A3)​ ​×​ ​A4),​ ​the​ ​total​ ​number​ ​of
scalar​ ​multiplications​ ​is​ ​abc​ ​+​ ​acd​ ​+​ ​ade.​ ​When​ ​multiplied​ ​as​ ​((A1​ ​×​ ​A2)​ ​×​ ​(A3​ ​×​ ​A4)),​ ​the​ ​total
number​ ​of​ ​multiplications​ ​is​ ​abc​ ​+​ ​cde​ ​+​ ​ace.​ ​Find​ ​​ ​the​ ​minimum​ ​number​ ​of​ ​scalar​ ​multiplications
needed​ ​when​ ​​ ​a​ ​=​ ​1,​ ​b​ ​=​ ​2,​ ​c​ ​=​ ​3,​ ​d​ ​=​ ​4​ ​and​ ​e​ ​=​ ​5.
Ans:​ ​38
24.​ ​Consider​ ​the​ ​following​ ​keys​ ​that​ ​are​ ​hashed​ ​into​ ​the​ ​hash​ ​table​ ​in​ ​the​ ​below​ ​order​ ​using​ ​​ ​a
hash​ ​function​ ​H(k)=​ ​(k​ ​+​ ​8)​ ​mod​ ​11.​ ​Find​ ​the​ ​location​ ​of​ ​an​ ​element​ ​10,​ ​if​ ​the​ ​hashing​ ​uses
linear​ ​probing.
42,​ ​22,​ ​1,​ ​0,​ ​14,​ ​30,​ ​3,​ ​6,​ ​10,​ ​2,​ ​8
Ans:​ ​7​ ​(there​ ​was​ ​a​ ​typo​ ​error,​ ​for​ ​that​ ​we​ ​have​ ​given​ ​marks​ ​to​ ​all​ ​the​ ​students​ ​who​ ​have
attempted​ ​the​ ​test.)
25:​ ​Which​ ​of​ ​the​ ​following​ ​statements​ ​will​ ​invoke​ ​unspecified​ ​behavior​ ​?
Ans:​ ​z=x++​ ​+​ ​y++
26.​ ​Find​ ​the​ ​total​ ​number​ ​of​ ​inversions​ ​possible​ ​for​ ​the​ ​given​ ​array​ ​A[​ ​]={30,​ ​16,​ ​50,​ ​31,​ ​24,​ ​27,
33}.​ ​(Inversion​ ​:​ ​Two​ ​elements​ ​A[i]​ ​and​ ​A[j]​ ​form​ ​an​ ​inversion​ ​if​ ​A[i]​ ​>​ ​A[j]​ ​and​ ​i<j)
Ans:​ ​9
27.​ ​Triangle​ ​number​ ​is​ ​defined​ ​as​ ​tri(n)​ ​=​ ​n(n+1)/2​ ​and​ ​the​ ​number​ ​of​ ​divisors​ ​of​ ​tri(n)​ ​is​ ​defined
as​ ​the​ ​dtri(n).​ ​what​ ​is​ ​the​ ​value​ ​of​ ​dtri(1024)=______
Ans:​ ​60
28.​ ​You​ ​are​ ​given​ ​16​ ​gold​ ​coins​ ​and​ ​a​ ​balance​ ​scale.​ ​Weights​ ​of​ ​all​ ​coins​ ​are​ ​distinct​ ​but​ ​similar
in​ ​when​ ​we​ ​see.​ ​A​ ​balance​ ​scale​ ​is​ ​used​ ​for​ ​weighing​ ​​ ​only​ ​two​ ​coins​ ​at​ ​a​ ​time.​ ​Our​ ​objective​ ​is
to​ ​pick​ ​up​ ​the​ ​top​ ​two​ ​maximum​ ​weighted​ ​coins.​ ​What​ ​is​ ​the​ ​minimum​ ​number​ ​of​ ​times​ ​that​ ​you
can​ ​use​ ​the​ ​balance​ ​scale​ ​to​ ​get​ ​those​ ​two​ ​maximum​ ​weighted​ ​coins​ ​are​ ​_____
Ans:​ ​18
29.​ ​Two​ ​fair​ ​dice​ ​are​ ​rolled​ ​and​ ​it​ ​is​ ​revealed​ ​that​ ​one​ ​of​ ​the​ ​numbers​ ​rolled​ ​was​ ​a​ ​4.​ ​What​ ​is​ ​the
probability​ ​that​ ​the​ ​other​ ​number​ ​rolled​ ​was​ ​a​ ​6?​ ​​ ​(Note:​ ​You​ ​are​ ​not​ ​told​ ​which​ ​of​ ​the​ ​numbers
rolled​ ​is​ ​a​ ​4).
Ans:​ ​2/11
30.​ ​Consider​ ​an​ ​input​ ​string​ ​of​ ​length​ ​n​ ​which​ ​consists​ ​of​ ​digits​ ​from​ ​1​ ​to​ ​9.​ ​What​ ​is​ ​the​ ​efficient
time​ ​complexity​ ​to​ ​find​ ​maximum​ ​occurring​ ​digit​ ​in​ ​the​ ​given​ ​input​ ​string.
Ans:​ ​O(n)

Internship exam round1

  • 1.
    1. There​ ​are​​11​ ​points​ ​in​ ​a​ ​plane​ ​of​ ​which​ ​no​ ​three​ ​points​ ​are​ ​in​ ​a​ ​straight​ ​line​ ​except​ ​5 points​ ​which​ ​are​ ​all​ ​in​ ​a​ ​straight​ ​line.​ ​How​ ​many​ ​quadrilaterals​ ​can​ ​be​ ​formed​ ​with​ ​the​ ​given points​ ​as​ ​vertices​ ​is? Ans:​ ​265 2.​ ​Consider​ ​the​ ​box​ ​contains​ ​32​ ​bulbs​ ​of​ ​which​ ​15​ ​Red,​ ​10​ ​Blue,​ ​5​ ​White,​ ​1Yellow,​ ​1​ ​Orange. Ramu​ ​picks​ ​a​ ​bulb​ ​randomly​ ​from​ ​a​ ​box,​ ​and​ ​messages​ ​to​ ​lakshman​ ​about​ ​its​ ​color​ ​using​ ​string of​ ​0’s​ ​and​ ​1’s.​ ​Ramu​ ​replaces​ ​the​ ​bulb​ ​in​ ​the​ ​box,​ ​and​ ​repeats​ ​the​ ​same​ ​experiment​ ​many times.​ ​What​ ​is​ ​the​ ​expected​ ​minimum​ ​length​ ​of​ ​the​ ​message​ ​that​ ​Ramu​ ​has​ ​to​ ​convey​ ​to Lakshman? Ans:​ ​58/32 3.​ ​Let​ ​a​ ​queue​ ​is​ ​implemented​ ​using​ ​a​ ​circular​ ​array​ ​with​ ​9​ ​elements​ ​in​ ​the​ ​queue​ ​stored​ ​at data[11]​ ​through​ ​data[19].​ ​The​ ​maximum​ ​size​ ​of​ ​the​ ​queue​ ​is​ ​30.​ ​Where​ ​does​ ​the​ ​enqueue member​ ​function​ ​place​ ​the​ ​new​ ​entry​ ​in​ ​the​ ​array? Ans:​ ​20 4.​ ​Shikar,​ ​Dhoni​ ​and​ ​Rohit​ ​are​ ​visiting​ ​the​ ​Kohli’s​ ​family​ ​who​ ​are​ ​staying​ ​200​ ​km​ ​away.​ ​Each​ ​of their​ ​walking​ ​speeds​ ​is​ ​10​ ​kmph.​ ​Initially,​ ​Dhoni​ ​and​ ​Rohit​ ​travel​ ​in​ ​a​ ​car​ ​at​ ​the​ ​rate​ ​of​ ​50​ ​kmph and​ ​Shikar​ ​walks​ ​the​ ​distance.​ ​After​ ​a​ ​while,​ ​Rohit​ ​gets​ ​off​ ​the​ ​car​ ​as​ ​he​ ​feels​ ​nauseated​ ​and walks​ ​the​ ​rest​ ​of​ ​the​ ​distance​ ​to​ ​the​ ​house.​ ​Dhoni​ ​goes​ ​back​ ​in​ ​the​ ​car​ ​to​ ​fetch​ ​Shikar​ ​and​ ​they all​ ​reach​ ​the​ ​house​ ​at​ ​the​ ​same​ ​time.​ ​What​ ​was​ ​the​ ​entire​ ​time​ ​involved​ ​in​ ​travelling(in​ ​hours)? Ans:​ ​4 5.​ ​In​ ​a​ ​connected​ ​weighted​ ​graph​ ​with​ ​1000​ ​vertices​ ​,​ ​What​ ​is​ ​the​ ​maximum​ ​number​ ​of minimum​ ​weighted​ ​spanning​ ​trees​ ​in​ ​the​ ​graph?​ ​(Assume​ ​all​ ​the​ ​edges​ ​have​ ​distinct​ ​positive integer​ ​weights) Ans:​ ​1 6.​ ​Choose​ ​the​ ​correct​ ​answer​ ​from​ ​the​ ​following? Ans:​ ​S1:​ ​True,​ ​S2:​ ​False,​ ​S3:​ ​False
  • 2.
    7.​ ​Consider​ ​any​​six​ ​distinct​ ​positive​ ​integers​ ​a1,​ ​a2,​ ​a3,​ ​a4,​ ​a5,​ ​a6.​ ​Find​ ​out​ ​the​ ​number​ ​of maximum​ ​distinct​ ​primes​ ​that​ ​can​ ​be​ ​formed​ ​by​ ​the​ ​pairwise​ ​sums​ ​of​ ​{a1,​ ​a2,​ ​a3,​ ​a4,​ ​a5,​ ​a6}? Ans:​ ​9 8.​ ​What​ ​is​ ​the​ ​number​ ​of​ ​Max​ ​Heaps​ ​possible​ ​in​ ​which​ ​the​ ​numbers​ ​14,​ ​24,​ ​39,​ ​59,​ ​100​ ​can​ ​be inserted​ ​into​ ​a​ ​Binary​ ​Heap​ ​such​ ​that​ ​resulted​ ​binary​ ​heap​ ​is​ ​a​ ​Max​ ​Heap? Ans:​ ​8 9.​ ​5​ ​men​ ​and​ ​3​ ​women​ ​together​ ​can​ ​complete​ ​a​ ​piece​ ​of​ ​work​ ​in​ ​6​ ​days.​ ​The​ ​work​ ​done​ ​by​ ​a man​ ​in​ ​one​ ​day​ ​is​ ​double​ ​the​ ​work​ ​done​ ​by​ ​a​ ​woman​ ​in​ ​one​ ​day.​ ​If​ ​4​ ​men​ ​and​ ​3​ ​women​ ​started working​ ​and​ ​after​ ​3​ ​days,​ ​​ ​​ ​2​ ​men​ ​left​ ​and​ ​2​ ​women​ ​joined,​ ​in​ ​how​ ​many​ ​more​ ​days​ ​will​ ​the​ ​work be​ ​completed? Ans:​ ​5 10:​ ​You​ ​are​ ​in​ ​a​ ​game​ ​show!​ ​There​ ​are​ ​10​ ​closed​ ​doors,​ ​0​ ​leads​ ​to​ ​nothing​ ​and​ ​1​ ​leads​ ​to​ ​an expensive​ ​sports​ ​car.​ ​You​ ​are​ ​allowed​ ​to​ ​pick​ ​a​ ​door​ ​and​ ​earn​ ​the​ ​sports​ ​car​ ​if​ ​it’s​ ​behind​ ​the door​ ​you​ ​choose.​ ​You​ ​choose​ ​a​ ​door​ ​and​ ​the​ ​host​ ​tells​ ​you​ ​he​ ​was​ ​preauthorized​ ​to​ ​make​ ​your chance​ ​of​ ​winning​ ​better!​ ​You​ ​have​ ​two​ ​options.​ ​Option​ ​1:​ ​Get​ ​the​ ​right​ ​to​ ​open​ ​two​ ​doors​ ​and win​ ​if​ ​the​ ​car​ ​is​ ​behind​ ​either​ ​of​ ​the​ ​ones​ ​you​ ​open.​ ​Option​ ​2:​ ​Have​ ​the​ ​host​ ​open​ ​5​ ​empty​ ​doors [None​ ​of​ ​them​ ​the​ ​one​ ​you​ ​had​ ​choose]​ ​and​ ​then​ ​get​ ​the​ ​right​ ​to​ ​switch​ ​if​ ​you​ ​want.​ ​If​ ​you​ ​want to​ ​win​ ​the​ ​car,​ ​what​ ​should​ ​you​ ​do? Ans:​ ​Go​ ​with​ ​option​ ​2​ ​and​ ​switch 11.​ ​How​ ​many​ ​four​ ​digit​ ​numbers​ ​can​ ​be​ ​formed​ ​using​ ​the​ ​digits​ ​1,​ ​2,​ ​4,​ ​6,​ ​7​ ​and​ ​9​ ​such​ ​that each​ ​number​ ​is​ ​divisible​ ​by​ ​3​ ​but​ ​not​ ​by​ ​9?​ ​(Repetition​ ​of​ ​digits​ ​is​ ​not​ ​allowed) Ans:​ ​72
  • 3.
    12.​ ​Find​ ​the​​time​ ​complexity​ ​for​ ​the​ ​following​ ​program Ans:​ ​O(n*k)​ ​where​ ​k​ ​is​ ​the​ ​number​ ​of​ ​bits​ ​to​ ​represent​ ​the​ ​number​ ​‘n’ 13.​ ​consider​ ​there​ ​is​ ​an​ ​unfair_person​ ​who​ ​tells​ ​​ ​false​ ​60%​ ​of​ ​the​ ​times​ ​and​ ​truth​ ​40%​ ​of​ ​the times.​ ​Given​ ​this​ ​information​ ​what​ ​thus​ ​the​ ​below​ ​function​ ​will​ ​tell. Ans:​ ​normal​ ​human​ ​is​ ​a​ ​fair​ ​person
  • 4.
    14.​ ​Let​ ​A,​​B,​ ​C,​ ​D​ ​are​ ​stationary​ ​points.​ ​Srikanth​ ​standing​ ​at​ ​A​ ​starts​ ​walking.​ ​He​ ​walks​ ​4Km North-East​ ​to​ ​B,​ ​then​ ​starts​ ​moving​ ​South.​ ​He​ ​walks​ ​18Km​ ​South,​ ​then​ ​turns​ ​towards​ ​right​ ​and walks​ ​7Km.​ ​He​ ​then​ ​turns​ ​left​ ​and​ ​walks​ ​6​ ​Km​ ​to​ ​point​ ​C.​ ​What​ ​is​ ​the​ ​distance​ ​between​ ​C​ ​and B?(in​ ​Km) Ans:​ ​25 15.​ ​Consider​ ​a​ ​hash​ ​table​ ​of​ ​size​ ​‘n’​ ​and​ ​keys​ ​are​ ​ranging​ ​from​ ​0​ ​to​ ​n^2​ ​-​ ​1.​ ​What​ ​is​ ​the maximum​ ​number​ ​of​ ​distinct​ ​keys​ ​can​ ​be​ ​placed​ ​in​ ​the​ ​hash​ ​table​ ​using​ ​Chaining​ ​method? Ans:​ ​n^2 16.​ ​Consider​ ​the​ ​following​ ​expression​ ​with​ ​infix​ ​notation:​ ​20*64​ ​-(14​ ​+​ ​98)*(19/65)^51.​ ​What​ ​is the​ ​maximum​ ​size​ ​of​ ​operator​ ​stack​ ​during​ ​the​ ​conversion​ ​from​ ​infix​ ​to​ ​postfix? Ans:​ ​4 17.​ ​Given​ ​a​ ​number​ ​P=​ ​12345678910111213...585960​ ​(concatenation​ ​of​ ​first​ ​sixty​ ​positive natural​ ​numbers).Remove​ ​any​ ​100​ ​digits​ ​from​ ​P​ ​and​ ​without​ ​changing​ ​the​ ​order​ ​of​ ​the remaining​ ​digits,​ ​and​ ​call​ ​the​ ​resulting​ ​number​ ​as​ ​Q.​ ​What​ ​is​ ​the​ ​largest​ ​possible​ ​value​ ​of​ ​Q? Ans:​ ​99999785960 18.​ ​What​ ​is​ ​the​ ​value​ ​of​ ​following​ ​recurrence​ ​relation? Ans:​ ​O(√n​ ​*​ ​logn) 19.​ ​Which​ ​function​ ​among​ ​fun1(),​ ​fun2()​ ​will​ ​be​ ​executed​ ​first? Ans:​ ​Unspecified
  • 5.
    20.​ ​Which​ ​term​​should​ ​replace​ ​the​ ​question​ ​mark​ ​in​ ​the​ ​following​ ​series? 450,​ ​180,​ ​90,​ ​60,​ ​?,​ ​120 Ans:​ ​60 21.​ ​Consider​ ​2​ ​arrays​ ​L1,​ ​L2​ ​of​ ​sizes​ ​"n"​ ​and​ ​"m"​ ​respectively.​ ​The​ ​elements​ ​of​ ​L1​ ​are​ ​inserted into​ ​an​ ​AVL​ ​tree,​ ​then​ ​the​ ​elements​ ​of​ ​L2​ ​are​ ​searched​ ​for​ ​and​ ​deleted​ ​if​ ​the​ ​element​ ​found from​ ​the​ ​AVL​ ​tree.​ ​The​ ​procedure​ ​returns​ ​1​ ​if​ ​and​ ​only​ ​if​ ​every​ ​element​ ​of​ ​L2​ ​was​ ​found​ ​in​ ​the tree,​ ​and​ ​the​ ​tree​ ​is​ ​empty​ ​after​ ​the​ ​elements​ ​of​ ​L2​ ​are​ ​removed.​ ​What​ ​is​ ​the​ ​worst​ ​case​ ​time complexity​ ​implemented​ ​using​ ​AVL​ ​tree? Ans:​ ​O((m+n)logn) 22.​ ​A​ ​box​ ​contains​ ​three​ ​coins:​ ​two​ ​regular​ ​coins​ ​and​ ​one​ ​two-headed​ ​coin​ ​(P(H)​ ​=​ ​1).You​ ​pick a​ ​coin​ ​at​ ​random​ ​and​ ​toss​ ​it.​ ​What​ ​is​ ​the​ ​probability​ ​that​ ​it​ ​lands​ ​heads​ ​up? Ans:​ ​⅔ 23.​ ​Let​ ​us​ ​take​ ​4​ ​Matrices​ ​​ ​A1,​ ​A2,​ ​A3​ ​and​ ​A4​ ​of​ ​dimensions​ ​a​ ​×​ ​b,​ ​b​ ​×​ ​c,​ ​c​ ​×​ ​d​ ​and​ ​d​ ​×​ ​e respectively.​ ​They​ ​can​ ​be​ ​multiplied​ ​in​ ​several​ ​ways​ ​with​ ​different​ ​number​ ​of​ ​total​ ​scalar multiplications.​ ​For​ ​example​ ​when​ ​multiplied​ ​as​ ​(((A1​ ​×​ ​A2)​ ​×​ ​A3)​ ​×​ ​A4),​ ​the​ ​total​ ​number​ ​of scalar​ ​multiplications​ ​is​ ​abc​ ​+​ ​acd​ ​+​ ​ade.​ ​When​ ​multiplied​ ​as​ ​((A1​ ​×​ ​A2)​ ​×​ ​(A3​ ​×​ ​A4)),​ ​the​ ​total number​ ​of​ ​multiplications​ ​is​ ​abc​ ​+​ ​cde​ ​+​ ​ace.​ ​Find​ ​​ ​the​ ​minimum​ ​number​ ​of​ ​scalar​ ​multiplications needed​ ​when​ ​​ ​a​ ​=​ ​1,​ ​b​ ​=​ ​2,​ ​c​ ​=​ ​3,​ ​d​ ​=​ ​4​ ​and​ ​e​ ​=​ ​5. Ans:​ ​38 24.​ ​Consider​ ​the​ ​following​ ​keys​ ​that​ ​are​ ​hashed​ ​into​ ​the​ ​hash​ ​table​ ​in​ ​the​ ​below​ ​order​ ​using​ ​​ ​a hash​ ​function​ ​H(k)=​ ​(k​ ​+​ ​8)​ ​mod​ ​11.​ ​Find​ ​the​ ​location​ ​of​ ​an​ ​element​ ​10,​ ​if​ ​the​ ​hashing​ ​uses linear​ ​probing. 42,​ ​22,​ ​1,​ ​0,​ ​14,​ ​30,​ ​3,​ ​6,​ ​10,​ ​2,​ ​8 Ans:​ ​7​ ​(there​ ​was​ ​a​ ​typo​ ​error,​ ​for​ ​that​ ​we​ ​have​ ​given​ ​marks​ ​to​ ​all​ ​the​ ​students​ ​who​ ​have attempted​ ​the​ ​test.) 25:​ ​Which​ ​of​ ​the​ ​following​ ​statements​ ​will​ ​invoke​ ​unspecified​ ​behavior​ ​? Ans:​ ​z=x++​ ​+​ ​y++ 26.​ ​Find​ ​the​ ​total​ ​number​ ​of​ ​inversions​ ​possible​ ​for​ ​the​ ​given​ ​array​ ​A[​ ​]={30,​ ​16,​ ​50,​ ​31,​ ​24,​ ​27, 33}.​ ​(Inversion​ ​:​ ​Two​ ​elements​ ​A[i]​ ​and​ ​A[j]​ ​form​ ​an​ ​inversion​ ​if​ ​A[i]​ ​>​ ​A[j]​ ​and​ ​i<j) Ans:​ ​9
  • 6.
    27.​ ​Triangle​ ​number​​is​ ​defined​ ​as​ ​tri(n)​ ​=​ ​n(n+1)/2​ ​and​ ​the​ ​number​ ​of​ ​divisors​ ​of​ ​tri(n)​ ​is​ ​defined as​ ​the​ ​dtri(n).​ ​what​ ​is​ ​the​ ​value​ ​of​ ​dtri(1024)=______ Ans:​ ​60 28.​ ​You​ ​are​ ​given​ ​16​ ​gold​ ​coins​ ​and​ ​a​ ​balance​ ​scale.​ ​Weights​ ​of​ ​all​ ​coins​ ​are​ ​distinct​ ​but​ ​similar in​ ​when​ ​we​ ​see.​ ​A​ ​balance​ ​scale​ ​is​ ​used​ ​for​ ​weighing​ ​​ ​only​ ​two​ ​coins​ ​at​ ​a​ ​time.​ ​Our​ ​objective​ ​is to​ ​pick​ ​up​ ​the​ ​top​ ​two​ ​maximum​ ​weighted​ ​coins.​ ​What​ ​is​ ​the​ ​minimum​ ​number​ ​of​ ​times​ ​that​ ​you can​ ​use​ ​the​ ​balance​ ​scale​ ​to​ ​get​ ​those​ ​two​ ​maximum​ ​weighted​ ​coins​ ​are​ ​_____ Ans:​ ​18 29.​ ​Two​ ​fair​ ​dice​ ​are​ ​rolled​ ​and​ ​it​ ​is​ ​revealed​ ​that​ ​one​ ​of​ ​the​ ​numbers​ ​rolled​ ​was​ ​a​ ​4.​ ​What​ ​is​ ​the probability​ ​that​ ​the​ ​other​ ​number​ ​rolled​ ​was​ ​a​ ​6?​ ​​ ​(Note:​ ​You​ ​are​ ​not​ ​told​ ​which​ ​of​ ​the​ ​numbers rolled​ ​is​ ​a​ ​4). Ans:​ ​2/11 30.​ ​Consider​ ​an​ ​input​ ​string​ ​of​ ​length​ ​n​ ​which​ ​consists​ ​of​ ​digits​ ​from​ ​1​ ​to​ ​9.​ ​What​ ​is​ ​the​ ​efficient time​ ​complexity​ ​to​ ​find​ ​maximum​ ​occurring​ ​digit​ ​in​ ​the​ ​given​ ​input​ ​string. Ans:​ ​O(n)