Infosys Paper2 - SmartInfo :: Think Smart

advertisement
*******************************************************************
INFOSYS
Technical Questions in the second round -1. If 1/4 of the time from midnight plus 1/2 of the time from now to midnight is the
present time,then what is the present time ?
2. In a 10 digit number, if the 1st digit number is the number of ones,2nd digit number is
the number of twos, and ... so on. 10th digit is the number of zeroes,then find the number
3. A train blows a siren one hour after starting from the station. After that it travels at
3/5th of its speed it reaches the next station 2 hours behind schedule. If it had a problem
50 miles farther from the previous case,it would have reached 40 minutes sooner. Find
the distance between the two stations .
4. An army 50 miles long marches at a constant rate. A courier standing at the rear moves
forward and delivers the message to the first person and then turns back and reaches the
rear of the army as the army completes 50 miles. Find the distance travelled by the
courier.
5. A person grows cabbage, he uses a larger square this year than previous year and
produces cabbages than previous year.what is the no. of cabbages produced this year
6. Olympic race :
4 contestants : Alan,charlie, Darren ,Brain.
There are two races and average is taken to decide the winner.one person comes at the
same position in both the race. Charlie always come before darren. Brian comes first
once. Alan comes third atleast once. Find the positions. Alan never comes last. Charlie &
darren comes 2nd atleast once.
8. Problem finding who is husband,wife & son from 4 set of families.
9. Rank the persons from set of conditions.
-------------------------------------------------------------------------------/* THIS FILE INCLUDES INFOSYS PAPERS FOR YEAR 2000 HELD AT IISc AND
NAGPUR.
*/
INFOSYS TEST @ IISC - 2000
1:there is a robery and four persons are suspected out of them one is
actual
thief,
these are the senteces said by each one of them!
A says D had done
B says A had done
C says i dddnt done
D B lied when he said that i am thief
out of these only one man is true remaining are false
ans C is thef,D is true!
maks 3
2 how many four digit numbers divisible by four can be formed using
1,2,3,4;repetions are not allowed!
ans 6;
marks 4
3 a vender solds two things at same cost 12 RS with one item at 25%profit
and other at 20%loss,by this transaction he made profit or loss by how
much
ans loss,60paise
marks 3
4 two friends A,B are running up hill and then to get down!
length if road is 440 yards A on his return journy met B goin up at
20 yards from top,A has finished the rase .5 minuit earlier than
B,then how much time A had taken to complete the rase.
ans 6.3 minuits
marks 4
5 barons question diagnostic test question 8-12,5 men and 5 women went for
foot ball match.........
marks 8
6 write a five digit number ,
which will be having two prime numbers,
and some two more conditions,like 1st digit greater than 2nd etc
its easy(remember one is not a prime number,most people don mistake
taking 1
as prime number)
ans 71842
5 marks
7 two employs were there
employ one says to employ two your work ezxperience twice as me
emp2 exactly
emp1 but two years before you said that your work experience is
thrice as me
emp2 yes its also true
what are their work experience
ans 4,8
marks 3
8 ther are four persons A,B,C,D and for languages english ,french
,german
italian,
conditions
1 only one language is spoken by more than two men
2 A dont know english
3 a man can speak either french or german but not both
4 all man cannot spek in a group(no common language)
5 A can mediate when B and C want to speak with each other
6 each men can speak two languages
ans
A french italian
B english french
C german italian
D german italian
marks 7
9 there are 3 women ,they having three jewells,named diamond emerald
,ruby
3 women A,B,C
3 thiefs D,E,F
each thef had taken one jewel from each of the women
following conditions
one who had taken diamond is the bachelor and most dangerous
D 's brother in law E who is less dangerous than the thief who had
-------------------------------------------------------------------stolen emerald
-------------(this is the key from this e had stolen ruby)
D did nt stolen from B
one more condition is there
marks 7
10 ther were five persons out of which two persons heir went white
and three persons hair is black
conditions
if A 's hir is white then B'hair is white
A,s hair is not blakck if C's hair is not black
two more conditions
but we can easily solve it from first codition
ans is Aand B's hair is white
marks 5
essay
in this age of super computer computer will repalce man!
what is contribution of industry towards humn growth
interview questions!
1 two time glases 7,4 how you measure 9
2 four persons have to cross the bridge they are having one torch
ligt
four persons take 1,2,5,10 minuits respectively ,
when two persons are going the will take the time of the slowest
person
whats the time taken to cross allof them
ans 17minuits
3 a non uniform rope burns for one hour how you will measure
half an hour
ans lit it from both sides!
BEST OF LUCK!
-----------------------------------------------------------------------INFOSYS TEST @ NAGPUR - 2000
questions
1. there were three suspects for a robbery that happend in a bank, tommy,
joy and bruceEach of them were saying that I haven't done anything and the
other two has done it.police found that tommy was lying .who is the thief.
3M (MARKS).
2. three clocks where set to true time .First run with the exact time
..second slows one minute/day. third gains one minute/day. after how many
days they will show true time. 3M.
3. A,B,C,D,E are some numbers.if AB * CD = EEE and CD - A =CC
THEN what is AB * D =? IN SAME CODE .5M.
4. Joe started from bombay towards pune and her friend julie in opposite
direction.they meet at a point .distance travelled by joe was 1.8 miles
more
than that of julie.after spending some both started there way.joe reaches
in
2 hours while julie in 3.5 hours.
Assuming both were travelling with constant speed.Wath is the distance
between the two cities. 5M.
5. In a six level building,a person lives .suppose the persons are
A,B,C,D,E,F. --- and there were few clues like--A cann't live above third level,
B cann't live above A and below C.-- i am recalling each.did u understood
the question-u have to find person living at each level. 5M
6. There were some containers of quantity 1,3,4,5,6,12,15,22,24,38
liters.each was filled with some liquid except one.the liquids are milk,
water and oil.quantity of each was like this
water = 2* milk
oil = 2* water
find out which container was empty and cantainers filled with milk and
oil.
6M
7. there were few diamonds.
1st thief takes half of the diamonds +2
2nd thief takes half of the diamonds +2
3rd thief takes half of the diamonds +2
4th thief takes half of the diamonds +2
when 5 th thief arives there were no diamonds. find total no. of diamonds.
(ans 60) 6M.
8. there were five hunters A,B,C,D,E and five animals A,B,C,D,E. Hunter
having the same name with the animal didn't kill it. Each hunter has
missed
some animal.
A animal was hunt by the hunter whose name matches with animal hunt by
hunter B.
C animal was hunt by the hunter whose name matches with animal hunt by
hunter D.
E has hunt C and missed D .find out animals hunted by A,B,C. 6m.
9. Five students A,B,C,D,E.
when conversation started B,C were speaking english.When D join them they
shifted to Spanish.A,E knows French .B,E knows Italian.Portoguese was
known
to there of them.Spanish was the most common language between them.
one of them knows five languages.
one of them knows four languages.
one of them knows there languages.
one of them knows two languages.
one of them knows only one languages.
A knows ? 4 options
B knows ? 4 options
C knows ? 4 options
E knows ? 4 options 8M
-----------------------------------------------------------------------WISH U ALL THE BEST.........
MAY ALL YOUR DREAMS COME TRUE !!!
-------------------------------------------------------------------------------Infosys Technologies ltd
Aptitude Test 9th july 2000
1.A boy picks up the phone and asks" who are you?"
The voice from the other side answers" I am your
mother's mother in law".What is the relation of the
boy with the fellow speaking at the other end.(3marks).
2.Imagine a rectangle.Its length=2*width.A square of 1
inch is cut on all corners so that the remaining portion
forms a boxwhen folded.the volume of the box is_____ cubic
inches.find the original dimensions of the box. (3 marks).
3.2 persons are doing part time job in a company9say a and b).
THe company is open for all the 7 days of the week.'A' works
every second day.'B' works every 3rd day.If 'A'works on 1st june
and 'B' works on 2nd june.Find out the date on which both 'A'
and 'B' will work together. (4 marks).
4.Consider a pile of Diamonds on a table.A thief enters and steals
1/2 of th e total quanity and then again 2 extra from the remaining.
After some time a second thief enters and steals 1/2 of the remaining+2.
Then 3rd thief enters and steals 1/2 of the remaining+2.Then 4th thief
enters and steals 1/2 of the remaining+2.When the 5th one enters
he finds 1 diamond on the table.Find out the total no. of diamonds
originally on the table before the 1st thief entered. (4 marks).
5.Imagine 4 persons A,B,C,D.(It is a strength determining game).
A found it hard,but could pull 'c' and 'd' to his side.
AC and BD pairs on opposite sides found themselves equally balanced.
When A and B exchanged thier positions to form pairs AD and BC ,BC pair
could
win and pull AD to thier side.Order the 4 persons in Ascending order
according to thier strengths. (3 marks).
6.Consider a beauty contest.3 persons participate.Their names are
Attractive,
Delectable,Fascinating.THere 3 tribes Pukkas,Wottas,Summas.
Pukkas - Always speak truth.
Wottas - Always speak lies.
Summas - Speak truth and lies alternatively.
Each of the 3 persons make 2 statements.
Attractive - (1)
(2)
Delectable - (1) i don't remember
(2)
Fascinating- (1)
(2)The person who speaks truth is the least beautiful
>From the statements they give and the character of the 3 tribal types,
find out which person belongs to which tribe.Also find out the persons
in the Ascending order of their beauty. (8 marks).
7.There are 5 positions-Clerk,Buyer,Cashier,Manager,Floorwalker.
THere are 5 persons- Mrs.Allen,Mrs.CLark,Twain,Ewing,Bernett.
Conditions: 1.clerk and cashier lunch time 11.30.to12.30
2.others 12.30 to 1.30
3.Mrs.Allen and Bernett play durind lunch time.
4.clerk and cashier share Bachler rooms.
5.Ewing and Twain are not in good terms because
one day when Twain retuned early from lunch
he saw Ewing already sitting fro lunch and reported
about him to the manager.
Find out which person holds which post. (8 marks).
8.There are 8 courses to be handled by faculty in 2 semesters.4 in 1st
semester and 4 in 2nd semester THe candiadates hired for the post are
k,l,m,n,o.The courses are Malvino,Shakespeare,Joyce,Chauncer...........
Some conditions will be given like.,
1.L and N handle Shakespeare and malvino.
2.M and O handle Malvino and Joyce.
3. .......
4.
..
.. i don't remember
..
8. ......
Only one author can handle a course in 1 semester.
then 3 questions were asked based on these information and
3 options for each question were given (8 marks).
9. I don't remember
10.I don't remember.
-------------------------------------------------------------------------------Here is theinfosys paper It may not contain full
questions and ans
Understand it
1. There are 4 married couples out ofwhich 3 a group
isneeded . Butther
should not be his of her spouse .How nmany groups are
possible ?
Ans 32
2.In the 4 digits 1,2,3,4 how many 4 digited numbers are
possible
which are divisable by 4? Repetetions are allowed
Ans 64
3. Twow men are goingalong a trackf rail in the opposite
direction.
One goods train crossed the first person in 20 sec.
After 10 min
the train crossed the other person who is commingin
opposite direction
in 18 sec .Afterthe train haspassed, when thetwo
persons will meet?
Approx 72min check it once.
4. Theno. of children adults . Theno .of adults the
no .of boys .
The no.of boys no. of girls .The no.of girls no.of
familyi conditions
1.No family is without a child
2 Every girl has atleast one brotherand sister .
Ans c a b g f; 9 6 5 4 3 .
6.There are4 boys Anand ,Anandya ,Madan and Murali with
nicmnames perich ,zomie ,drummy and madeena not in thesame
order
Some com=nditons
Ans Anand : Perich
Anandya: drummy
Madan : Zombie
murali: Madeena
7.Thereare2diomans ,1 spadeand1 club and 1ace and also 1king ,1
jack
and 1 aceare arranged in a straight line
1.The king is at third place
2.Theleft of jack is a heart and itsright is king
3. No two red colours arein consequtive.
4.The queensareseperated by two cards. Write the orderor which
suits
(hearts ,clubs )and names(jacks queensetc.)
8. Writeeach statementis true or false 8M
1.The sum of the1st three statements and the2nd false statement
givesthe true statement.
2.The no.oftrue statements falsestatement
3. The sum of2nd true statement and 1st falsestatement gives
the first
true statement.
4. Thereareatmost 3 falsestatements
5.There is no two consequtive true statements
6.If this containsonly 1-5 statements ,theanswer of this is
sameasthe an answer of the following question
9.Question on Venn diagram.
All handsome are also fair skinned
Sme musularsare fair skinned
Some musculars are also handsome
All lean are also muscular
Some lean are also fair skinned.
All rich man inot fair skinned but all rich manare handsome
Some questions follows.
10
There are 3 pileseach containe 10 15 20 stones. There are
A,B,C,D,F,G
and h persons .One man can catch upto four stones from any
pile.
The last manwho takeswill win. If first A starts next B. and
so on
who will win?
Ans May be F
Essay writing
1 Intrnet revolution
2.Media for youth
-------------------------------------------------------------------------------INFOSIS
------1. A person needs 6 steps to cover a distance of one slab.
if he increases his foot length(step length) by 3 inches he needs only
5 steps to cover the slabs length. what is the length of the each slab.
(ans 31 inches).
2. There are 19 red balls and one black ball . Ten balls are put in
one jar and the remaining 10 are put in another jar. what is the
possibility that the black is in the right jar.
( The question is bit of confusing but the answer is 1/2).
3. There is one lily in the pond on 1st june. There are two in the pond
on 2nd june . There are four on 3rd june and so on.
The pond is full with lilies by the end of the june.
(i)On which date the pond is half full.
ans. 29th. --the june has 30 days)
(ii)if we start with 2 lilies on 1st june when will be the pond be full
with lilies.
(ans. 29th june)
4.A lorry starts from Banglore to Mysore at 6.00 A.M,7.00am.8.00 am.....10 pm.
Similarly one another starts from Mysore to Banglore at 6.00 am,7.00 am,
8.00 am.....10.00pm. A lorry takes 9 hours to travel from Banglore to Mysore
and vice versa.
(i) A lorry which has started at 6.00 am will cross how many lorries.
(ans. 10 )
(ii)A lorry which had started at 6.00pm will cross how many lorries.
(ans. 14)
5 .A person meets a train at a railway station coming daily at a
particular time . One day he is late by 25 minutes, and he meets the train 5 k.m. before
the station. If his speed is 12 kmph, what is the speed of the train.
(ans. 60 kmph.)refer--Shakuntala devi book.
7. A theif steals half the total no of loaves of bread plus 1/2 loaf from a backery. A
second theif steals half the remaing no of loaves plus 1/2 loaf and so on. After the 5th
theif has stolen there are no more loaves left in the backery. What was the total no of
loaves did the backery have at the biggining.
(ans: 31).
8. A gardener plants 100 meters towards east, next 100 meters towards north,next 100
meters towards west. 98 meters towards east, 96 meters towards north and 96 meters
towards west, 94 meters towards south.
and 94 meters towards east and so on.
If a person walks between the trees what is the
total distance travelled by him before he reaches the center.
ans: |---------------|
||
||
|||
--------|- |
---------------------| 9. Long division:
example: 1089709/12 ?
ANALYTICAL
4 question---40 marks; 40 minutes;
-----------------------------------1. There are four women and 3 men. They play bridge one nigth. Find
widow among them.
Rules:
(i) wife and husand are never partners
ii wife and husand never play more than one game.
One nigth they played four games as follows;
1. ------ + ------ vs ------- + --------2. ------ + ------ vs ------- + --------3. ------ + --*--- vs ------- + --------4. ---*-- + ------ vs ------- + --------the woman are marked * above.
ans: refer problem 21. mind teasers by Summers.
2. There are 5 peoples; few of them speak true, few of them false.
Identify them.
3. & 4.th problems on Venn diagram
INFOSIS
------1. A person needs 6 steps to cover a distance of one slab. If he increases
his foot length (step length) by 3 inches he needs only 5 steps to cover the slabs length.
What is the length of the each slab.
(ans 31 inches).
3. There are 19 red balls and one black ball . Ten balls are put in one jar and the
remaining 10 are put in another jar. what is the possibility that the black in the right jar.
( The question is bit of confusing but the answer is 1/2).
3. There is one lily in the pond on 1st june. There are two in the pond on 2nd june . There
are four on 3rd june and so on.
The pond is full with lilies by the end of the june.
(i)On which date the pond is half full.
(ans. 29th. --the june has 30 days)
(ii)if we start with 2 lilies on 1st june when will be the pond be full with lilies.
(ans. 29th june)
4.A lorry starts from Banglore to Mysore at 6.00 A.M,7.00am.8.00 am.....10 pm.
Similarly one another starts from Mysore to Banglore at 6.00 am,7.00 am,
8.00 am.....10.00pm. A lorry takes 9 hours to travel from Banglore to Mysore and vice
versa.
(i) A lorry which has started at 6.00 am will cross how many lorries.
(ans. 10 )
(ii)Alorry which had started at 6.00pm will cross how many lorries.
(ans. 14)
5 .A person meets a train at a railway station coming daily at a
particular time . One day he is late by 25 minutes, and he meets the train 5 k.m. before
the station. If his speed is 12 kmph, what is the speed of the train.
(ans. 60 kmph.)refer--Shakuntala devi book.
7. A theif steals half the total no of loaves of bread plus 1/2 loaf from a backery. A
second theif steals half the remaing no of loaves plus 1/2 loaf and so on. After the 5th
theif has stolen there are no more loaves left in the backery. What was the total no of
loaves did the backery have at the biggining.
(ans: 31).
8. A gardener plants 100 meters towards east, next 100 meters towards north,next 100
meters towards west. 98 meters towards east, 96 meters towards north and 96 meters
towards west, 94 meters towards south.
and 94 meters towards east and so on.
If a person walks between the trees what is the
total distance travelled by him before he reaches the center.
ans: |---------------|
||
||
|||
--------|- |
---------------------| 9. Long division:
example: 1089709/12 ?
ANALYTICAL
4 question---40 marks; 40 minutes;
-----------------------------------1. There are four women and 3 men. They play bridge one nigth. Find
widow among them.
Rules:
(i) wife and husand are never partners
ii wife and husand never play more than one game.
One nigth they played four games as follows;
1. ------ + ------ vs ------- + --------2. ------ + ------ vs ------- + --------3. ------ + --*--- vs ------- + --------4. ---*-- + ------ vs ------- + --------the woman are marked * above.
ans: refer problem 21. miniagrames.
</pre></div>
<div><pre>
I received your paper.I am sending some of the Psychometric questions.
Do not bother much about this test.Be optimistic,While answering the
questions.There will be 150 questions in this section.The questions may
repeat with slight variation.Answer should be same.
1.You will be interested in social activities.
2.While going upstairs,you will move two steps at a time.
3.You will be making friendship with the same sex or with the
opposite sex also.
4.Your friends consider you as a leader in your group.
5.Peole think that you are serious mainded.
6.Sometimes you fell dull without any reason.
7.You are host or hostes for several parties.
8.Relatives come to your home and you will entertain them.
(Orey! Don't write your original opinion.You will try to get
out them .Isn't it?)
9.You will do work for long time without tireness.
10.In your company,you want to lead the organisation.
I have not received any mail from IITM.There is no time for them
to give a mail.waste fellows.There is no dynamism in their blood.I have
been waiting for the mail since three days.
Don't worry about telco.They will conduct interview and select
based on the CGPA.Come to the lab regularly.These are crucial days.You
know that TCS is visiting our campus on 3rd.That's my first company.Akka
had sent a rakhi for me.You might be received the same.What is the news?
What else?
send mail after receiving all the papers.
1.cv
2.critical reasoning
3.Psychometric
I know some 25 questions.
The technical comprises of 50 questions on C,Unix and windows.
The interview for us is on a later date.If the questions come for you
also,then intimate me.
1.const char *
char * const
What is the differnce between the above tow?.
2.In Unix inter process communication take place using?.
3.What are the files in /etc directory?.
4.About i-node numbers
5.Max relaxable permisssion value with out giving write permission
to others?.
6.About ln(linking)
7.A question on until
until (who |grep mary)
do
sleep(60)
done
8.Linking across directories?.
9.process id for kernell process
10.very first process created by kernell
11.function to repaint a window immediately?.
12.Function entry for DLL in win3.1
13.win 3.1 is a
14.win 3.1 supports which type of multi tasking?.
15.Message displayed when a window is destroyed
16.About fork()?
17.About send message and post message
18.Message to limit the size of window
19.System call executable binary file intoa process
20.About GDI object?.
21.API used to hide window
22.Initialize contents of a dialog?.
</pre></div>
<div><pre>
CV paper:
*****************************************************************
1-18 General (i) Data sufficiency
(ii) Analytical
(iii) Mathematics
19-45 C&UNIX
1. |x-a|=a-x Ans: (c) x<=a
2. There is six letter word VGANDA . How many ways you can arrange the
letters in the word in such a way that both the A's are together.
Ans : 120 (5x4!)
3. If two cards are taken one after another without replacing from
a pack of 52 cards what is the probability for the two cards be
queen. Ans : (4/52)*(3/51) (1/17)*(1/13)
4. 51 x 53 x ... x 59 ; symbols ! - factorial
^ - power of 2
(a) 99!/49! (b) (c) (d) (99! x 25!)/(2^24 x 49! x 51!)
5. The ratio fo Boys to Girls is 6:4. 60% of the boys and 40% of girls
take lunch in the canteen. What % of class takes lunch in canteen.
Ans : 52% (60/100)*60 + (40/100)*40
Data Sufficiency : a) only statement A is sufficent , B is not
b) only statemnet B
c) both are necessary
d) both are not sufficient.
6. X is an integer. Is X dvisible by 5?
A) 2X is divisible by 5.
B) 10X is divisible by 5.
Ans : A)
7. (A) Anna is the tallest girl
(B) Anna is taller than all boys.
(Q) . Is Anna the tallest in the class
Ans : c
8. maths question
9, 10 Analytical
Zulus always speak truth and Hutus always speak lies. There are
three persons A,B&C. A met B and says " I am a Zulu or I am Hutu".
We don't know what exactly he said. then B meets C and says to c
that " A is a Zulu ". Then C replied " No, A is a Hutu ".
How many Zulus are there ?
Ans 2( check)
10) Who must be a Zulu ?
Ans B (check)
11,12.13,14.
----------A father F has 5 sons, p,q,r,s,t. Not necessarly in this order. Two are of same age. The
eldest and youngest cannot be twins. T is elder
to r and younger to q and s has three older brothers
q) who are the twins? s,t
q) who is the oldest and youngest? q, (s&t)
q)
q)
15,16,17,18
---------There are 7 people who take a test among which M is the worst, R is
disqualified, P and S obtain same marks, T scores less than S and Q scores
less than P, N scores higher than every one.
Ans : N P S T Q R M (may be, just check) or N S P T Q R M
C & UNIX
-------19. What does chmod 654 stand for.
Ans : _rw_r_xr__
20. Which of following is used for back-up files?
(a) compress (b) Tar (c) make (d) all the above Ans : b
21 what does find command do ? Ans : search a file
22. what does " calloc" do?
Ans : A memory allocation and initialising to zero.
23 what does exit() do?
Ans : come out of executing programme.
24. what is the value of 'i'?
i=strlen("Blue")+strlen("People")/strlen("Red")-st
rlen("green")
Ans : 1
25. i=2
printf("%old %old %old %old ",i, i++,i--,i++);
Ans : check the answer.
26. Using pointer, changing A to B and B to A is Swapping the function
using two address and one temperory variable. a,b are address, t is
temporary variable. How function look like?
Ans : swap(int *, int *, int )
27. In 'o' how are the arguments passed?
ans : by value.
28. Find the prototype of sine function.
Ans : extern double sin(double)
29. Scope of a global variable which is declared as static?
ans : File
30. ASCII problem
i=..
ans : 6
31 .
32. what is the o/p
printf(" Hello \o is the world ");
Ans : Hello is the world.
33. Clarifying the concept addresses used over array ; ie changing
the address of a base element produces what error?
34. child process -- fork
child shell -- sh
35. Answer are lex 7 yacc & man read these things in UNIX
36. What is
int *p(char (*s)[])
Ans : p is a function which is returning a pointer to integer
************************************************************************
******************
M.B.T:paper pattern only
Section-1. Passage (10 min reading ,5 questions)
Section-2. English (error finding,15 questions)
Section-3. Number series (Letter series also)
Section-4. Analytical ability (5 questions)
Section-5 Numerical ability (additions,multiplications etc)
note: -marking 1:1
Intergraph:paper pattern only
________________________________
Analytical. 1.seating arrangement
2.Inferences
(Ref. GRE book)
C-language. 48 questions - 45 min.
1. Diff.between inlinefunction((++)-macns(c)
2. 3 to 4 questions on conditional operator :?:
3. Write a macro for sqaring no.
4. Trees -3 noded tree ( 4 to 5 questions fundamentals)
Maximum possible no.of arrnging these nodes
5. Arrange the nodes in depth first order
breadth first order
6. Linked lists Q) Given two statments
1. Allocating memory dynamiccaly
2. Arrays
Tree the above both and find the mistake
7. Pointers (7 to 8 questions) Schaum series
Pointer to functions, to arrays
4 statements ->meaning,syntax for another 4 statements
8. Booting-def(When you on the system the process that takes place is -----9. -----Type of global variable can be accessible from any where in the
working environment ( external global variable)
10. Which of the following can be accessed randomly
Ans. a. one way linked list
b. two way "
c. Arrays
d. Trees
11. Write a class for a cycle purchase(data items req.)
--------------------------------------------------------------------------------
MBT-1999-iit-delhi
ARTHAMATIC SECTION
(1) if a boat is moving in upstream with v1 km/hr and in the down
stream
it is moving with v2 km/hr then what is the speed of the stream.
ans: 13 check the values of v1 and v2 are given
to find ans (v+s = v1, v-s = v2 find the boat velocity)
(2) 0.75 * 0.75 * 0.75 - 0.001
-------------------------------0.75*0.75-0.075+0.01
(3) A can work done in 8 days
B can work three timesfaster than the A;
C can work five times faster asthe A;
ans : 8/9 it is correct place blindly.
(4) one answer is 200/3 % it is perfectly correct wecannot recollec
the prob. so place it blindly.
(5) A car is journied a certain distance in 7 hrs in forward journey
in the return journey increased speed 12km/hr takes the times 5 hrs.
what is the distance ans:210 it is perfect place blindly.
(6) instead of multiplying by 7 to a number dividing by 7 what is
the percentage of error
ans we dont know but he has gived 14 18 25 andsome answers less than
(7) x + 4 y
---------- relation between x and y is x/2y = 3/2 ie x = 3y find
the
x - 2y ratio ans: 7 place it blindly.
(8) a man buy a liquid by 12 lts and the mixture is of 20% liquid in
water
then he makes it in 30% mixture then what is the % of liquid with
water.
(9) if a man byes 1lt of milk for 12rs and mixes with 20% of water and
sels it for rs15 thgen what is percentage of gain
(10) A pipe can fill a tank in 30 min B can fill in 28 min then if 3/4
th
of tank can be filled by B pipe and after wards both are opened then
how much time is required by both the pipes to fill the tank
completely.
note: the values of A and B may slitely vary be ware.
(11) on an item a company gave 25% discount then they get 25% profit
if it gives 10% discount then what is the profit.
ans: 30% it is correct place blindly.
(12)
i will send the remaining problems if i get remembered o.k this section
contain 29 questions.
in fourth section.
1. All chairs laugh.
some birds laugh.
2. some green are blue
no blue is white.
3 all scientists are fools.
all fools are literates.
only these questions see rs agarwal reasoning verbal and nonverbal book
new edition asthe pagenumbers i already sended to you.
ansers he changed slitely see.
From two fig 6 questions regarding the
swimmers,girls,tennisplayers,tall and
second one on politicians,graduates,parliament members, both questions
are same given so mugup and go to exam and place blindly i already
sended the page numbers in previous mail.
series:(1) R,M,(..),F,D,(..)
ans: I,C
(2) (...),ayw,gec,mki,sqo ans: usq.
(3) 1,3,4,8,15,27, ans: 50
(4) 0,2,3,5,8,10,15,17,24,26,.. ans: 35
(5) 2,5,9,19,37,.. ans:75
these are the correct ansers place it blindly.
the figure series which i had already send in the earlier paper is
same and one extra qestion is their it is this type
box type in side the box line and dot.
this type see in the new edition rs agerwal a box is their
in the answer so try for question in rs agerwal
see rs agerwal for statements and assemptions questions.
cut off will be around 30 out of 105 Bso place only the known problems
so
place only correct problems.
the above 35 questions aare enough to qualify.
remaining questions if know exact answers then place .
otherwise simply leave it.
5 mtechs got selected for int.& only one from chem. got the
job.Interview is personal.small software technical ques.about language.
(This is from IITM)
MBT:
one to one negative marking is there.it is tough to qualify unless u
know the paper.totally there are 105 questions. 70 min.
three flow sheets------ 10 min.
sections are quantitative(23),analytical(about 20) ,series&venn
diagrams,logical(20) questions from a passage (about 10). time span for
each section is different.sit at the back so that u can turn pages if u
want.different colored papers are used.
for flow sheets
first one is relatively easy
1.u will be given conditions like
if a wins he gets 100 pts,if b wins he gets 50 pts etc
2.there is flow sheet& there are empty cells(4) at "yes' or 'no"
decision points.
3.for each cell 4 choices will be given which should be chosen by
following through initial conditions &flow sheet logic.
4.rem. -ve marking is there. no verbal questions.
rs aggarwals verbal& nonverbal book
verbal--pg. 254 pr. 53 to56(almost same)
246 eg.2
pg 104 exer.3a about 5to 6 series qu.are there.so do well
pg.354-355 8,13,
6th doubt
4 conclusions r there in all ques.
pg.115----qu.36
nonverbal----pg.5
41,54,108,145,158
241 is doubtful
--------------ans. to one quant. is 200/3 %
anals.....
1.six persons will be there.
killer,victim,hangman,judge,police,vitness
a,b, c,d,e,f
u have to match
conditions like,a is the last person to the victim alive,will be given
as
clues.so we can conclude that a is the killer.
this is an easy one .paragraph will be very big .don' worry
5 to 6 ques.
2.
5 persons will be there.
cashier, clerk,buyer,manager,floorwalker(check in info. paper for exact
ques.)
a,b,c,d,e will be their names.
conditions will be given&we have to match who is who
3 r women&2 r men in this
sample condition,
cashier&clerk if get married, b will be wise man
mrs.c husband has some business prob with manager
manager&cashier(or clerk) r classmates
etc. will be given
do quantitative qu. from back.....
data graphs on turnover,gross profit &net profit will be given&
u have to extract data from that &find out few ratios.(easy one)
-------------------------------------------------------------------------------mumbai99:--->>>>
----------------------------------------------------------------------------This
I) Distribution of workers in a factory according to the no.of
children they have
Figure
1. Total no. of workers in the factory.
Ans : 200
2. Total no. of children that all the workers that have between them is
Ans : 560
3. The total no. of literate workers is
Ans : 105
4. The ratio of literate & illiterate is
Ans - 1:2
5. The no. of literate workers with atleast 3 children is
Ans : 45
6. The no. of illiterate workers with less than 4 children is
Ans : 60
7. The rate of literate to illiterate workers who have 3 children is
Ans - 3:4
II) Which of the following statement(s) is(are) not true
a. Literate workers have small families than illiterate workers.
b. Families with 2 or less than 2 children are commoner than families
with 3 or more children.
c. 2 children families constitute 60% of the families of workers.
d. More the no. of children a worker has the more illiterate he is.
e. None the above statement is true.
Ans : e
III) ---- of a mutual instrument vibrate 6,8 & 12 intervals
respectively. If all three vibrate together what is the time
interval before all vibrate together again?
LCM of NR
--------- Ans : 1/2 sec
HCF of DR
12) Certain no. of men can finish a piece of work in 10 days. If
however there were 10 men less it will take 10 days more for the
work to be finished. How many men were there originally.
Ans : 110 men
10) In simple interest what sum amounts of Rs.1120/- in 4 years and
Rs.1200/- in 5 years.
Ans : Rs.800/vi) Sum of money at compound interest amounts of thrice itself in 3
years. In how many years
will it take 9 times itself.
Ans : 6
vii) Two trains in the same direction at 50 & 32 kmph respectively. A
man in the slower train observes the 15 seconds elapse before the
faster train completely passes him.
What is the length of faster train ?
Ans : 75m
16) How many mashes are there in a sq. m of wire gauge. Each mesh
being 8mm long X 5mm width
Ans : 25000
17) x% of y is y% of ?
Ans : x
11) The price of sugar increases by 20%, by what % house-wife should
reduce the consumption of sugar so that expenditure on sugar can be
same as before
Ans : 16.66
? ) A man spending half of his salary for house hold expenses, 1/4th
for rent, 1/5th for travel expenses, a man deposits the rest in a
bank. If his monthly deposits in the bank amount 50. What is his
monthly salary ?
Ans : 1000
? ) The population of a city increases @ 4% p.a. That is an additioanl
annual increase of 4% of the population due to this influx of job
seekers, the % increase in population after 2 years is
Ans :
? ) The ratio of no. of boys & girls in a school is 3:2 Out of these
?% the boys & 25% of girls are scholarship holders. % of students who
are not scholarship holders.?
Ans :
? ) 15 Men take 21 days of 8 hrs. each to do a piece of work. How many
days of 6 hrs. each would do if 21 women take. If 3 women do as much
work of 2 men.
Ans : 30
?) a cylinder ingot 6cms in diameter and 6 cms in height is and
spheres all of the same
size are made from the material obtained.what is the diameter of each
sphere?
Ans :3cms
5) rectangular plank of sqrt(2)meters wide can be placed so that it is
on either side of the diagonal of a square shown below.what is the
area of the plank?
Ans :7sqrt(2)
fig no7) the difference b/w the compound interest payble half yearly and
the simple interest on a
certain sum cont out at 10% p.a for 1 year is Rs 25 what is the sum
Ans:10,000
8) what is the smallest n0 by which 2880 must be divided in order to
make it a
perfect square ?
Ans : c
a)3 b)4 c)5 d) 6 e)8
9)a father is 30 times more than his son however he will be only
thrice as old as the son
what is father's present age ?
Ans : 40
10) An article sold at a profit of 20% if both the c.p & s.p were to
be Rs.20/- the profit would be 10% more. What is the c.p of that
article?
Ans : 1% loss
************************************************************************
************************
PROBLEM 1:
Srini's Web Collections
Programming Problems
1) Reversing a linked list. Given a linked list, reverse it. Input must be read from a file,
"list.dat". It will just be a list of integers. The total number is not known. The program
should create a linked list with the given numbers in the same order. Each node contains
the value and a pointer to the next node of the list. Defining just TWO additional node
pointers you must inverse the given list and print out the numbers in the list. NO OTHER
VARIABLE of any type should be defined. Hence the output will be reverse of the input.
eg. Input file reads, 3 1 4 2 Linked list will be, Head -> 3 -> 1 -> 4 -> 2 -> Null the the
reversed list must be, Null <- 3 <- 1 <- 4 <- 2 <- Head So the output will be, 2,4,1,3.
-------------------------------------------------------------------------------Algo :
1) Reversing a linked list. Simple. Use two new pointer p, q and the head thats already
available. Invert the first three nodes and keep iterating along the list. Else use recursion.
-------------------------------------------------------------------------------2) Koch curve
Write a code to generate the (nasent) Koch curve. A (nasent) koch curve is drawn
iteratively. At any iteration the curve is a set of straight lines. In every iteration each line
from the previous iteration is split into three parts and the middle part is replaced with
two sides of the equilateral triangles in which the middle part is the third side. You start
with a straight line ______. (0,0)-(90,0) In the next iteration you get four lines __/\__
(0,0)-(30,0), (30,0)-(45,15*sqrt(3)), (45,15*sqrt(3))-(60,0) and (60,0)-(90,0) In the next
iteration you apply the same division tecnique to all the four line segemetns (0,0)-(30,0),
(30,0)-(45,15*sqrt(3)), (45,15*sqrt(3))-(60,0) and (60,0)-(90,0). And so on... Generate the
points after n iterations starting with (0,0)-(x,0) Input: one integer for the number of
iterations, n and one float for x. n is typically 6 to 8 Output: All the points of the koch
curve after n iterations must be written to a file, "koch.dat" in order from left to right. Use
all float values. eg. n=1, x=90 0 0 30 0 45 25.98 60 0 90 0 Note: x and y co-ordinates
come alternately. A point occurs on two adjusent lines but is printed only once.
-------------------------------------------------------------------------------Algo :
2) Koch Curve. Sraight forward mathematical calculations gives the intermediate points.
Just add them to your data structure and keep iterating.
-------------------------------------------------------------------------------3) Enemies and boats.
A list of persons represented by numbers 1 to n are given along with their enemies in that
list. You must group them into two boats such that no person is in the same boat with his
enemy. Assume a solution exists. eg. 1's enemies 2,3 2's enemies 1 3's enemies (none) 4's
enemies 3 5's enemies 4,1 The groups will be 1,4 2,3,5 Input: Input should be read from a
file, "enemies.dat". First the number of persons in the list is given. Then the enemies for
each person is given, terminated by a zero. eg. for the discussed case, input will read 5 2
3 0 1 0 0 3 0 1 4 0 note: Numbers between third and fourth zeros are four's enemies.
Output: Output should be printed on the screen as two lines. First line is the list of people
on boat one and the next line is for boat two.
-------------------------------------------------------------------------------Algo :
3) Enemies and boats. Many people gave different algorithms but most didn't work. One
way of doing it is to put 1 in boat one, his enemies in boat two. See where 2 can be
placed. If you have an inevitable option take it. Else try both option by recursion.
-------------------------------------------------------------------------------4) Euler's knight tour.
Do an Euler knight's tour. A knight starts at one of the squares of the chessboard and
visits ALL the squares EXACTLY ONCE. Number the chessboard from 1 to 64 starting
from one corner and traversing row wise. Start at square one and visit all the squares.
Beware!! The brute force algorithm will burst out of memory! Output: Print out the
number of the squares the knight visits in the order they are visited.
-------------------------------------------------------------------------------Algo :
4) Euler's knight tour. The algorithm we had in mind was back tracking when you hit a
dead end. But we got a much better algo. Start a one corner. At every step try to go to a
corner if not possible try to go to a edge, otherwise goto some point. More generally goto
the sqaure with the minimum number of squares leading to it. This algo works terrifically
and gives instantaneous results.
-------------------------------------------------------------------------------5) Cows and bulls.
Write a program that plays "Cows and bulls". The user thinks of a number less than
10000, with no two digits identical (like 1234. numbers like 0875 are allowed. But 5456
and 3922 are not because it contains 2 indentical digits). The program starts by guessing a
number. The user gives the number of hits and misses. A hit is a number in the right place
and a miss is a number in the wrong place. e.g If the the number you thought is 4273 the
feedback for 2135 is 0 hit 2 miss 0913 is 1 hit 0 miss 4217 is 2 hit 1 miss Your program
should use the feedback provided by the user for the next guess and keep guessing after
every feedback till it gets the right number. A good program will get the number in about
7 guesses (on an average).
-------------------------------------------------------------------------------Algo :
5) Cows and bulls. This requires some explaining because nobody got it. But actually its
not that difficult. You create an array of all possible numbers. Guess one randomly from
that list. Based on the feedback reduce your list eliminating the numbers that can't satisfy
the feedback. Guess again from the new list. You will hit the right number in 5 to 7 trys.
-------------------------------------------------------------------------------6) Knapsack problem.
A Sack is given with a specified volume. And a set of bags are given, each with a
specified mass and volume. You have to fill the sack using some of bags such that the
total volume of chosen bags is less than or equal to the volume of the sack and their total
mass is maximum. Input: Input will be read from a file called "bags.dat". It will contain
the number of bags, the volume of the sack, followed by the volume and the mass of the
bags. eg. 6 100 10 2 50 10 20 5 40 9 30 5 35 8 Output: Output should be printed on the
screen. It will be the number of all the bags to be used. For the given example it will be,
3,4,6
-------------------------------------------------------------------------------Algo :
6) Knapsack problem. This is a straight forward algorithm. Try all possible combinations
that satisfy the given volume constraint and choose the one with the maximum mass.
-------------------------------------------------------------------------------7) Zigzag An n by m matrix with all its elements between 1 to 4 is given. The left top
element(1,1) is 1 and right bottom element(m,n) is 4. You have to find out a continuous
zigzag path connecting these two elements, such that, 1)small parts of the zigzag are lines
connecting two elements. 2)The numbers in the zigzag path should read 1-2-3-4-1-2-34... 3)The zigzag must touch all squares. Assume a solution exists. Example : Given:
Solution should be: ;1 3 1 2 ;1 3 1-2 |/ \| | 2 1 4 3 2 1 4 3 / \ / 2 3 4 3 2-3 4 3 / /| 4 1 2 4; 41-2 4; Input: input should be read from a file called "matrix.dat". The file contains, row
no. column no. elements. eg. 4 4 1 3 1 2........ Output: Output should be printed on the
screen. Program should print out the row and column numbers of the elements in the
order they are visited. eg. (1,1) (2,1) (1,2) (2,3) .....
-------------------------------------------------------------------------------Algo :
7) Zigzag. Many people used brute force algorithms. Their code didn't work for a matrix
of order 8. One way to do this is to maintain a list of all possible ins and outs for every
square. Using the ins of the neigbouring nodes decrease the possible outs for every
square. Then use the neighbouring outs to decrease the ins of every square. Do this a few
times and you will get very near the solution. Then do a few check and you can get it.
-------------------------------------------------------------------------------8) Partitioning
You have "n" numbers having values from 1 to n. You have to write a code to partition it
into "m" groups such that sum of numbers in each group is equal to n*(n+1)/(2*m).
Assume that numbers n and m are such that n*(n+1)/(2*m) is an integer. Your program
should print out the numbers in each group. Or if it is not possible to partition the
numbers into m groups, then print out that its not possible. Example : n=20 and m=3
Group 1 : 1,8,11,13,18,19 Group 2 : 2,5,12,14,17,20 Group 3 : 3,4,6,7,9,10,15,16 Input:
Two integers n,m. Output: Print out to the screen the numbers in each group in a differnt
line. Testing: We will run atleast 5 test cases for this problem. So if you cannot write a
generalised code which will take care of all n and m, you can try to write codes based on
specific conditions.
-------------------------------------------------------------------------------Algo :
8) Partition. An algo which worked very well, was to start by adding the number n(the
largest number) to group 1. Then add the next largest number ( n-1 in this case) , and
check whether your sum in that group is greater than n(n+1)/(2m). If it is greater, than
take out the number and then add the next greatest number and so on till you get the sum
equal to n(n+1)/(2m). For the next group, start out similarly, add the largest of the
remaining numbers to the group, and keep adding the next largest, till you get the sum.
--------------------------------------------------------------------------------
************************************************************************
*********************
PROBLEM 2:
C-on-test - Intra-IIT Round Brought to you by CSEA, IITB in association with VERITAS
software.
-------------------------------------------------------------------------------Problem 1. ~~~~~~~~~~ With Election fever on its high and politicians running short on
time you have write an program which they can use to call junta to come forward and
vote... The program should print Come-Sure-Come on a line by itself just once. No
leading or trailing spaces. The output is case sensitive i.e. come-sure-come would be
regarded as incorrect. As an concerned citizen of this country you should do your bit
towards it. Ask yourself, Do you want an elected government or are you apathetic ?
-------------------------------------------------------------------------------Problem 2. ~~~~~~~~~~ Elections over, mps' elected, the auction house set and the
horse-trading is on. All the mp's are seated in a circle. Each belongs to either the H front
or the T front of the regional faction of the secular group of the leftist liberal democratic
anti-communalist pro-poor progressive party of India. In the center of the circle is THE
ONE of the current polity Akal Bechari Bhaggayi (ABB). His aim is to convert all the
mp's to either H or T group. But mps' being mps', having had years of experience are not
so easy. They always go in pairs (so they can use each other as excuse later). In each step
ABB can ask any 2 adjacent mp's to toggle their loyalty. Time however is of the essence.
Everyone wants a piece of the action and if ABB doesnot convert fast he will be out of
center stage. This is where you come into the picture. You being the brilliant students
from IITB can surely use your skills to help him out. Help ABB figure out the minimum
number of steps required to achieve his aim. You will be given a string consisting of H's
and T's as input on a single line. The size of the input is bounded above by 1600.
Consider the input string to be the Circle listed out clockwise from some point. You have
to output the number of steps it will take ABB to convert all mp's to one type. The
number is to be printed on a line by itself. No leading or trailing data. If it is not possible
to do the conversion then output -1. Sample Input: HTTH ~~~~~~~~~~~~~ Sample
Output: 1 (for above example. Either pair of T's or H's
************************************************************************
*********************
PROBLEM 3:
| Problem 0: Helloworld |
`-----------------------'
The Problem
~~~~~~~~~~~
(Freebie) Write a program to print the sentence, Hello
world on the screen. There is one space between the two words, and a
newline after World. The program should then input an integer,
add 10 to it and print the sum on the screen, followed by a newline.
Note: You need to submit this program first to register
yourself. .. 2 marks
In Short
~~~~~~~~
int main()
{
int x;
printf("Hello world\n");
scanf("%d", &x);
printf("%d\n", x+10);
}
Comments
~~~~~~~~
This program tests the editor, compiler, submission script, mail,
printf, scanf, +, and just about everything else. In addition, it
registers the person by creating his program and score directories.
Some smart IITian tried out
int *x; scanf("%d", x); printf("%d\n", *x+10);
which promptly crashed, leaving him wondering why.
Someone else (actually, me) did "Hello World" (caps W) and got
incorrect. My fault, actually. I forgot to lowercase it before
checking.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~
,-----------------------.
| Problem 1: Monontonic |
`-----------------------'
The Problem
~~~~~~~~~~~
An IITian student, having forgotten to attend his last Physics
lab, has to now cook up a graph for the lab report. He has a
moth-eaten journal from ten years ago of the same lab, in which the
readings are there, but not in the same order that they were taken
down from the experiments. Each reading has an x-value which runs
from 1 from to the number of readings, and a y-value, which may be
any positive integer. However, only the latter is visible for each
reading, in the old report.
The student knows that the final graph is a sine wave. With a couple
of hours left for submission, he decides that the closest he can get
to that is to plot a ``zigzag graph''. He will rearrange the readings
in such a way that when a line is drawn between successive readings on
the graph, a zigzag pattern is obtained, with every point being
at a local maxima or minima of the graph. There may be more than one
reading with the same y-value, but if they are placed adjacent, the
lab instructor will spot the student's ploy immediately and have him
repeat the experiment. Hence, he wants to avoid an arrangement in
which this happens.
Write a program that given a sequence of readings, determines whether
they suit the student's requirements or not. The input consists of
n+1 lines, with a single integer on each, when there are n
readings. The first number is the number of readings, i.e. n, and
the remaining numbers are the y-values of the readings, given in no
particular order. The output should be the word ``no'' in lowercase
letters, if the readings can't help the hapless student, or the
required sequence, if they can. In the latter case, the readings, in
the correct order, should be output as a single integer on each line.
Hence, for an n-reading problem, for which a ``good'' rearrangement
exists, the answer will consist of n lines. There will be at most
500 readings, with y-values in [0,10]. ... 15 marks
In Short
~~~~~~~~
We define a monontonic sequence as one which strictly increases and
decreases alternately, starting with either increase or decrease.
Given a sequence of numbers, find a monontonic permutation if you can,
or print "no" if you can't.
My approach
~~~~~~~~~~~
If the number with the maximum number of occurrences occurs more than
N/2 times, then it's not possible to find a sequence. Otherwise
alternately output numbers on either side of this most frequent
number. The problem would become more interesting if we insist that
the final sequence has to have increasing magnitude.
Alternatively, (due to sami), one might use divide and conquer,
knowing that an odd length sequence may *have* to start with an
increase or a decrease, but an even length sequence, on reversing,
starts with the other kind of change. Therefore we can have a merge
sort like algo with the merging step optionally reversing one or both
the even-length (power of 2) sequences and concatenating.
Winner1 algo
~~~~~~~~~~~~
(GREEDY) Sort the numbers in decreasing order and split the sequence
in half. Now, construct the final sequence by taking alternate
elements from the two halves. There will be 4 possible ways of doing
this. Consider all of them.
Winner2 algo
~~~~~~~~~~~~
Sort the list in increasing order . Let this be b1,b2,....,bn Form two
lists as follows. b1,b4,b2,b5,b3,b6 and b4,b1,b5,b2,b6,b3 for even
n ( here n=6) b1,b5,b2,b6,b3,b7,b4 and b4,b1,b5,b2,b6,b3,b7 for odd n
( here n=7) If in both lists there are consecutive equals then
solution not possible else print that list in which no equal
consecutive are present.
Winner3 algo
~~~~~~~~~~~~
Sort
Even 2n nos if a(n)=a(2n) no
else pick a(n) a(2n) a(n-1) a(2n-1) .....
Odd 2n+1 nos : if a(n)=a(n+1) no
else pick a(n) a(2n+1) a(n-1) a(2n) ....
and place a(n+1) appropriately if it fits
(End beginning or centre)
Test cases
~~~~~~~~~~
yes: 1 2 3
yes: 1 2 2 3
yes: 3 2 2 1
yes: 2 1 3 2
yes: 2 3 1 2
yes: 2 2 1 3
yes: 1 3 2 2
no : 1 2 2 2 3
yes: 3 2 2 2 3
yes: 1 2 2 2 1
yes: 3 3 3 6 6 6
yes: 6 4 6 4 6 4 6
yes: 1 2 2 2 2 2 4 5 6 7
no : 1 2 2 2 2 2 4 5 6
yes: 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
12341234123412341234
yes: 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
12341234123412341234
55555555555555555555
555555555555555555555
no : 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
12341234123412341234
333333333333333333333
no : 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
12341234123412341234
333333333333333333333
no : 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
12341234123412341234
333333333333333333333
yes: 3 3 3 3 3 4 4 3 4 4 4 4 4 4 4 4 4 4 4 4
44444444444444444444
44444444333334444333
33333444433333333333
33333333333333333333
33334333444444444444
44444444444444444444
44444444334444333333
34443333333333443333
3333333333333333333
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~
,-------------------------.
| Problem 2: Setsplitting |
`-------------------------'
The Problem
~~~~~~~~~~~
Bheeshma looked grimly at Krishna and said, ``You must decide, O
Yadava, whom you will give your armies to. They cannot remain neutral
in the great war that will take place.'' ``But I love both the
Pandavas and Kauravas. If I give, I give equally, or I do not give at
all.'', replied Krishna, petulantly. Bhishma beamed. ``That is as
easily done as winning a game of Snakes and Ladders with Shakuni at
your side. Just give Yudhistira half your men, and Duryodhana the
other half.'', he said.
``Not so, Pitamaha! My army is comprised of many akshauhinis and
the men of an akshauhini fight together. So, I have to give an
entire akshauhini to either brother, and not parts of it.
Unfortunately, each akshauhini has a different number of
soldiers, and the math I learnt at my Gurukul is inadequate to help me
figure out how to distribute the akshauhinis. What do I do?'',
wailed Krishna. Bheeshma looked on, nonplussed. This was going to be a
tougher nut to crack than that fisherman chap so many years ago....
Write a program that given the number of soldiers in each of Krishna's
akshauhinis determines whether he will send his soldiers to war
or not. The input consists of n+1 lines, for n akshauhinis,
the first line containing a single integer which is the number of
akshauhinis and every other line containing a single integer which is
the number of soldiers in the corresponding akshauhini. The
output should be the word ``no'' on a line, if there is no equitable
distribution possible. If there is, then output the distribution in
the following manner: for each akshauhini that goes to the
Pandavas, print a +, followed by a space, and the number of soldiers
in that akshauhini. For the Kauravas, substitute the + with a
-. Each number (with its appropriate sign) should appear on a line
by itself. There are at most 100 akshauhinis, with 0 to 100
soldiers in each, inclusive. ... 20 marks
In Short
~~~~~~~~
You're given a sequence of numbers, you're supposed to insert +'s and
-'s in between so that it evaluates to zero. i.e. find a subset of sum
S/2, where S is the sum of all numbers (assumed positive). The numbers
are given to be N in number and bounded by M.
For example
~~~~~~~~~~~
1234:+1-2-3+4
1 2 3 10 : no
or - 1 + 2 + 3 - 4
My approach O(MN^2)
~~~~~~~~~~~~~~~~~~~
Have an array of size M*N which marks all the sums that can be made
out of the N numbers. For example, 0 can be formed by taking no number
in a set. x1 can be formed. x2 and x1+x2 can be formed. i.e. for each
number xi, go through the array sj and mark xi+sj as formable. In the
end, check if the S/2'th element of the array is marked. For finding
the sequence, the entire sequence need not be stored for each array
element, a pointer is sufficient. For example, s[0] = 0, s[x1] = 0,
s[x2] = 0, s[x1+x2] = x1, ... so that by following s[S/2] down to 0,
the set can be obtained.
Winner1 algo
~~~~~~~~~~~~
(BRANCH AND BOUND) Recursively enumerate all the subsets of {1,..,N},
where N=#inputs. Whenever the running sum of a subset exceeds half the
total sum, abandon that path.
Winner2 algo
~~~~~~~~~~~~
We used Brute force. Let the list be a1,a2,..,ai,...,an.
Initially i=1 and av[1]=(a1+a2+.....+an)/2.
Prob: pick some numbers in ai to an such that total is equal to av[i].
step: If we can include ai solve the prob with av[i+1]=av[i]-ai
and i=i+1. If we can't include ai solve prob with av[i+1]= av[i]
and i=i+1.
If i>end : Solution not possible for that combination.
If at any stage num[i] is -ve : Sol not possible for that combination.
If at any stage num[i]=0 : Sol found.
If solution is not found for a1 then solution not possible.
Winner3 algo
~~~~~~~~~~~~
Greedy:
Sort
Pick the largest as long as feasable
Feasable when fits and required no > least no.
Test Cases
~~~~~~~~~~
yes: 1 2 3 4 5 6 7
no : 6 5 4 1 2 3
yes: 1 2 2 3
no : 2 4 6 10
no : 4 1 16 2 7
yes: 0
no : 2 1 1 1 1 2 2 1 2 2
yes: 1 2 1 1 1 1 2 2 2 1 2 2
yes: 1 1 1 1 1 1
yes: 70 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
111111111111111111111111111111111111
yes: 11 19 33 48 7 8
yes: 50 40 10 10 1 1 1 1 1 1 1 1 1 1
yes: 40 27 91 54 67 9 36 40 61 92 30 11 61 0 34 8 32 84 39 73 37 52 71 86 48
35 72 4 31 8 49 47 56 95 48 20 87 72 31 10 30 83 77 5 89 34 68 36 19 10
96 95 43 49 22 95 12 60 11 93 15 72 72 69 73 26 90 96 24 78 1 0 95 0 60
23 88 69 52 34 37 16 45 14 93 41 90 5 52 51 56 69 46 29 28 90 12 5 81
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~
,------------------.
| Problem 3: Areas |
`------------------'
The Problem
~~~~~~~~~~~
Star Date 6876.21. The known Universe is under the control of
Earth. To facilitate easy patrolling, all of Earth's dominion has been
mapped onto a two-dimensional grid of squares. The grid is described
by equidistant points, with each pair of adjacent points being joined
by lines. Each square in the grid is a colony of Earth, and any
spaceship must travel only along the lines of the grid.
Recently, a renegade band of Klatchians have been making furtive raids
on our colonies. A Klatchian ship materialises at some point on the
grid and drops its crew there. The crew travels from point to point in
some random order, and after some time returns to the point where they
started so that the ship can pick them up again. During this journey,
they may revisit points and travel lines they have already gone
through. All the colonies circumscribed by the travel line of the
Klatchians are laid to waste. Earth Patrol has managed to capture an
abandoned ship used in such a raid that contains only a log mentioning
the details of the crew's trip along the grid lines. Each line of the
log contains a letter, ( n, s, w, e), which gives the direction
of travel (north, south, west, east) and a number that denotes the
number of lines travelled in that direction. For example, the log,
( s 1 w 1 n 1 e 1 ) is a trip that destroys exactly one
square, while ( s 2 w 2 n 2 e 2 ) destroys 4. A longer
sequence, with a diagram describing the travel is attached at the end.
Write a program that given the details of a Klatchian trip finds out
how many colonies have been destroyed. The input is as specified above
in the example, and the output should be an integer with no spaces
before or after it, and succeeded by a newline, that gives the number
of colonies. There are at most 200 lines of input, with the number on
any line not exceeding 200. ... 25 marks
In Short
~~~~~~~~
A particle moves on a grid in an arbitrary manner, but finishing at
the starting point. What's the area of the boundary of the region it
encloses?
My approach
~~~~~~~~~~~
Find a point outside and floodfill, by doing a DFS on the outside
region.
Winner1 algo
~~~~~~~~~~~~
(O(M^3) ALGO) The alien travels along some M lines, say. Extend all
these lines in both directions. This gives rise to some grid of
rectangles. For every rectangle in this grid, find out if it is
bounded on all 4 sides by line segments from the alien's path
(standard test for point inclusion in a convex figure). If yes, add
this rectangle's area to the current area.
Others have not submitted algos
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test Cases
~~~~~~~~~~
1)
4, e 1, n 1, w 1, s 1 . -- .
Area = 1
| |
. -- .
2)
4, n 1, w 1, e 1, s 1 . -- .
Area = 0
|
.
3)
. -- .
| |
. . -- .
|
|
. -- . -- .
4)
. -- . -- .
|
|
. . -- .
| |
. . -- . -- .
|
|
. -- . -- . -- .
5)
. -- .
| |
. -- . -- .
| |
. -- .
6)
. -- . -- .
|
|
. . -- . -- .
| | | |
. -- . -- . -- . -- .
| | | |
. . -- . .
|
|
. -- . -- . -- .
7)
. -- . -- . -- .
|
|
. -- . -- . . -- . -- .
| | | | | |
. . -- . -- . -- . .
|
| |
|
. . -- . -- . -- . .
| | | | | |
. -- . -- . . -- . -- .
|
|
. -- . -- . -- .
8)
. -- . -- . -- . -- . -- . -- .
|
|
.
. -- . -- . -- . -- .
|
| |
|
.
. -- . -- . -- . -- . .
|
| | |
| |
.
. -- . -- . -- . -- . . .
|
| | | | | | |
.
. -- . -- . -- . -- . -- . -- . -- .
|
| | | | | | |
. . -- . -- . -- . -- . -- . -- . -- .
| | | | | | | |
. -- . -- . -- . -- . -- . -- . -- .
| | | | | |
. . . -- . -- . -- .
| |
| |
. . -- . -- . -- .
|
|
. -- . -- . -- .
Basic pattern:
.
|
. -- . -- . -- . -- .
|
|
.
.
|
|
.
.
|
|
. -- . -- . -- .
9)
. -- .
| |
. -- . -- . -- .
| |
|
. -- . -- . -- .
| |
. -- .
10)
. -- .
over and over the same square
still area = 1
. -- .
| |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~
,------------------------.
| Problem 4: Superstring |
`------------------------'
The Problem
~~~~~~~~~~~
A scientist working the swampy, mosquito-infested jungles of
Sumatra has made an interesting find. She has recovered fragments of
the gene code of a long-extinct animal, the Blarky, each fragment
consisting of a string of molecules. The Blarky's genetic code is much
like ours, with each molecule represented by a letter, except that all
26 letters are used, unlike our code that uses only the four letters,
A, T, C and G to code the molecules in the gene.
Unfortunately, no single sample is guaranteed to be the entire
genetic code of the Blarky, though it is known that every sample
contains a string of consecutive molecules in the actual code. To
reconstruct the final genetic code, our scientist relies on a
well-known principle in genetics that states that the best
approximation of a genetic code from its fragments is obtained by
finding the shortest sequence of molecules that contains all the known
fragments. For example, if the fragments gyy, segyy and
puse are available, then the best guess at the code is
pusegyy.
Write a program that, given gene fragments, obtains the best
approximation. The input consists of n+1 lines when there are n
gene fragments. The first line has a single integer, which is the
number of fragments. All other lines have a single sequence of
letters, there being no space between letters. The sequence on each
line represents a different gene fragment obtained by the scientist.
The output should be the genetic code as guessed from these fragments.
Each fragment is at most 20 molecules long, and there are at most 100
fragments with the scientist. ... 38 marks
In short
~~~~~~~~
You are given some strings, and you are expected to find the shortest
string that contains all the other given strings, i.e. the shortest
superstring.
My approach
~~~~~~~~~~~
NP-hard, and can be mapped to finding the Hamiltonian path. Hence
approximate solutions (within 91% of my exact ones) are given full
credit.
Winner1 algo
~~~~~~~~~~~~
(GREEDY) At any stage, find the pair of strings giving the maximum overlap
on merging in the best possible manner. Merge them, and proceed. At the
end, the string left is the approximate answer.
Winner2 algo
~~~~~~~~~~~~
Sort the strings in descending order of length. Pick the longest and
copy it in the final string. Take the next one.Insert it as follows.
If the final string is "abcdef" and the string to be inserted is
a. "pqr" . Final becomes "abcdefpqr".
2. "def". Final remains the same.
3. "defd". Final becomes "abcdefd"
4. "fabc". Form two strings "fabcdef" and "abcdefabc" and Final
becomes the shorter of two.
Keep on inserting strings in the descending order. Its a NP hard
problem. No polynomial time algo exists for it. Our algorithm works
for fairly large number of cases.
Winner3 algo
~~~~~~~~~~~~
Just removed strings that were already present
Test cases
~~~~~~~~~~
1. all overlaps are zot
: any algo will work
2. aaaaa aaabbb aaabbb bbbccc
: two strings identical
3. aaaaa aaaab aabac baaab aabaab
: general arbit
4. cdefghi abcdef hijklm efghij
: two possibilities exist, which do you choose ?
5. raman mantra uma
: greedy does not work:
greedy takes raman+mantra = ramantra, and then uma: ramantrauma
you should take mantra+raman = mantraman, and then umantraman
6. abcd abef cdab efab
7. hello hell llama lotus shell ellot
: one string is a substring of another
8. finger oafing german muffin codger
9. life feels silli
10. with all the might of the earth rama lifted his bow and in just
one stroke fired twenty types of arrows which made all around him
stop to think about his powers
: to check exhaustive searches
11. who holds the hell torch is none other than the guy who lives here
or there and doth not know fear
12. abcdef defab fababc babc labcd gabcde gfab bcdfab ababef cdlab gbcd bcdg
13. csea prog contest is the worst thing that took place ever
14. sc re w t he gu y w ho do es an ex ha us ti ve se ar ch so th at he
lo ok s fo r be tt er so lu ti on s
15. abab abbc bbcad dacca aabdba abdbabd abadbabdbdbabad adbdbdabadba abdbab
adbbad adbabdad adbadb adbadb adbbdaba dabdbad dbadbadabb dbadab dba
: general arbit
************************************************************************
************************
PROBLEM 4:
The Problem
~~~~~~~~~~~
(Freebie) Write a program to print the sentence, Hello
world on the screen. There is one space between the two words, and a
newline after World. The program should then input an integer,
add 10 to it and print the sum on the screen, followed by a newline.
Note: You need to submit this program first to register
yourself. .. 2 marks
In Short
~~~~~~~~
int main()
{
int x;
printf("Hello world\n");
scanf("%d", &x);
printf("%d\n", x+10);
}
Comments
~~~~~~~~
This program tests the editor, compiler, submission script, mail,
printf, scanf, +, and just about everything else. In addition, it
registers the person by creating his program and score directories.
Some smart IITian tried out
int *x; scanf("%d", x); printf("%d\n", *x+10);
which promptly crashed, leaving him wondering why.
Someone else (actually, me) did "Hello World" (caps W) and got
incorrect. My fault, actually. I forgot to lowercase it before
checking.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~
,-----------------------.
| Problem 1: Monontonic |
`-----------------------'
The Problem
~~~~~~~~~~~
An IITian student, having forgotten to attend his last Physics
lab, has to now cook up a graph for the lab report. He has a
moth-eaten journal from ten years ago of the same lab, in which the
readings are there, but not in the same order that they were taken
down from the experiments. Each reading has an x-value which runs
from 1 from to the number of readings, and a y-value, which may be
any positive integer. However, only the latter is visible for each
reading, in the old report.
The student knows that the final graph is a sine wave. With a couple
of hours left for submission, he decides that the closest he can get
to that is to plot a ``zigzag graph''. He will rearrange the readings
in such a way that when a line is drawn between successive readings on
the graph, a zigzag pattern is obtained, with every point being
at a local maxima or minima of the graph. There may be more than one
reading with the same y-value, but if they are placed adjacent, the
lab instructor will spot the student's ploy immediately and have him
repeat the experiment. Hence, he wants to avoid an arrangement in
which this happens.
Write a program that given a sequence of readings, determines whether
they suit the student's requirements or not. The input consists of
n+1 lines, with a single integer on each, when there are n
readings. The first number is the number of readings, i.e. n, and
the remaining numbers are the y-values of the readings, given in no
particular order. The output should be the word ``no'' in lowercase
letters, if the readings can't help the hapless student, or the
required sequence, if they can. In the latter case, the readings, in
the correct order, should be output as a single integer on each line.
Hence, for an n-reading problem, for which a ``good'' rearrangement
exists, the answer will consist of n lines. There will be at most
500 readings, with y-values in [0,10]. ... 15 marks
In Short
~~~~~~~~
We define a monontonic sequence as one which strictly increases and
decreases alternately, starting with either increase or decrease.
Given a sequence of numbers, find a monontonic permutation if you can,
or print "no" if you can't.
My approach
~~~~~~~~~~~
If the number with the maximum number of occurrences occurs more than
N/2 times, then it's not possible to find a sequence. Otherwise
alternately output numbers on either side of this most frequent
number. The problem would become more interesting if we insist that
the final sequence has to have increasing magnitude.
Alternatively, (due to sami), one might use divide and conquer,
knowing that an odd length sequence may *have* to start with an
increase or a decrease, but an even length sequence, on reversing,
starts with the other kind of change. Therefore we can have a merge
sort like algo with the merging step optionally reversing one or both
the even-length (power of 2) sequences and concatenating.
Winner1 algo
~~~~~~~~~~~~
(GREEDY) Sort the numbers in decreasing order and split the sequence
in half. Now, construct the final sequence by taking alternate
elements from the two halves. There will be 4 possible ways of doing
this. Consider all of them.
Winner2 algo
~~~~~~~~~~~~
Sort the list in increasing order . Let this be b1,b2,....,bn Form two
lists as follows. b1,b4,b2,b5,b3,b6 and b4,b1,b5,b2,b6,b3 for even
n ( here n=6) b1,b5,b2,b6,b3,b7,b4 and b4,b1,b5,b2,b6,b3,b7 for odd n
( here n=7) If in both lists there are consecutive equals then
solution not possible else print that list in which no equal
consecutive are present.
Winner3 algo
~~~~~~~~~~~~
Sort
Even 2n nos if a(n)=a(2n) no
else pick a(n) a(2n) a(n-1) a(2n-1) .....
Odd 2n+1 nos : if a(n)=a(n+1) no
else pick a(n) a(2n+1) a(n-1) a(2n) ....
and place a(n+1) appropriately if it fits
(End beginning or centre)
Test cases
~~~~~~~~~~
yes: 1 2 3
yes: 1 2 2 3
yes: 3 2 2 1
yes: 2 1 3 2
yes: 2 3 1 2
yes: 2 2 1 3
yes: 1 3 2 2
no : 1 2 2 2 3
yes: 3 2 2 2 3
yes: 1 2 2 2 1
yes: 3 3 3 6 6 6
yes: 6 4 6 4 6 4 6
yes: 1 2 2 2 2 2 4 5 6 7
no : 1 2 2 2 2 2 4 5 6
yes: 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
12341234123412341234
yes: 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
12341234123412341234
55555555555555555555
555555555555555555555
no : 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
12341234123412341234
333333333333333333333
no : 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
12341234123412341234
333333333333333333333
no : 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
12341234123412341234
333333333333333333333
yes: 3 3 3 3 3 4 4 3 4 4 4 4 4 4 4 4 4 4 4 4
44444444444444444444
44444444333334444333
33333444433333333333
33333333333333333333
33334333444444444444
44444444444444444444
44444444334444333333
34443333333333443333
3333333333333333333
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~
,-------------------------.
| Problem 2: Setsplitting |
`-------------------------'
The Problem
~~~~~~~~~~~
Bheeshma looked grimly at Krishna and said, ``You must decide, O
Yadava, whom you will give your armies to. They cannot remain neutral
in the great war that will take place.'' ``But I love both the
Pandavas and Kauravas. If I give, I give equally, or I do not give at
all.'', replied Krishna, petulantly. Bhishma beamed. ``That is as
easily done as winning a game of Snakes and Ladders with Shakuni at
your side. Just give Yudhistira half your men, and Duryodhana the
other half.'', he said.
``Not so, Pitamaha! My army is comprised of many akshauhinis and
the men of an akshauhini fight together. So, I have to give an
entire akshauhini to either brother, and not parts of it.
Unfortunately, each akshauhini has a different number of
soldiers, and the math I learnt at my Gurukul is inadequate to help me
figure out how to distribute the akshauhinis. What do I do?'',
wailed Krishna. Bheeshma looked on, nonplussed. This was going to be a
tougher nut to crack than that fisherman chap so many years ago....
Write a program that given the number of soldiers in each of Krishna's
akshauhinis determines whether he will send his soldiers to war
or not. The input consists of n+1 lines, for n akshauhinis,
the first line containing a single integer which is the number of
akshauhinis and every other line containing a single integer which is
the number of soldiers in the corresponding akshauhini. The
output should be the word ``no'' on a line, if there is no equitable
distribution possible. If there is, then output the distribution in
the following manner: for each akshauhini that goes to the
Pandavas, print a +, followed by a space, and the number of soldiers
in that akshauhini. For the Kauravas, substitute the + with a
-. Each number (with its appropriate sign) should appear on a line
by itself. There are at most 100 akshauhinis, with 0 to 100
soldiers in each, inclusive. ... 20 marks
In Short
~~~~~~~~
You're given a sequence of numbers, you're supposed to insert +'s and
-'s in between so that it evaluates to zero. i.e. find a subset of sum
S/2, where S is the sum of all numbers (assumed positive). The numbers
are given to be N in number and bounded by M.
For example
~~~~~~~~~~~
1234:+1-2-3+4
1 2 3 10 : no
My approach O(MN^2)
~~~~~~~~~~~~~~~~~~~
or - 1 + 2 + 3 - 4
Have an array of size M*N which marks all the sums that can be made
out of the N numbers. For example, 0 can be formed by taking no number
in a set. x1 can be formed. x2 and x1+x2 can be formed. i.e. for each
number xi, go through the array sj and mark xi+sj as formable. In the
end, check if the S/2'th element of the array is marked. For finding
the sequence, the entire sequence need not be stored for each array
element, a pointer is sufficient. For example, s[0] = 0, s[x1] = 0,
s[x2] = 0, s[x1+x2] = x1, ... so that by following s[S/2] down to 0,
the set can be obtained.
Winner1 algo
~~~~~~~~~~~~
(BRANCH AND BOUND) Recursively enumerate all the subsets of {1,..,N},
where N=#inputs. Whenever the running sum of a subset exceeds half the
total sum, abandon that path.
Winner2 algo
~~~~~~~~~~~~
We used Brute force. Let the list be a1,a2,..,ai,...,an.
Initially i=1 and av[1]=(a1+a2+.....+an)/2.
Prob: pick some numbers in ai to an such that total is equal to av[i].
step: If we can include ai solve the prob with av[i+1]=av[i]-ai
and i=i+1. If we can't include ai solve prob with av[i+1]= av[i]
and i=i+1.
If i>end : Solution not possible for that combination.
If at any stage num[i] is -ve : Sol not possible for that combination.
If at any stage num[i]=0 : Sol found.
If solution is not found for a1 then solution not possible.
Winner3 algo
~~~~~~~~~~~~
Greedy:
Sort
Pick the largest as long as feasable
Feasable when fits and required no > least no.
Test Cases
~~~~~~~~~~
yes: 1 2 3 4 5 6 7
no : 6 5 4 1 2 3
yes: 1 2 2 3
no : 2 4 6 10
no : 4 1 16 2 7
yes: 0
no : 2 1 1 1 1 2 2 1 2 2
yes: 1 2 1 1 1 1 2 2 2 1 2 2
yes: 1 1 1 1 1 1
yes: 70 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
111111111111111111111111111111111111
yes: 11 19 33 48 7 8
yes: 50 40 10 10 1 1 1 1 1 1 1 1 1 1
yes: 40 27 91 54 67 9 36 40 61 92 30 11 61 0 34 8 32 84 39 73 37 52 71 86 48
35 72 4 31 8 49 47 56 95 48 20 87 72 31 10 30 83 77 5 89 34 68 36 19 10
96 95 43 49 22 95 12 60 11 93 15 72 72 69 73 26 90 96 24 78 1 0 95 0 60
23 88 69 52 34 37 16 45 14 93 41 90 5 52 51 56 69 46 29 28 90 12 5 81
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~
,------------------.
| Problem 3: Areas |
`------------------'
The Problem
~~~~~~~~~~~
Star Date 6876.21. The known Universe is under the control of
Earth. To facilitate easy patrolling, all of Earth's dominion has been
mapped onto a two-dimensional grid of squares. The grid is described
by equidistant points, with each pair of adjacent points being joined
by lines. Each square in the grid is a colony of Earth, and any
spaceship must travel only along the lines of the grid.
Recently, a renegade band of Klatchians have been making furtive raids
on our colonies. A Klatchian ship materialises at some point on the
grid and drops its crew there. The crew travels from point to point in
some random order, and after some time returns to the point where they
started so that the ship can pick them up again. During this journey,
they may revisit points and travel lines they have already gone
through. All the colonies circumscribed by the travel line of the
Klatchians are laid to waste. Earth Patrol has managed to capture an
abandoned ship used in such a raid that contains only a log mentioning
the details of the crew's trip along the grid lines. Each line of the
log contains a letter, ( n, s, w, e), which gives the direction
of travel (north, south, west, east) and a number that denotes the
number of lines travelled in that direction. For example, the log,
( s 1 w 1 n 1 e 1 ) is a trip that destroys exactly one
square, while ( s 2 w 2 n 2 e 2 ) destroys 4. A longer
sequence, with a diagram describing the travel is attached at the end.
Write a program that given the details of a Klatchian trip finds out
how many colonies have been destroyed. The input is as specified above
in the example, and the output should be an integer with no spaces
before or after it, and succeeded by a newline, that gives the number
of colonies. There are at most 200 lines of input, with the number on
any line not exceeding 200. ... 25 marks
In Short
~~~~~~~~
A particle moves on a grid in an arbitrary manner, but finishing at
the starting point. What's the area of the boundary of the region it
encloses?
My approach
~~~~~~~~~~~
Find a point outside and floodfill, by doing a DFS on the outside
region.
Winner1 algo
~~~~~~~~~~~~
(O(M^3) ALGO) The alien travels along some M lines, say. Extend all
these lines in both directions. This gives rise to some grid of
rectangles. For every rectangle in this grid, find out if it is
bounded on all 4 sides by line segments from the alien's path
(standard test for point inclusion in a convex figure). If yes, add
this rectangle's area to the current area.
Others have not submitted algos
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test Cases
~~~~~~~~~~
1)
4, e 1, n 1, w 1, s 1 . -- .
Area = 1
| |
. -- .
2)
4, n 1, w 1, e 1, s 1 . -- .
Area = 0
|
.
3)
. -- .
| |
. . -- .
|
|
. -- . -- .
4)
. -- . -- .
|
|
. . -- .
| |
. . -- . -- .
|
|
. -- . -- . -- .
5)
. -- .
| |
. -- . -- .
| |
. -- .
6)
. -- . -- .
|
|
. . -- . -- .
| | | |
. -- . -- . -- . -- .
| | | |
. . -- . .
|
|
. -- . -- . -- .
7)
. -- . -- . -- .
|
|
. -- . -- . . -- . -- .
| | | | | |
. . -- . -- . -- . .
|
| |
|
. . -- . -- . -- . .
| | | | | |
. -- . -- . . -- . -- .
|
|
. -- . -- . -- .
8)
. -- . -- . -- . -- . -- . -- .
|
|
.
. -- . -- . -- . -- .
|
| |
|
.
. -- . -- . -- . -- . .
|
| | |
| |
.
. -- . -- . -- . -- . . .
|
| | | | | | |
.
. -- . -- . -- . -- . -- . -- . -- .
|
| | | | | | |
. . -- . -- . -- . -- . -- . -- . -- .
| | | | | | | |
. -- . -- . -- . -- . -- . -- . -- .
| | | | | |
. . . -- . -- . -- .
| |
| |
. . -- . -- . -- .
|
|
. -- . -- . -- .
Basic pattern:
.
|
. -- . -- . -- . -- .
|
|
.
.
|
|
.
.
|
|
. -- . -- . -- .
9)
. -- .
| |
. -- . -- . -- .
| |
|
. -- . -- . -- .
| |
. -- .
10)
. -- .
over and over the same square
still area = 1
. -- .
| |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~
,------------------------.
| Problem 4: Superstring |
`------------------------'
The Problem
~~~~~~~~~~~
A scientist working the swampy, mosquito-infested jungles of
Sumatra has made an interesting find. She has recovered fragments of
the gene code of a long-extinct animal, the Blarky, each fragment
consisting of a string of molecules. The Blarky's genetic code is much
like ours, with each molecule represented by a letter, except that all
26 letters are used, unlike our code that uses only the four letters,
A, T, C and G to code the molecules in the gene.
Unfortunately, no single sample is guaranteed to be the entire
genetic code of the Blarky, though it is known that every sample
contains a string of consecutive molecules in the actual code. To
reconstruct the final genetic code, our scientist relies on a
well-known principle in genetics that states that the best
approximation of a genetic code from its fragments is obtained by
finding the shortest sequence of molecules that contains all the known
fragments. For example, if the fragments gyy, segyy and
puse are available, then the best guess at the code is
pusegyy.
Write a program that, given gene fragments, obtains the best
approximation. The input consists of n+1 lines when there are n
gene fragments. The first line has a single integer, which is the
number of fragments. All other lines have a single sequence of
letters, there being no space between letters. The sequence on each
line represents a different gene fragment obtained by the scientist.
The output should be the genetic code as guessed from these fragments.
Each fragment is at most 20 molecules long, and there are at most 100
fragments with the scientist. ... 38 marks
In short
~~~~~~~~
You are given some strings, and you are expected to find the shortest
string that contains all the other given strings, i.e. the shortest
superstring.
My approach
~~~~~~~~~~~
NP-hard, and can be mapped to finding the Hamiltonian path. Hence
approximate solutions (within 91% of my exact ones) are given full
credit.
Winner1 algo
~~~~~~~~~~~~
(GREEDY) At any stage, find the pair of strings giving the maximum overlap
on merging in the best possible manner. Merge them, and proceed. At the
end, the string left is the approximate answer.
Winner2 algo
~~~~~~~~~~~~
Sort the strings in descending order of length. Pick the longest and
copy it in the final string. Take the next one.Insert it as follows.
If the final string is "abcdef" and the string to be inserted is
a. "pqr" . Final becomes "abcdefpqr".
2. "def". Final remains the same.
3. "defd". Final becomes "abcdefd"
4. "fabc". Form two strings "fabcdef" and "abcdefabc" and Final
becomes the shorter of two.
Keep on inserting strings in the descending order. Its a NP hard
problem. No polynomial time algo exists for it. Our algorithm works
for fairly large number of cases.
Winner3 algo
~~~~~~~~~~~~
Just removed strings that were already present
Test cases
~~~~~~~~~~
1. all overlaps are zot
: any algo will work
2. aaaaa aaabbb aaabbb bbbccc
: two strings identical
3. aaaaa aaaab aabac baaab aabaab
: general arbit
4. cdefghi abcdef hijklm efghij
: two possibilities exist, which do you choose ?
5. raman mantra uma
: greedy does not work:
greedy takes raman+mantra = ramantra, and then uma: ramantrauma
you should take mantra+raman = mantraman, and then umantraman
6. abcd abef cdab efab
7. hello hell llama lotus shell ellot
: one string is a substring of another
8. finger oafing german muffin codger
9. life feels silli
10. with all the might of the earth rama lifted his bow and in just
one stroke fired twenty types of arrows which made all around him
stop to think about his powers
: to check exhaustive searches
11. who holds the hell torch is none other than the guy who lives here
or there and doth not know fear
12. abcdef defab fababc babc labcd gabcde gfab bcdfab ababef cdlab gbcd bcdg
13. csea prog contest is the worst thing that took place ever
14. sc re w t he gu y w ho do es an ex ha us ti ve se ar ch so th at he
lo ok s fo r be tt er so lu ti on s
15. abab abbc bbcad dacca aabdba abdbabd abadbabdbdbabad adbdbdabadba abdbab
adbbad adbabdad adbadb adbadb adbbdaba dabdbad dbadbadabb dbadab dba
: general arbit
************************************************************************
************************
PROBLEM 5:
1. You are given an array of positive integers. you want to check whether there is a
triplet(a,b,c) such that a + b = c
-------------------------------------------------------------------------------2.Given a number n & a prime p(< n) consider the binomial coefficients C(n,0) , C(n,1) ,
C(n,2), ... ,C(n,n) one wants to find out how many coefficients are not divisible by p. (try
for a log(n) algo.)
-------------------------------------------------------------------------------3.A chess board (NxN) is given. you want to place knights such that no attack each other
& no 2 control the same position. |--|--|--|--|--|--|--| | A| | | | | | B| |--|--|--|--|--|--|--| | | |a | | *| | |
|--|--|--|--|--|--|--| | | | | | | | b| |--|--|--|--|--|--|--| in the above grid the 2 knights(position
marked A & a) are attacking each other & the 2 knights (position marked B & b ) control
the same position( marked Bp addresses baahar bo chummi header iitians mail mankars
sendits.sh slocat.sh time xaa xab xac xad xae xaf xag xah xai xaj xak xal xam xan ); you
have to give the maximum no. of knights that u can place.
-------------------------------------------------------------------------------4.Given a string one wants to find out the shortest even palindrome starting from the first
index. e.g 1.aabbaa now there are 2 even palindromes(starting from the 1st index) aa &
aabbaa. thus the answer is aa. 2.abb although bb is a palindrome but it doesn't start from
1st index thus answer -1.
************************************************************************
************************
PROBLEM 6:
C-on-test ~~~~~~~~~ Brought to you by CSEA, IITB in association with VERITAS
software.
===============================================================
===
You are Dunce E. Dumdum, freshie at IIT Bombay, Powai - 400076. Having cracked a
cool 3567 rank in IIT JEE after 5 years of concentrated mugging, you think that the
future is bright and a gentle smile plays on your lips as you look around at the verdant
green campus and the hallowed halls of learning. Little do you know what a dark, gloomy
future awaits you. So here's already PROBLEM 1: Credits: 10 ~~~~~~~~~~ Filled with
the enthusiasm and excitement of hostel life, you are exploring your new home when
suddenly you bump into what appears to be a wall. Closer examination reveals the "wall"
to be actually a gigantic, disgruntled and unshaven SENIOR. You politely say "Hi!".
SENIOR just grunts in reply. You are about to continue when suddenly SENIOR booms
out "Hey FRESHIE!". The plaster is still falling off the ceiling as you turn back with
trembling legs. So starts a nice interactive session with SENIOR. One-way intros over,
SENIOR starts asking more technical questions. Your slowly losing that gentle smile on
your lips as the questions get livelier. But here comes a question which puts the g.s. back
where it belongs: SENIOR says, " I will give you a number (N). Find positive integers `x'
and `y' so that x^y + y^x = N, and the sum (x + y) is maximum." So your job is to find
such x and y. Input: The integer N in a line by itself. Output: The values of x and y in the
format x y on a line by themselves, separated by a blank. Any order of x and y is ok.
-------------------------------------------------------------------------------PROBLEM 2: Credits: 20 ~~~~~~~~~~ After many such encounters of the SENIOR
kind, finally you feel that things are in order and the gentle smile, though mellowed with
bitter experience, is still there. But a week's over, and so is your stock of undies, which
number 7 (seven). You have realised that now you need to wash them! (Becoz Mommy
insists that you wear a clean pair of undies every day.) But now you have had a taste of
an IITian's life: too many things to do, too less time. So following Mommy's advice, you
decide to plan out things. You know your routine now, so you know exactly what days
you will be able to do the washing and what days you won't. You decide 2 things: 1>
Since the number of undies is 7 (seven), the washing dates can atmost be separated by 7.
Thus, if you wash on the 15th, you have to wash on or before the 22nd. 2> Since
basically you are a lethargic bum, you decide that you will wash only if you have atleast
2 dirty undies to wash. Thus the dates must be separated by atleast 3. (So you have to
wash on or after 18th, if you wash on the 15th) Since, as mentioned above, you are a
lethargic bum, you want to find out the MINIMUM number of days you need to have a
fresh undie every day to wear. You also know the number of days you have to spend, and
the possible washing days. Input: The total number of days(N) on the first line. The total
number of washing days(M) on the second line. The dates of the washing days, M of
them, one on each line. NOTE: The dates are numbered from 0 to (N-1). Assume that you
start out with a fresh set of undies BEFORE 0th day, (i.e the -1th day), so you need to
wash on or before 6th, but but not before the 2nd day. Output: The minimum number of
days you need to do the washing. Just the number, on a line by itself. Output -1 if it is
impossible to schedule washing days subject to the conditions. Sample Input: 10 4 0 3 6 9
Sample Output: 1 (Since you can wash on the 6th This was an error earlier). length of
input > strings? could be at max 100000.
-------------------------------------------------------------------------------PROBLEM 3: Credits: 30 ~~~~~~~~~~ Now you have finally drained the bitter cup: you
have realised that life in IITB is not all that rosy, and only by mutual co-operation and
work-sharing (read cogging) can help you thru the troubled times. Particularly when you
are trying to crack math problems. You have a long list of math problems.You and other
fellow sufferers decide to handle it together. Each math problem takes you or your
friends 1 man-hour to crack. But there's a catch: there are some problems that can be
done only if some previous problems are done. You decide (as Mommy advices) to
prioratize the problems. For problems A and B, for which A appears in the list before B,
there are two possibilities: 1> If A has lower or equal priority than B, then 2 students can
simultaneously work on problems A and B, to decrease the number of man-hours. 2> If A
has higher priority than B, then A has to be completed before B. Now since this is a
common cause, you have a huge number of freshies who can work on the problems, so
there's no constraint on the number of problems being tackled at the same time, as long as
the above two conditions are met. As mentioned above, you are a lethargic bum, and so
are your friends, so you want to decide what's the MINIMUM number of man-hours to
solve all the problems. Input: The total number of problems (N) on the first line. The
priorities you assigned to the problems in the list, one after the other, on separate lines, as
they appear in the list. Thus there are N more lines after the first one, each having a
priority value, an integer. Output: The minimum number of man-hours needed to solve
all the problems in the list. Just the number. Note that a higher priority problem can be
done before a lower priority job, even if it comes later in the list. THUS: IF A comes
before B in the list and B has higher priority than A, then B can be done before A, or with
A simultaneously. BUT if B has lower priority than A, then B HAS to be completed
before A. Sample Input: 10 1 1 2 3 1 4 1 2 1 5 Sample Output: 3 (1,1,2,3,4,5) are done
first, (1,1,2) are done next, (1) last. Therefore the answer is 3
-------------------------------------------------------------------------------PROBLEM 4: Credits: 50 ~~~~~~~~~~ Return of the SENIORS. SENIORS strike back.
Now your Hostel elections are round the corner. The SENIOR who's standing for G.Sec
is unfortunately your wingmate, and so he wants you to go door to door canvassing for
him. But lethargic bum that you are, you crib incessantly, and whine and say that
Mommy forbids you from such hard work and to concentrate on your studies. So rather
than listen to your whines, the SENIOR relents and gives you a list of `N' room numbers
you have to visit in order, and tells you that you can visit any `k' of them. You are
ecstatic. But again that lethargic bum in you tells you that you would like to minimize
your travelling. So you decide to pick a `k' subsequence of room numbers so the the total
consecutive absolute differences in room numbers is minimized. Input: N,k -- on the first
line, the two numbers separated by a comma. Then the room numbers, N of them, one on
a line. Output: The minimum total sum of consecutive absolute differences, just the
number, on a line by itself. Sample Input: 7,3 67 35 89 37 100 36 4 Sample Output: 3 (By
choosing 35,37, 36. Thus 3 = |35 - 37| + |37 - 36|).
-------------------------------------------------------------------------------PROBLEM 5: Credits: 40 ~~~~~~~~~~ Your roommate is in the Civil engg. dept. His
project consists of setting hanging a heavy plane metal sheet from cables attached to the
roof. Bad. Theorem 4.7.18 in the Green book says that to minimize tensile strain(
DUH...) you have to have 4 (four) points from which the metal sheet is hung. So that
means that these 4 points must be coplanar. WORSE. Your roomie, having got JEE rank
4754, is worse than you. Since your JEE is nearly 1000 more than his, he thinks you are
GOD, and turns to you for help. He tells you that there are `N' points in 3D space which
represent the ends of the cables. He also tells you that all these points have non-negative
integer co-ordinates. Since you have a huge ego (rank 3500+ is GREAT, you feel) you
have to find 4 coplanar points, given that there ARE 4 coplanar points in the data.The
gentle smile replaced by a frown, you set to work. Input: The number of points `N' on the
first line. The co-ordinates of the points, in the format x,y,z -- separated by commas, on
the next N lines. NOTE: The points are numbered from indices 0 to (N-1), as they appear
in the list. Output: The indices of 1 set of 4 points, in the format: i j k l where i, j, k, l
represent the indices of the points. Sample Input: 5 2,0,0 0,2,0 1,1,1 1,1,0 0,0,2 Output: 0
1 3 4 (the plane is (x + y + z) = 2).
-------------------------------------------------------------------------------PROBLEM 6: Credits: 50 ~~~~~~~~~~ DANIYA time!!! Work time also for you
lethargic bum. The gentle smile on your face is conspicuous by its absence. Finally
DANDIYA day comes. Out of the small number of girls in IIT, an even smaller number
has arrived. SENIORS being SENIORS, get priority and pairs are formed. You, poor sod,
don't have a partner, and have to do the dirty work of arranging publix in circles. The
(lucky) boys have already formed the outer circle. The girls have formed the inner one.
Your newly elected G.Sec (your wingmate, remember?) puts you to work. The girls being
ladies, stay where they are. So you have to rotate the outer circle of boys so as to match
them with the girls they have paired up with, or decide if it can't be done. To avoid choas,
you would like to have the smallest number of movements.To add to your problems,
some guys won't mind dancing with some girls apart from their partners. Input: Two
strings of characters of equal length, each on a separate line. You have to find the least
index of the character in the second line where the 0th character in the first string should
go, so that the two strings match. The characters are numbered from 0 to (length - 1). In
short: If a(0) a(1) ... a(n-1) b(0) b(1) ... b(n-1) are the two strings, then find the minimum
'k' so that a(i) = b(k + i (mod n)); for all i = 0, 1, 2,.. (n-1); NOTE: Output -1 if such a 'k'
does not exist. Output: The index 'k' as specified above, just the number, on a single line.
NOTE: Output -1 if such a 'k' does not exist. Sample Input: aabaa abaaa Sample Output:
4 (Since the 0th character of the first string, a, matches with the 4th character of the
second string, so that if you take the 0th character to the 4th character the first string
matches with the second.) Epilogue: After spending 4 years in IIT Bombay, Powai400076, you permanently lose that gentle smile from your lips forever, but atleast learn
the value and importance of hard work, so that you are no longer a lethargic bum.
************************************************************************
***********************
SIEMENS INFO :
THIS PAPER CONSISTS 6 PARTS. all are multiple choice q's
1)general
2)c/unix
3)c++/motif
4)database
5)x-windows
6)ms-windows
we have written q's not acc. to each part.total 50. q's. time is
sufficient.
if u have basic idea about all of the u can easily answer the paper.
paper
-----1)which of following operator can't be overloaded.
a)== b)++ c)?! d)<=
2)#include<iostream.h
main()
{
printf("Hello World");
}
the program prints Hello World without changing main() the o/p should
be
intialisation
Hello World
Desruct
the changes should be
a)iostream operator<<(iostream os, char*s)
os<<'intialisation'<<(Hello World)<<Destruct
b) c) d)none of the above
3)CDPATH shell variable is in(c-shell)
a) b) c) d)
4) term stickily bit is related to a)kernel
b)undeletable file
c) d)none
5)semaphore variable is different from ordinary variable by
6)swap(int x,y)
{
int temp;
temp=x;
x=y;
y=temp;
}
main()
{
int x=2;y=3;
swap(x,y);
}
after calling swap ,what are yhe values x&y?
7) static variable will be visible in
a)fn. in which they are defined
b)module " " " "
c)all the program
d)none
8)unix system is
a)multi processing
b)multi processing ,multiuser
c)multi processing ,multiuser,multitasking
d)multiuser,multitasking
9)x.25 protocol encapsulates the follwing layers
a)network
b)datalink
c)physical
d)all of the above
e)none of the above
10)TCP/IP can work on
a)ethernet
b)tokenring
c)a&b
d)none
11)a node has the ip address 138.50.10.7 and 138.50.10.9.But it is
transmitting data from node1 to node2only. The reason may be
a)a node cannot have more than one address
b)class A should have second octet different
c)classB " " " " "
d)a,b,c
12) the OSI layer from bottom to top
13)for an application which exceeds 64k the memory model should be
a)medium
b)huge
c)large
d)none
14)the condition required for dead lock in unix sustem is
15)set-user-id is related to (in unix)
16) bourne shell has
a)history record
b)
c)
d)
17)wrong statement about c++
a)code removably
b)encapsulation of data and code
c)program easy maintenance
d)program runs faster
18)struct base {int a,b;
base();
int virtual function1();
}
struct derv1:base{
int b,c,d;
derv1()
int virtual function1();
}
struct derv2 : base
{int a,e;
}
base::base()
{
a=2;b=3;
}
derv1::derv1(){
b=5;
c=10;d=11;}
base::function1()
{return(100);
}
derv1::function1()
{
return(200);
}
main()
base ba;
derv1 d1,d2;
printf("%d %d",d1.a,d1.b)
o/p is
a)a=2;b=3;
b)a=3; b=2;
c)a=5; b=10;
d)none
19) for the above program answer the following q's
main()
base da;
derv1 d1;
derv2 d2;
printf("%d %d %d",da.function1(),d1.function1(),d2.function1());
o/p is
a)100,200,200;
b)200,100,200;
c)200,200,100;
d)none
20)struct {
int x;
int y;
}abc;
you can not access x by the following
1)abc-- x;
2)abc[0]-- x;
abc.x;
(abc)-- x;
a)1,2,3
b)2&3
c)1&2
d)1,3,4
21) automatic variables are destroyed after fn. ends because
a)stored in swap
b)stored in stack and poped out after fn. returns
c)stored in data area
d)stored in disk
22) relation between x-application and x-server (x-win)
23)UIL(user interface language) (x-win)
24)which is right in ms-windows
a)application has single qvalue system has multiple qvalue
b) " multiple " " single "
c)" " " multiple "
d)none
25)widget in x-windows is
26)gadget in x_windows is
27)variable DESTDIR in make program is accessed as
a)$(DESTDIR)
b)${DESTDIR}
c)DESTDIR
d)DESTDIR
28)the keystroke mouse entrie are interpreted in ms windows as
a)interrupt
b)message
c)event
d)none of the above
29)link between program and out side world (ms -win)
a)device driver and hardware disk
b)application and device driver
c)application and hardware device
d)none
30)ms -windows is
a)multitasking
b) c) d)
31)dynimic scoping is
32) after logout the process still runs in the background by giving
the command
a)nohop
b)
33)process dies out but still waita
a)exit
b)wakeup
c)zombie
d)steep
34)in dynamic memory allocation we use
a)doubly linked list
b)circularly linked
c)B trees
d)L trees
e)none
35)to find the key of search the data structure is
a)hask key
b)trees
c)linked lists
d)records
36)data base
--------------------------------------------------------employ_code salary employ_code leave
-----------------------------------------------------------from to
-------------------------------------1236 1500 1238 --- --1237 2000 1238 --- --1238 2500 1237 ------1237 --- --1237 --- --1237 --- ---------------------------- -------------------------------------select employ_code,employ_data ,leave
the number of rows in the o/p
a)18
b)6
c)7
d)3
37)DBMS
38)read about SQL,db
39)which is true
a)bridge connects dissimiler LANand protocol insensitive
b)router " " " " "
c)gateway " " " " "
d)none of the above
40)read types of tree traversals.
41)42)43) simple programs on pointers in c
_____________________________________________________________________
BEST OF LUCK
This is sisl paper given in iit kanpur. enjoy this.
All are multiple choice questions.60 questions to be answered in 60 mins.
Distribution of questions:
---10 questions from data structures and some general topics.
-----10 questions from Unix and C.
--7Questions from Data base.
----Remaining from Windows(x windows,MS Windows etc..)
The distribution is not exact.Only approximate.
Totally there are six sections as below:
1.General
2.Unix and c
3.RDBMS
4.C++/object oriented
TCP/IP
6not remembered.
The questions are as follows:
RDBMS----1.What is RDBMS...Def
2.Two tables are given.In 1st table 2 columns are there.one
isEmployee no,second is salary.In second table 3 columns are there,one is
employee no,second is date,3rd is salary.
Select employee no,from table1,table 2.
How many records it will contain?.(This is somewhat difficult).
3.What is transaction?
TCP/IP:
1.X.25 protocol belongs to which layer.
2,Order all the 7 layers in sequence
3,One node has 2 IP address but data goes through only one link.What is the
reason?
4,Router,Bridge,Gateway....Which one of these can not connect
two different LANS and is protocol sensitive.
5,Client sends server---reqest or demand or -----Choices
are given.
Another section...
1.main(argc,argv)
{
if(argc<1)
printf("error");
else
exit(0);
}
If this program is compiled without giving any argument ,what it will print.
2.What are the static variables...def
3.What is Dynamic allocation ?
4.Dead lock condition...What may be the condition for it.
5.Semaphore variable?..def
> 6.Most
************************************************************************
************************
TISL
part 1
it consists of number series.In some institutes alphabetical series is
given instead of number series.Iam having number series so iam sending
that.Please go through tha alphabetical tests also.
1. 19,24,20,25,21,26,? ans:22
2. 11,14,12,15,13,16,? ans: 14
3. 10,2,8,2,6,2,? a:4
4. 8,9,11,14,,18,23,? a:29
5. 25,25,22,22,19,19,? a:16
6. 14,2,12,4,10,6,? a:8
7. 7,16,9,15,11,14,? a:13
8. 40,42,39,44,38,46,? a:37
9. 3,18,4,24,5,30,? a:6
10. 18,20,22,20,28,20,? a:22
11. 18,20,10,12,4,6? a:0
12. 7,6,8,5,3,7,? a:4
13 9,18,21,25,20,? a:30
14 3,3,4,8,10,36,? a:33
15.30,28,25,20,34,28,? a:21
16. 4,8,16,32,64,128,? a:256
17. 8,16,24,32,40,48,? a:56
18. 13,11,14,12,15,13,? a:16
19. 6,18,36,108,216,648,? a:1296
20. 4,4,8,8,16,16,? a:32
21. 2,6,18,54,162,486,? a:1458
22. 4,20,35,49,62,74,? a:85
23. 10,18,15,23,20,28,? a:25
24. 4,10,8,14,12,18,? a:16
25 10,15,12,17,14,10,? a:16
part 2 consists of non-verbel reasoning(figures).So it is impossible for
me to send those.(25 questions)
part 3 (quantitative)
1.A clerk multiplied a number by ten when it should have been divided by
ten.The ans he got was 100.what should the ans have been?
a:1
2.If rs20/- is available to pay for typing a research report & typist A
produces 42 pages and typist B produces 28 pages.How much should typist A
receive?
a:rs12
3.The average salary of 3 workers is 95 Rs. per week. If one earns
Rs.115 and second earns Rs.65 how much is the salary of the 3rd worker.
Ans.105.
4.A 16 stored building has 12000 sq.feet on each floor. Company A rents 7
floors and company B rents 4 floors. What is the number of sq.feet of
unrented floor space.
Ans.60000
5. During a given week A programer spends 1/4 of his time preparing flow
chart, 3/8 of his time coding and the rest of the time in debugging the
programs. If he works 48 hours during the week , how many hours did he
spend debugging the program.
Ans. 18.
6. A company installed 36 machines at the beginning of the year. In March
they installed 9 additional machines and then disconnected 18 in August.
How many were still installed at the end of the year.
Ans .27
7. A man owns 2/3 of the market research beauro business and sells 3/4 of
his shares for Rs. 75000. What is the value of Business.
Ans.150000
8. If 12 file cabinets require 18 feet of wall space, how many feet of
wall space will 30 cabinets require?
Ans.45
9.A computer printer produced 176,400 lines in a given day. If the
printer was in operation for seven hours during the day, how many lines
did it print per minute?
Ans.420
10. From its total income, A sales company spent Rs.20,000 for
advertising, half of the remainder on commissions and had Rs.6000 left.
What was its total income?
Ans.32000
11. On Monday a banker processed a batch of cheques, on Tuesday she
processed three times as many, and on Wednesday she processed 4000
cheques. In the three days, she processed 16000 cheques. How many did
she process on Tuesday?
Ans.9000
12. The cost of four dozen proof machine ribbons and five dozen accouting
machine ribbons was Rs.160/-. If one dozen accounting machine ribbons
cost Rs.20/-, what is the cost of a dozen proof machine ribbons?
Ans.Rs.15
13. If a clerk can process 80 cheques in half an hour, how many cheques
can she process in a seven and one half hour day?
Ans.1200
14. In a library, there are two racks with 40 books per rack. On a given
dya, 30 books were issued. What fraction remained in the racks?
Ans.5/8
15. The average length of three tapes is 6800 feet. None of the tapes is
less than 6400 feet. What is the greatest possible length of one of the
other tapes?
Ans.7600
16. A company rented a machine for Rs.700/- a month. Five years later
the treasurer calculated that if the company had purchased the machine
and paid Rs.100/- monthly maintenance charge, the company would have
saved Rs.2000/-. What was the purchase price of the machine?
Ans.Rs.34000
17. Two computers each produced 48000 public utility bills in a day. One
computer printed bills at the rate of 9600 an hour and the other at the
rate of 7800 an hour. When the first computer finished its run, how many
bills did the other computer still have to print?
Ans.9000
18. If a salesman's average is a new order every other week, he will
break the office record of the year. However, after 28 weeks, he is six
orders behind schedule. In what proportion of the remaining weeks does
he have to obtain a new order to break the record?
Ans.3/4
19. On a given day, a bank had 16000 cheques returned by customers.
Inspection of the first 800 cheques indicated that 100 of those 800 had
errors and were therefore the available immediately for data processing.
On this basis, hwo many cheques would be available immediately for data
processing on that day?
Ans.14000
20. A company figured it needed 37.8 sq.feet of carpot for its reception
room. To allow for waste, it decided to order 20% more material than
needed. Fractional parts of sq.feet cannot be ordered. At Rs.9/- a
sq.feet, how much would the carpet cost?
Ans.
a. Rs.324 b) Rs.405 c) Rs.410 d) Rs.414 e) Rs.685
21. A tape manufacturer reduces the price of his heavy duty tape from
Rs.30/- to Rs.28/- a reel and the price of a regular tape from Rs.24/- to
Rs.23/- a reel. A computing centre normally spends Rs.1440/- a month for
tapes and 3/4 of this is for heavy duty tapes. How much will they save a
month under the new prices?
Ans.Rs.87
22. In a team of 12 persons, 1/3 are women and 2/3 are men. To obtain a
team with 20% women how many men should be hired?
Ans.8
23. The dimensions of a certain machine are 48" X 30" X 52". If the size
of the machine is increased proportionately until the sum of its
dimensions equals 156", what will be the increase in the shortest side?
Ans. 6"
24. In a certain company, 20% of the men and 40% of the women attended
the annual company picnic. If 35% of all the employees are man, what
percent of all the employees went to the picnic?
Ans.33%
25. It cost a college Rs.0.70 a copy to produce a Programme for the
homecoming football game. If Rs.15,000/- was received for advertisements
in the programme, how many copies at Rs.0.50 a copy must be sold to make
a profit of Rs.8000/- ?
Ans. 35000
Some extra questions other than you send to me are follows.
I already send view logic paper yesterday.
best of luck
-------------------------------------------------------------------------------TATA INFOTECH -99
*************
VERBAL
1.Depreciation: deflation, depression, devaluation, fall, slump
2.Depricate : feel and express disapproval,
3. incentive : thing one encourages one to do (stimulus)
4. Echelon : level of authority or responsibility'
5. Innovation : make changes or introduce new things
6. Intermittent : externally stopping and then starting
7. Detrimental: harmful
8. Conciliation : make less angry or more friendly
9. orthodox: conventional or traditional, superstitious
10. fallible : liable to error
11. volatile : ever changing
12. manifest: clear and obvious
13.connotation : suggest or implied meaning of expression
14. Reciprocal: reverse or opposite
15. Agrarian : related to agriculture
16. vacillate : undecided or dilemma
17. expedient : fitting proper, desirable
18. simulate : produce artificially resembling an existing one.
19. access : to approah
20. compensation: salary
21. Truncate : shorten by cutting
22. adherence : stick
23. Heterogenous: non similar things
24. surplus : excessive
25. Assess : determine the amount or value
26.Congnizance : knowledge
27. retrospective : review
28.naive : innocent,rustic
29. equivocate : tallying on both sides, lie, mislead
30. Postulate : frame a theory
31. latent : dormant, secret
32. fluctuation : wavering,
33. eliminate : to reduce
34. Affinity : strong liking
35. expedite : hasten
36. console : to show sympathy
37. adversary : opposition
3. affable : lovable or approachable
39. Decomposition : rotten
40 agregious : apart from the crowd, especially bad
41. conglomaration: group, collection
4. aberration: deviation
43. aurgury : prediction
44. crediability : ability to common belief, quality of being credible
45.coincident: incidentally
46.Constituent : accompanying
47. Differential : having or showing or making use of
48. Litigation : engaging in a law suit
49.Maratorium: legally or offficiallly determined period of dealy
before
fulfillment of the agreement of paying of debts.
50. negotiate : discuss or bargain
51. preparation : act of preparing
52. Preponderant : superiority of power or quality
53. relevance : quality of being relevant
54. apparatus : applianes
55. Ignorance : blindness, in experience
56. obsession: complex enthusiasm
57. precipitate : speed,active
Section III
Letter Series
These are too tough. Maintain time 26 questions ----- 10min
1. A C BDEFGI - I H K J L ANS: H
2. AIZBEYCIXDI - GENJW ANS;W
3. ADGJMP - RWTS ANS; S
4. ABCEFGIJK - MLONP ANS; M nOTE: MLONP ARE GIVEN OPTIONS
5. ABFGKLPQ - TSVUW ANS;U
6 JWXUVST - QPSET ANS; Q
7. ARHXYTDTWST - NPTKR ANS; P
8.FMBIPZVIEV - IRYOU
9. NZI YCX KWF - JFVMY ANS;V
10. AASASPASPKA - RQTSU ANS;S
11. AECPS - TRUE ANS;U
12. BBPRDDLNFFIK - HQJIK ANS'H
13 AZEXIVMT - RQNSO ANS: Q
14. ABDGKP - LIWUX ANS:U
15. BCDAEGHIFJLMN LKNMO ANS: K
16. XWEFGVUHIJK - PNSRT ANS: T
17. ODJTOPQNOERT - QOUVW ANS;O
18. PRNUUPEJRBB - HVUNE ANS: E
19.LULMGMNFNPS - ONQPS ANS:P
QUESTIONS ARE NOT IN SEQUENCE.
NUMERICAL
1.420% OF 7.79 = 32.718
2 3427 / 16.53 = 202
3. 10995 /95 = 115.7365
4. 43+557-247 =353
5. 3107*3.082= 9591
6. 48.7 + 24.9 - 8.7 = 64.90
7.525.0/47.8 = 11
8. (135-30-14)*7 - 6 +2 = 3
9.3/8 * 5.04=1.89
10.697 /219 =3.18
11.8/64 +64/16 = 4.14
12.298*312/208 = 453.54
13. 0.33 *1496 /13 = 37.98
14.0.26 + 1/8 = 0.385
15.66.17+1/3= 67.03
16. 2.84+1/4= 3.09
17. 33% OF 450 = 148.5
18. 907.54 / 0,3073= 3002
19.tHERE ARE two categories of persons in ratio A, b i.e.A:B = 2:3 A
type
earns 2.5 dollars/hr and B type 1 dollar/hr total money earnedby both
is
24dollars. then total number of persons
Ans: 15
20.Question not clear
Slowing running - n hours - A
Medium running - B
fast running - k hours - c
Ans: nA+kC
21. Tottal balls z,red balls N remaining are blak balls,then %of black
balls equal to Ans: z-n/z*100
22. Multiplication three digits and two digits number will result the
Ans: HInt: four digit number first number must be one.
23. A= C;B=2D what should be do to make the ratio same. i.e.a/b = c/d
Ans: multiply A by 2
24. P- Total number of compoentns
Q= defective number of compoentns
%of non defective equals to p-q/p*100
25. Cost of article x,first discount is y% of cost, seconddiscount is
z%
of cost . The price of x is
Ans: x(1-y/100)(1-z/100)
26.Prime number a) 119 b) 115 c) 127 d) none Ans: C
27. A/B = C;C>D then
Ans:A is always greater than D
28..B>Cand AA then which expression will be highest value
Ans: AB
37. K,L -- Men ;X, Y -> Ans:kX + Ly
38. If A,B are same number, which one of the following doesnot satisfy
this Ans: A*B/B**2
39. X- bulbs'; y - broken; % of non broken bulbs Ans: x-y/x*100
40. Adding X, Y to A equals to Ans: a (large expression)
41.Salary s permonth, tax x% of the salry, r% of salary is deducted
what
is the income.
Ans: s*(1-(x+R)/100
42. Add three digits and two digits numbers the first digit is
Ans:1 (four digit number starting with one)
43. 0.512 * large number = ?
Ans:divide the given number by 2
44.In 10% balls 5 are defective, % of defective
Ans:50%
45.6.29% of 2.8 = 0.18
46.0.398*456=181.49
47.0 < x5
person 3 says 3N>20
person 4 says 3n>10
person 5 says N
>Group discussion topics:
>Instrctions:
1) There are 7 flow charts & each has 5-6 blank rectangles/diamonds with
subquestion no. in rectangle/diamond. you have to fill the blank from the
5 options given against respective question no.
2) You have to understand the logic & then it is very easy to fill the
blanks.
3) they had provided some information which you have to use for getting
answers.
Flow charts:
1) there are 3 boxes of 3 balls each. you have to select the heaviest
among all.
<select box 1&2>
|
<is wt.1=wt.2>--No----(is wt1 > wt.2)--No--(select box2)
|||
Yes Yes |
|||
select box 3 select box 1 |
|||
|------------------------|------------------------|
|
select two balls
|
is wt.ball.1 = wt.ball.2 --- No -- is wt.ball.1> wt.ball.2 -- No
|||
Yes Yes |
| | ball.2
ball.3 is ball.1 is is
heaviest heaviest heavist
so there will be some blank in this flow chart and u have to fill up the
blanck with correct option.
Q2)
there are red and black balls. if ball is red then one point. if
ball is black and previous ball is red then two points. For winning u
have to get seven points. No point for same color consecutive balls.
|----------- select ball
||
| is ball red --- Yes -- Is previous --No--| | ball red
| No p=p+1 |
| | No
| is previous |
| ball black --No----------- p=p+2 --count= count+1
|||
| Yes |---is ball left
||||
| No pointQ3)
Classify objects in class A, class B and scrap. for classfing u
have to do diffrent test such as weight, material etc. and Flow char for
this ques. will be there along with some blanks.
Q4)
There is production process in which action depend on temprature and
pressure. and there are temp. and press. controls.
Q5)
find max. and min. of the 12 nos. there will array and u have to
arrange the numbers in assending/ descending order and find out max. and
min.
Q6)
diffrent age group are given and also diffrent salary slabs are
given. so depending on the salary group as well as his group u have to
fill the person in particular class. (ques. is not in exact form.)
>1. Brain drain: i.e. related to why immigration to U.S; I opposed
>partially and supported partially
>
>2. Electronic media effect; Internet, TV ,Email multimedia
>
> G.D they won't eliminate so many people. but you have participate
>with enthusiasm.You talk something. Interview as usual, stereoscopic
>questions.like TCS.
>
>
> I went upto interview, afterwards out.
COMPUTER VISION (CV)
> ====================
>
>1. |X-A| ==A-X, Ans. c. x<=a
>2. There is six letter word VGANDA. How many ways you can arrange the
>letters
> in the work in such a way that both the 'A's are together.
> ans. 120
>3. It two cards are toked on after other without replacing from a pack
>of
> 52 cards. What is the probability for the two cards to be queen.
> ans. 1/17 * 1/13
>4. 51 X 53 X ..... X 59.
> a. 99!/44! b. c. d (99! X 25! )/( 2^2^4 X 49! X 51!)
> ans. d.
>5. The ratio of boys to girls is 6:4. Sixty percent of the boys and
>fourty
> percent of the girls lake lunch in the canteen. What percent of the
>class
> takes lunch in the canteen?
> ans. 52%
>
>
>DATA SUFFICIENCY
>--------------->a. Only statement A is sufficient,
>b. Only statement B is sufficient,
>c. Both are necessary,
>d. Both are not sufficient.
>
>6. X is an integer. Is X divisible by 5?
> a. 2X is divisible by 5,
> b. 10X is divisible by 5.
> ans. a
>7. Is Anna the tallest in the class
> a. Anna is the tallest girl,
> b. Anna is taller than all boys.
> ans. c
ANALYTICAL
>---------> Zulus always speak truth and Hutus always speak lies. There are
>three persons A, B,&C. A met B and says "I am a Zulus as I am a
>Hutu". We don't know
> what exactly he said. The B meets C and says to C that " A is a
>Zulu".
> Then C replied " No, A is a Hutu".
>
>9. How many Zulus are there?
> ans. 2
>10. Who must be a Zulu?
> ans. B, b (may be)
>
>
> A father F has 5 sins, P,Q,R,S,T not necessarily in this order. Two
>are
> of same age. The eldest and teh youngest cannot be twins. T is elder
>to R
> and younger to Q and S has three older brothers.
>
>questions:. 11, 12, 13, 14.
>
> Who are the twin?
> Who is the oldest/youngest.
>
>ans. order may be QTRPS
>
> There are 7 people who take a test, among M is the worst, R is
> disqualified. P & S obtain same marks, T scares less than S and Q
>scores
> less than P, N scores higher than every one.
>
>questions: 15, 16, 17, 18
> ans. NPSTQRM
>
> highest marks is to 'N'
> least marks is to 'M'.
>
>UNIX & C
>---------->
>19. What does chmod 654 stand for
> ans. -rw-r-xr->20. Which of following is used for back_up files?
> a. compress b. tar c. make d. all the above
> ans. d
>21. What does find command do?
> ans. search a file
>22. What does "calloc" do?
> ans. A memory allocation & initialising to zero.
>23. What does exit() do?
> ans. Came out of executing program.
>24. What is the value of the 'i'?
> i= strlen("Blue") + strlen("Purple")/strlen("Red") - strlen("green")
> ans. 1
>25. i = 2;
> printf("%ld %ld %ld %ld ", i, i++, i--, i++);
> ans. chck out answer is wrong.
>26. Using pointers, changeing A to B and B to A i.e., swapping the
>function
> using two addresses and one temporary variable, How will be the
>function
> look like?
> ans. swap (int *, int *, int)
>27. In '^' how are the arguments are passed by befault?
> ans. by value.
>28. Find the prototype of Sine function
> ans. extern double sin(double);
>29. Scope of a global variable which is declared as static?
> ans. File.
>30. ASCII problem, i = '^'-...
> ans. 6
>31.What is the output of,
> printf("Helow \0 is the world");
> ans. Hello is teh world.
>32. Clarifying the concept addresses used ever arrays, i.e., changing
>the
> address of a
************************************************************************
*******************
SATYAM COMPUTERS (HYDERABAD)
---------------------------Release : 1997
--------ANTONYMS
--------1)disregarded A) heed
2) GRE book pg no. 407 q.no. 13-16 para ie:in a certain society....
3)GRE .............446, 8th quest A) 1
4)GRE..............487, 8th.....
5).................488, 14th......
6).................513, 4 &8 .....
7) if A+B+C+D is a +ve no's then
a) one must be +ve no's
b) two ..............
c)three .............
d)all ................
8) GRE pg no.586 32nd qst.
9)if x+y =3 and y/x=2 then y=
a)0 b) 1/2 c)1 d)3/2 e)2
17) how many squares with sides 1/2 inch long are needed to cover
a rectangle that is 4 feet long & 6feet wide
a)24 b)96 c)3456 d)13824 e)14266
18)GMAT pg.no. 439 passage 1 with question 1to9 on pg.440-441
excluding qst.no.2
GMAT pg.442 passage. 2 excluding q.nos.11, 15.
20) successive discounts of 20% and 15% are equal to a single
discount of ;
a)30% b) 32% c)34% d) 35% e)36% ans) 32%
if x/y =4 and y is not '0' what % of 'x' is '2x-y'
ans:175%
if x=y=2z and xyz =256 then x=
ans: 8
23)if 2x-y=4 then 6x-y is ans:12
1-8 q's on bus route. a b c d e
a x 8 15 20 7
b 6 x 9 13 21
c 10 12 x 3 11
d 9 1 18 x 5
e 3 4 17 14 x
where x is starting point.a&e are first and last stations.and b,c,d
are intermediate stations. fig's are no. of passengers.cost of ticket
is 0.7Rs /pass.
between any successive stations. based on this few q's were given.
the fig's
are not correct. q's like total no.of pass.in onward journey.
Rest of q's are
2 statements were given. u have to answer they are correct or not
.littlebit
easy.
section3
-------simple q's from r.s agarwal_quantitative apt.
1.1/10power18 - 1/10power20 .....value?
2.pipes-leaking-cisterns.
paper2
-----------1.general awareness.2.
1.father of computers
2.expand HTML,DMA,FAT,LAN,WAN,FDDetc
3.intel's first micropro...a.pentium b.pentiumproetc
4.1024(dec)convert to hexa&octal
5.first micro.pro.a)8085b)8088etc
6..motorola's processor name?
7.windows_NT expand
8.simple programs on pascal&c
9.diff between 8087,8086 (which is latest vers.)
10.some basic q's on GUI.
11.q's on IBMpc
12.one program on finding factorial
--------------------------************************************************************************
***********************
PCS
// This is another paper, we don't have this paper as such, I am
giving
// over all idea of paper with some question...
// There r 5 sections; 5 questions in section1, 5 in section 2
// 8 marks in english (section 3); section 4 TRue or False type
/*********************************************
Section1:
5 questions.. (Mutiple choices)
i.e select any one of the following for 5 questions;;
A) only 1 is sufficent
B) only 2 is sufficent
C) both nessary
D) both are insufficent
E) either is sufficent
1. .......... (Don't know)
2. one composition contains... 5/4 L 6/14 L....
(Ans. both r insufficent)
3. x fabric.... 6.50 per meter , 25% wholesale...
(Ans: both r required)
4 & 5 don't know....
/**************************************/
Section 2 (Analitical...)
1. Average 3years 45,000, 1st 1.5 times, 2nd 2.5 times..
(Calculate in this way... (x+1.5x+2.5x)/3 = 45000 i.e 5x/3 =
45000 )
then calculate required value...)
2. Three vehecle speed ratio 1:2:3 & time ratio 3:2:1...
Distance ratio ??
(Ans: 3:4:3.. check once)
3. some km/hr problem...
(Ans: 150 km/hr)
4 & 5 don't know....
/***********************************/
Section 3 (English - 8 marks.. mutiple choice..)
Don't know...
/******************************/
Section 4 (True or Flase type..)
1. Square contains all angles , one object does not contain angles;
-------------------------------------------------------------------------------///////////////PATNI NEW OVER at jadavpur 99////////////
____________
1.what is the angle between teo hands of a clock when time is 8-30
ans:75(appro
2.a student is ranked 13th from right and 8th from left.how many are
there(similer)
3.a,b,c,d,e,f are arranged in a circle b is to right of c and so on(rs
aggrewal)
4.chain rule(work&time)
5.puzzle test.some data is given and he asked three qustions below.based on
data
we have to answer.
6.six questions on venn diagrams.
7.5 years ago sum of ages of father and son ans:40,10
8.assertion and reasoning 1.clouds 2.capital city of dweloped corentira ans
for
both is :a
9.man walks east & from turns to right & from to left &then 45degrees to
right.in which direction he went ans:north west
10.aa-b-bb-aaa11.96,85,....(a series with diff 11),3,15,45,....,total 3 questions are
given on
series
12.a student got 70% in one subject,80% in other.to get overall 75% how much
he
should get in third subject.
12.a news pwper must have a.news b.advertizements 3.editor 4.date 5.paper
13.if clouds are air, air are water and so on where birds fly?
14.press,cinema,tv ans:mass media
15.3 qustions on rs aggrewal relations i.e first few chapters of
aggrewal(english)
16.a man showed to a woman sitting in a pack & told to his friend.she is
the
daughter of my grand mother only son ans:daughter
group disscussion topic
1.if you become muncipal corporater what steps you take to develop your
area.
2.if you become administrative officer of this university what steps you
take to
improve standards.
3.tell what are the seven problems in calcutta and solutions to problems?
4.abortion is legal or illegal
the following two topics are omportant they asked the same topics to many
students by changing the numbers
5.in 2050 a nuclear disaster has ocurred and 50 persons are saved.which are
of
age above 15.of them 20 know 6 subjects and you have to choose only 3 of
six
subjects so that resticted resorces can used for future
subjects are 1.enggineering 2.medical 3.law 4.social sciences 5.life
sciences
6.---6.in space ship 5men are going1.docter,drug asdditive 2.lady lawer has done
crime 3.teacher emotinally imbalanced
4.18.18 year old aeruonautical engineer 5. noble lauraut .suddenly some
thing
happend
and oxygen is avaliable to only three people to use which of three you
choose
interview
here they asked only personal.relating to what you have written in
sychometric
test
and some puzzles
one puzzle is 10 machines are there only one is defective iteams are coming
out
how tdo you find out which is defective
second: *
* * how do you reverse this in two transitions
***
* * * *----------------------------------- two transistors are connected Vbe is 0.7volts .this is
simple ckt.one
transistor is diode equivalent. & asked the o/p across the 2 nd transistor.
2.simple k map ans is Bbar.
3.
Emitter
---R-------transistorbase| -| --collector
in above capacitor is connected parallel with resistance r.capacitor
is not shown
in fig.capacitor is used for in this ckt:
ans:a.speedupb.active bypass c.decoupling
4.
-----R------I----------o/p
|___R____ |
in above r is resistence.I is cmos inverter.
then ckt is used for:
a.schmitt trigger b.latch c.inverter d.amplifier
5.simple amplifier ckt openloop gain of amplifier is 4.V in =1v.asked for
V x?
amplifdier + is connected to base. - is connected to i/p in between 5k is
connected.
from o/p feedback connected to - of amplifier with 15k.this is ckt.
6.resistence inductot cap are serially connected to ac voltage 5
volts.voltage across
inductor is given.R I C values are given & asked for
voltages across resistence & capacitor.
7.
___ R_____
||
---R------OPAMP ---------|--R1 R1 is for wjhat i mean what is the purpose of R1.
|
ground
8.asked for Vo at the o/p.it is like simple cmos realization that is n block
is above
& p block is below.Vdd is 3 volts at supply.V threshold 5 volts.
9.2 d ffs are connected in asyncro manner .clock 10 MEGAHZ.gate delay is 1
nanosec.
A B are the two given D FFs.asked for AB output is:
a.updown
b.up c. updown glitching like that (take care abt glitching word)
10.
----------------| subtractor|---------o/p
|___HPF____|
the ckt is LPF ,HPF or APF ?
11.in a queue at the no of elements removed is proportional to no of elements
in
the queue.then no of elements in the queue:
a.increases decreases exp or linearly(so these are the 4 options given choose
1 option)
12.with 2 i/p AND gates u have to form a 8 i/p AND gate.which is the fastest
in the
following implementations.
ans we think ((AB)(CD))((EF)(GH))
13.with howmany 2:1 MUX u can for 8:1 MUX.answer is 7.
14. there are n states then ffs used are log n.
15.cube each side has r units resistance then the resistance across diagonal
of cube.
16.op amp connections asked for o/p
the answer is (1+1/n)(v2-v1).check it out.practise this type of model.
17.
_____________ supply
---|__ ___|
Ii >________ |___ Tranistot
> _______Vo
|
|
R|
| | Io
ground.
asked for Io/Ii=? transistor gain is beta.
a.(1+beta)square b.1+beta c. beta
18.y=kxsquare. this is transfer function of a block with i/p x & o/p y.if i/p
is
sum of a & b then o/p is :-a. AM b.FM c. PM
19.
------MULTIPLIER--- |
||
_____R__|__OPAMP______________________Vo
--|
ground.
v in = -Ez then o/p Vo =?
answer is squareroot of -Ez.multiplier i/ps are a & b then its
o/p
is a.b;
--------------------------------------------------------------------------------
1.1 True
1.2 False
1.3 True
************************************************************************
************************
Lucent Sample Test Paper
Aptitude
Q1 .6*12*15 is the volume of some material. How many cubes of edge 3 can be inserted
into it ?
Ans.40
Q2. Two pipes can fill a tank in 10 and 12 hours respectively while third pipe will make
the tank empty in 20 hours. If all three pipes operate simultaneously, in how many hours
the tank will be filled ?
Ans.7hours 30 minutes.
Q3. Cost of an item is x. It's value increases by p% and decreases by p% Now the new
value is 1 rupee, what is the actual value ?
Ans.(1000)/(1000-p*p).
Q4. A right circular cylinder and a cone are there. Base radius of cone is equal to radius
of cylinder. What is the ratio of height to slant side if their volume are the same?
Q5. Distance between two poles is 50 meters. A train goes by 48 at a speed of kmph. In
one minute how many poles will be crossed by the train ?
Q6. A pole seen from a certain distance at an angle of 15 degrees and 100 meters ahead
by 30 degrees. What is the height of pole ?
Q7. For 15 people--each has to pay Rs.20.For 20 people--each has to pay Rs.18. For 40
people--how much has each to pay ?
Q8. If p=2q then q=r*r , if p-odd then q is even, whether r is even or odd ?
a) first condition is sufficient
b) second condition is sufficient
c) both are sufficient
d) both are not sufficient
Q9. If he sells 40 mangoes, he will get the selling price of 4 mangoes extra, What is his
percentage increase in profit ?
Ans. 25%
Q10. 100 glasses are there. A servant has to supply glasses to a person If he supplies the
glasses without any damage he will get 3 paise otherwise he will loose 3 paise. At the end
of supplying 100 glasses if he gets 270 paise, how many glasses were supplied safely.
Ans. 95
Q11. Q is not equal to zero and k = (Q x n - s)/2 find n?
(a) (2 x k + s)/Q
(b) (2 x s x k)/Q
(c) (2 x k - s)/Q
(d) (2 x k + s x Q)/Q (e) (k + s)/Q
Q12 - Q16
A causes B or C, but not both
F occurs only if B occurs
D occurs if B or C occurs
E occurs only if C occurs
J occurs only if E or F occurs
D causes G, H or both
H occurs if E occurs
G occurs if F occurs
Q12. If A occurs which of the following must occurs
I. F & G
II. E and H
III. D
(a) I only
(b) II only
(c) III only
(d) I, II, III
(e) I, II (or) II, III but not both
Ans. (e)
Q13. If B occurs which must occur
(a) D
(b) D and G
(c) G and H
(d) F and G
(e) J
Ans. (a)
Q14. If J occurs which must have occurred
(a) E
(b) either B or C
(c) both E F
(d) B
(e) both B and C
Ans. (b)
Q15.Which may occurs as a result of cause not mentioned
(1) D
(2) A
(3) F
(a) 1 only
(b) 2 only
(c) 1 and 2
(d) 2 and 3
(e) 1,2,3
Ans. (c)
Q16. E occurs which one cannot occurs
(a) A
(b) F
(c) D
(d) C
(e) J
Ans. (b)
-------------------------------------------------------------------------------Technical
Q1.Which is the fastest logic ?
Ans. ECL
Q2. 202.141.65.62 type of IP address belong to which class ?
Ans. class B
Q3. Mod K ring counter requires how many number of flip flops ?
Ans. K
Q4. What is the ideal op-amp CMRR ?
Ans. infinity.
Q5.For a 13-bit DAC the MSB resistance is 2kohms. What is the LSB resistance ?
Ans. 2kohms * 2 12
Q6. How many mod 3 counters are required to construct mod 9 counter.
Ans.2
Q7. Piggy backing is a technique for
a) Flow control
b) Sequence
c) Acknowledgement
d) Retransmission
Ans. (c)
Q8. The layer in the OST model handles terminal emulation
a) session
b) application
c) presentation
d) transport
Ans. (b)
Q9. Long int size is
a) 4 bytes
b) 2 bytes
c) compiler dependent
d) 8 bytes
Ans. (c)
Q10. Find the output of
x=2,y=6,z=6
x=y=z;
printf("%d",x);
Q11. FTP is carried out in ___________ layer ?
Other questions : Problem related to pointers.Refer Page.123 of C Programming, by
Kernighan and Ritchie.
Few question related to C++
************************************************************************
************************
HUGHES
There were two papers one was aptitude ( 36 questions) and other was
technical(20 questions)
1: given an expression tree and asked us to write the in fix of that expression
four choices2:
global variables in different files are
a:at compiletime
b) loading time
c) linking time
d)execution time
3)size of(int)
a) always 2 bytes
b) depends on compiler that is being used
c) always 32 bits
d) can't tell
4)which one will over flow given two programs
2
prog 1: prog2:
main() main()
{{
int fact; int fact=0
long int x; for(i=1;i<=n;i++)
fact=factoral(x); fact=fact*i;
} }int factorial(long int x)
{
if(x>1) return(x*factorial(x-1);
}
a) program 1;
b) program 2;
c) both 1 &2
d) none
}
5) variables of fuction call are allocated in
a) registers and stack
b) registers and heap
c) stack and heap
d)
6)
avg and worst case time of sorted binary tree7) data structure used for proority queue
a) linked list b) double linkedd list c)array d) tree
8)
main(){
char str[5]="hello";
if(str==NULL) printf("string null");
else printf("string not null");
}
what is out put of the program?
a) string is null b) string is not null c) error in program d) it executes but p
rint nothing
9)there are 0ne 5 pipe line and another 12 pipe line sates are there and flushed
time taken to execute five instructions
a) 10,17
b) 9,16
c)25,144
d)10)
for hashing which is best on terms of buckets
a)100 b)50 c)21 d)32 ans 32
11)void f(int value){
for (i=0;i<16;i++){
if(value &0x8000>>1) printf("1")
else printf("0");
}
}
what is printed?
a) bineray value of argument b)bcd value c) hex value d) octal value
12)void f(int *p){
static val=100;
val=&p;
}
main(){
int a=10;
printf("%d ",a);
f(&a);
printf("%d ",a);
}
what will be out put?
a)10,10
13)
struck a{
int x;
float y;
char c[10];
}
union b{
int x;
float y;
char c[10];
}
which is true?
a) size of(a)!=sizeof(b);
b)
c)
d)
14)# define f(a,b) a+b
#defiune g(c,d) c*d
find valueof f(4,g(5,6))
a)26 b)51 c) d)
15)
find avg access time of cache
a)tc*h+(1-h)*tm b)tcH+tmH
c) d) tc is time to access cache tm is time to access when miss occure
16)
main()
{
char a[10]="hello";
strcpy(a,'\0');
printf("%s",a);
}
out put of the program?
a) string is null b) string is not null c) program error d)
17)
simplyfy k map
1xx0
1x01
18)
int f(int a)
{
a=+b;
//some stuff}
main()
{
x=fn(a);
y=&fn;
what are x & y types
a) x is int y is pointer to afunction which takes integer value
19) char a[5][15];
int b[5][15];
address of a 0x1000 and b is 0x2000 find address of a[3][4] and b[3][4]
assume char is 8 bits and int is 32 bits
a) b) c) d)
there are 20 questions all in techinical paper and 36 questions in appititude te
st
in appititude thay have given all diagrams and asked to find what comes next
thay are quite easy and i hope if u practice r.s aggraval u can do it easily
for tecnical thay have given 1 hr for 20 questions and for not technical thay ha
ve given only 40 min
and 36 questions
this is the paper i have right now
1. main()
{
fork();
fork();
fork();
printf("\n hello");
}
How many times print command is executed?
2.main()
{
int i,*j;
i=5;
j=&i;
printf("\ni= %d",i);
f(j);
printf("\n i= %d",i);
}
void f(int*j)
{
int k=10;
j= &k;
}
output is
a 5 10
b 10 5
c55
d none
3.
some question on pipeline like you have to findout the total time
by which execution is completed for a pipeline of 5 stages.
4.
main()
{
int *s = "\0";
if(strcmp(s,NULL)== 0)
printf("\n s is null")p
else
printf("\n s is not null");
}
5.
some syntax which returns a pointer to function
6. size of integer is
a. 2 bytes
b 4 bytes
c. machine dependant
d compiler dependent.
7.max and avg. height of sorted binary tree
a. logn n
b n logn
8.
some question. like the number was shifted everytime by one and bitwise and with
10000000.
one was supposed to find what the code was doing.
I feel the answer was most probably finding decimal value.
9. int a[5][4]
int is 2 bytes base address for array is 4000(Hexa)
what will be addr for a[3][4]?
int is 4 bytes same question.
10.
implementation of priority queue
a. tree
b linked list
c doubly linked list.
************************************************************************
************************
CTS 98
IIT MADRAS
analogies
--------1. slur : speech
ans: smulge : writing (choice is B)
7. cpahlet : shoulder
ans: ring : finger (choice is C)
8. vernanlar : place
ans: finger print : identical (choice is B)
opposite
-------9.corphlent
ans: emaciated (choice is D)
10. officious
ans: pragmate (choice is D)
11. dextrous
ans: clumsy (choice is B)
12 -14: each sentense is broke to four sections a,b,c,d.choose which has mistake mark (e)
if you find no mistake.
12:a)phylchologists pointout that
b)there are human processes
c)which does not involve d) the use of words(choice is A)
13:a)jack ordered for
b)two plates of chicken
c)and a glass d)of water (choice is A)
14:a) politics is
b) (choice is
A)(are)
16 - 20: each question of group of questions is based on a passage or a setof conditions
for each question,select the best answer choice given.
(i).if it is fobidden by law if the object of agreement is the doing of an act,that is
forbidden by law the agreement is void.
(ii). if it is of the nature that,it would defeat the provision of any law is the agreement is
void.if the object of agreement is such that thing got directly forbidden by law it would
defeat the provision of statuary law.
(iii). if the object of agreement is fraddulent it is void.
(iv). an object of agreement is void if it involves or implies to the personnal property of
another.
(v). an object of agreement is void where the constant regards as ignored.
(vi). an object of agreement is void where the constant regards is as opposed to public
policy.
17. A,B,C enter an agreement for the division a many them of gains acqest or by be
acquit by them by them by the argument is void as:
ans: ---- (choice is D)
21-25) An algorithem follws a six step process za,zb,zc,zd,ze,zf, it is governed by
follwing:
(i) zd should follw ze
(ii) the first may be za,zd or zf
(iii) zb and zc have to be performed after zd
(iv) zc must be immediately after zb
21) ans:- D22) if za the first set zd must be
a) 3rd
b)5th
c)2nd
d)4th ans:- A or D (probably a)
23) zf can be 3rd or 5th------any of the six, first, second or forth only,any of first four
only none these:
ans:- B
24) if zb must follw za then
a)za can only 3rd or fourth
b) first or second
c) can not be third
d) fouth or fifth
e)none
ans:- A
25) ze is third term the no of diff operations possible is
ans:- D (dabad)
26-31) ravi plans six sep-- x,y,z,w,u,v in rows no 1 to 6 ,according to the follwing
conditions he must plant x before y and u he must plant y " w the 3rd has to be z
26) which could be in order
a) xuywzv
b) xvzyuw
c)zuyxwv
d)zvxuwy
e) wyzuvx
ans:- B
27) which is true
a) z before v
b) z before x
c) w before u
d) y before u
e) x before w
ans:- D
28) if he plans v first which is second x,y,z,w,u so ans is 'x'.
choice is A.
29) which is true
a) x,3
b)y,6
c)z,1
d)w,2
e)u,6
ans:- E
30) if he plans b 6th which would be first and second
a) x and w
b) x and y
c)y and x
d)w and z
e) w and u
ans:- B
31) if he plans w before u and after v he should plan w at
a) first
b)second
c)fourth
d)fifth
e)sixth
ans:- D
32)thursday
33)a&d
34)south hit
35)
36)at a certain moment a watch showes 2 min lag althogh it is fast.if it showed a 3 min
lag at that moment ,but gain 1/2 min more a day than it does. it would show the true time
one day sooner than it usually does .how many mins does the watch gain per day.
a).2
b).5
c).6
d).4
e).75
ans : e
---->(discount problem) 20%->15%then->32% (ans:32%)
37)in 400m race a gives b a start of 7 sec & beats by 24m.in another race a beats by
10 sec.the speeds are
a)8,7
b)7,6
c)10,8
d)6,8
e)12,10
ans:c(10,8)
38)3x+4y=10
x cube+y cube=6 minimum value of 3x+11y=?
ans=?
39)0.75
40)41)sink---7.7kms--->fills 2 1/4 t is 5.5 min. 92 tonnes enough.. sink throws out 18
tonnes/hr.
avg. speed to
a)1.86
b)8.57
c)9.4
d)11.3
e)10.7
42) . ______
/ \ 2 2 cms
/_a_\ ______
/ \ 3 2 cms area of the d=50 cm square
/___b___\ ______ what is the area of the b=?
/ \ 4 2 cms
/_____c_____\ ______
/ \ 5 2 cms ans=(10.7)
/_______d________\ ______
43)600 tennis players 4% ->wrist band on one wrist of remain 96%->25%->on
both hands
remain no of ---(ans:312)
44)312(doubt) or 432
45)in how many ways 5e,6s,3f be arranged if books of each language are to be kept
together
17,64800,90,58400,3110400
ans:e(3!*5!*6!*3!=3110400)
46)--47)three types of the a,b,c costs Rs. 95/kg,100/kg&70/kg .how many kg of each be
blended to produce 100 kg of mixture worth Rs.90/kg,gives that the quntities of b&c
are equal
a)70,15,15
b)50,25,25
c)60,20,20
d)40,30,30
ans:b
48)water milk problem
49)x+y+z=w
q)two distinct no's are taken from 1,2,3,4......28
a)probably that the no is 6 -->1/14
b)probably that it exceeds 14 -->1/28
c)both exceed 5 is 3/28
d)less than 13->25/28 (24/28)
e)none
ans:d
51)1200 died 6
due to acc 7
55)170%
CTS '99
Pondicherry
SECTION I - 8 questions.
Series.
1. Interchange of letters in a word and the adjacent letters are also to be changed. given
letters series like [also few condotions]
AAABBB=
ABABAB=
LET QUESTION IS ABBAAB
If we apply 25 on this it means we have to interchange the letters at positions 2 and 5, and
we have to change the adjacent letters 2 and 5 from A to B and B to A.
That is q's A B B A A B
after Step 1 i.e interchange 2 and 5.
now change adjacent elements of 2 and 5...finally answer becomes
Ans: B A A B B A
//Hint: As per question papers 5 questions above like but numbers
change.
REMAINING 3 QUESTIONS:
6. To get AAABBD from BBBAAA what ot apply:a) 25 b) 34 c)25 & 34 d) noneSECTION II
1. Given the function f(n a b c ) = ac if n=1
f(n a b c) = f( n-1 a b c) + f( 1 a b c) + f( n-1 b a c )
if n > 1
f( 2) = ?
Ans: f( 2 a c b ) = ab + ac + bc.
2. similar question in functions.
3. [ based on function in 1.] f( 4 a b c ) the number of terms is...?
Ans: f( 4 a b c ) = f( 3 a c b ) + f( 1 a b c ) + f( 3 b a c ) etc.
= 5ab + 5ac + 5bc.
4. f( 5 a b c ) = ?
SECTION III
Permutations and Combinations.
8 questions.
1. r = number of flags;
n = number of poles;
Any number of flags can be accommodated on any single pole.
i) r=5,n=5 The no. of ways the flags can be arranged ?
ii) to iv) are based on this.
6. r= 5 n = 3 . If first pole has 2 flags ,third pole has 1 flag
how many ways the remaining can be arranged?
7.& 8. same as above.
SECTION IV
Question consising of figures consist of 4 small squares and every square
having an arrow pointing in one Direction.
GRE test of reasoning.
hint: What is the next sequence if we tilt the figure by 90 degrees like
that( clockwise and mirror images ? ).
SECTION V
In this section first part of compound word is given. Select meaning of
the second part from the choice given:
1. Swan
2. Swans
3. Fool
4. Fools
5. Stare
6. Lady
For all above 4 choices are given.....
Eg. Swan
a) category b) music c) --- d) none
Ans: Swansong is compound word. But song is not given as option. so
b) music is answer.
TS 99 PAPER .
*This paper contains 40 questions and time is 60mts.*/
CTS -REC'99(TRICHY)
SECTION-1:
Find the sequence:
( d is always NONE )
1. BC CE EG GK ?
a)KN b)KU c)KM d)
2. AA AB BC CE?
a)EG b)EH c)EI d)
3. AB EF JK QR ?
a)YZ b)ZA c)AB d)
4.ACD EGL IKT MOB?
a)QST b)QSZ c)QSY d)
5.AC CG GO OE?
a)EJ b)EI c)EL d)
6.AE BH CM DU?
a)EH b)EZ c) EB d)
7. AD DP PL LV
a)VS b)VK c)VI d)
8. SE QU EN TI?
a)CN b)BM c)AI or AZ d)
SECTION-II:
FIND THE VALUES FOR FOLLOWING PROBLEM:
F(X)= 2X-1 + f(X-1) if X NOT EQUAL TO ZERO
if f(X=0)=0
9. f(5) VALUE
a)15 b)24 c)22 d)NONE
10.f(f(2))
11.f(16)- f(15)
12.f(16)+f(15)-480
13.f(f(x))=81 THEN VALUE OF X=
14.f(X)=4f(X-1) THEN VALUE OF X=
15.f(X)= f(X-1)+f(X-2) FOR X>1 THEN X=
16.f(X)-f(X-1)=f(X-8) FOR X>5 THEN X=
SECTION -III:
###In the follwing questins we r giving 'aword' which may not have any
meaning.Find differnet possible words or palandrams for the word as per que.
I. for the following find no of distinct words that can be formed.
17. TYGHHTT
A).420 B)1540 C)840 D)NONE
18. TYGHHTY
19. TYGHHTT
20. TYGHHTT
21. TYGHASD
22. TYGHHTY
II Find NO OF POSSIBLE PALANDRAMS for following
23. TYGHHTY
24. TYHHHTYH.
/*dEAR FRIENDS DON,T CONFUSE WITH THE WORDS REPEATED.Iam
sure.Words are
same.They might have changed the questionsfor20,21,22.Concentrate on that
respect*/
25 to 32 are figures.Uhave to analyse them.He will give five figs.One is not
correct
SECTION IV:
It having complete of figs.(26 -32)
SECTION -V:
For following first find out the anagram and then note the corresponding
meaning.
33.TABLET(anagram means first u arrange the letters in correct order like
(TABLET===BATTLE . so ans is FIGHT i.e. B)
34.RUGGED
35.GORE.
36.STASSI.
For all above choices are.
A) resentment B)Fight c)Help d) Monster
37. ENFOLD
38. LAMB
39. RECEDE.
40. PLEASE.
For above 4 choices are same
A)cuddle B)sleeping c)proclamination d)ointment.
************************************************************************
************************
The Naughty `C'
For Novice and Intermediate C Programmers
To get the answer highlight the answer line ( It may not be there )
Find MAXIMUM of three distinct integers using a single C statement
Ans : d= (a>b) ? ((a>c) ? a : c)) : ((b>c) ? b : c ))
Swap two variables without using any extra variable
Ans : a=a+b;b=a-b;a=a-b;
Construct a doubly linked list using a single pointer in each node
Ans :
int i=0; while(i=0) printf("%d",++i); Guess the output
Ans : The Loop is not executed, since the assignment statement returns the
assigned value zero which is equivalent to false in C
int i=0; while(i=1) printf("%d",++i); Guess the output
Ans : The Loop is executed forever always printing 2, since the assignment
statement returns the assigned value one which is equivalent to true in C
int x=2, y=6, z=6; x=y==z; printf("%d",x); Guess the output
Ans : The == has higher precedance than
************************************************************************
***********************
Download