Question: Assume you have an array that contains a
number of strings (perhaps char * a[100]
). Each string is a word from
the dictionary. Your task, described in high-level terms, is to devise a way to
determine and display all of the anagrams within the array (two words are
anagrams if they contain the same characters; for example, tales
and
slate
are anagrams.)
Woman 1: 1 minute to
cross
Woman 2: 2 minutes to cross
Woman 3: 5 minutes to cross
Woman 4: 10 minutes to cross
For example if Woman 1
and Woman 4 walk across first, 10 minutes have elapsed when they get to the
other side of the bridge. If Woman 4 then returns with the flashlight, a total
of 20 minutes have passed and you have failed the mission. What is the order
required to get all women across in 17 minutes? Now, what's the other way?
· cwd xor ax, dx sub ax,
dx
How do
you multiply a variable by 16 without using the multiplication operator '*'?
(Avg. of 79 ) : What if you have to multiply by
15?
(Avg. of 66 ) : How can computer technology be
integrated into an elevator system for a hundred story office building? How do
you optimize for availability? How would variation of traffic over a typical
work week or floor or time of day affect this? How would you test this system?
(Avg. of 91 ) : How would you redesign an ATM?
(Avg. of 29 ) : Suppose we wanted to control
different parts of a home using a Computer. What kind of software would you
write to do this?
(Avg. of 27 ) : What is a balanced tree?
(Avg. of 18 ) : What is disk interleaving? Why
do you need it?
(Avg. of 17 ) : What are various problems
unique to distributed databases?
(Avg. of 13 ) : How would you decide what to
test for given that there isn't enough time to test everything you want to.
(Avg. of 29 ) : Some general questions on Lex
Yacc etc.
(Avg. of 16 ) : Fundamentals of RPC.
(Avg. of 9 ) : Tradeoff between time spent in
testing a product and getting into the market first.
(Avg. of 9 ) : You're implementing the
software for a IP router. When a packet comes in, the router has to decide
which link to route the packet out on, based on it's destination IP address.
Don't worry about changes in load - a packet destined for a given IP address
will always go out the same link. How would you implement this? Optimized for
speed? For space?
(Avg. of 34 ) : Find the fastest, simplest
algorithm you can for determining if two rectangles overlap.
(Avg. of 13 ) : You're part of the QA team for
a large web-site. You want to create as much automated testing as possible.
What could/would you test? How? How much maintenance would these tests require
as the web site changes?
(Avg. of 13 ) : What would be your language of
choice for implementing CGI programs on a web server? Why?
(Avg. of 10 ) : How do you swap two integers
without using any extra memory?
(Avg. of 5 ) : Describe the most interesting
software project you've done in school.
(Avg. of 8 ) : What was the most difficult
program you had to write?
(Avg. of 5 ) : What are the steps you take to
write a program?
(Avg. of 8 ) : What is the difference between
multitasking and multithreading and how does it work in vxWorks?
(Avg. of 7 ) : Name 7 layers of OSI models and
define their functionality.
(Avg. of 15 ) : OSI layers and what devices
work at each layer, examples of netowrk topology, when and why you would use
each, pros and cons of each, etc.
(Avg. of 6 ) : What layer of the OSI model
does routers work on?
(Avg. of 10 ) : Explain inheritance
(Avg. of 5 ) : What is a linked list
(Avg. of 14 ) : How will you test vending
machine?
(Avg. of 16 ) : How would you go about learning
a new programming language under high-pressure conditions?
Why is a
manhole cover round?
Given a
rectangular cake with a rectangular piece removed (any size or orientation),
how would you cut the remainder of the cake into two equal halves with one
straight cut of a knife ?
If you
had an infinite supply of water and a 5 quart and 3 quart pail, how would you
measure exactly 4 quarts?
One train
leaves Los Angeles at 15 MPH heading for New York. Another train leaves from
New York at 20mph heading for Los Angeles on the same track. If a bird, flying
at 25mph, leaves from Los Angeles at the same time as the train and flies back
and forth between the two trains until they collide, how far will the bird have
traveled?
If you
could remove any of the 50 states, which state would it be and why?
There are
four people who need to cross a bridge at night. The bridge is only wide enough
for two people to cross at once. There is only one flashlight for the entire
group. When two people cross, they must cross at the slower member's speed. All
four people must cross the bridge in 17 minutes, since the bridge will collapse
in exactly that amount of time. Here are the times each member takes to cross
the bridge:
So, if Person A and C crossed the bridge initally, 5 minutes would elapse,
because Person C takes 5 minutes to cross. Then, Person A would have to come
back to the other side of the bridge, taking another minue, or six minutes
total. Now, if Person A and D crossed the bridge next, it would take them 10
minutes, totalling to 16 minutes. If A came back, it would take yet another
minute, totally 17... the bridge would collapse with A and B on the wrong side.
How can all four people get across the bridge within 17 minutes? Note: there
is no trick-answer to this problem. You can't do tricky stuff like throwing the
flashlight back from one end of the bridge to the other. This problem can be
solved!
You have someone working for you for seven days and a gold bar to pay them. The gold bar is segmented into seven connected pieces. You must give them a piece of gold at the end of every day. If you are only allowed to make two breaks in the gold bar, how do you pay your worker?
You have
5 jars of pills. Each pill weighs 10 gram, except for contaminated pills
contained in one jar, where each pill weighs 9 gm. Given a scale, how could you
tell which jar had the contaminated pills in just one measurement?
You have
12 balls. All of them are identical except one, which is either heavier or
lighter than the rest - it is either hollow while the rest are solid, or solid
while the rest are hollow. You have a simple two-armed scale, and are permitted
three weighings. Can you identify the odd ball, and determine whether it is
hollow or solid? ( This question is same as above but with an additional
twist).
If you
are on a boat and you throw out a suitcase, will the level of water increase?
There are
3 ants at 3 corners of a triangle, they randomly start moving towards another
corner. What is the probability that they don't collide?
There are
three wise men in a room. So you decide to give them a challenge. Suspecting
that the thing they care about most is money, you give them $100 and tell them
they are to divide this money observing the following rule: they are to discuss
offers and counter-offers from each other and then take a vote. Majority vote
wins. Sounds easy enough... now the question is, assuming each person is
motivated to take the largest amount possible, what will the outcome be? (
submitted by : mikeprimeau@ottawa.com)
Three men
were renting a motel figuring the room cost 30 dollars they would pitch in ten
a piece.The room was only 25 so they each gave the bell boy ten,(tip)the
bellboy didn"t think that would be fair so he gave them each back 1 dollar
and kept 2 for himself.What happened to the other dollar? ( sent by
MACsabastion@webtv.net )
You have
b boxes and n dollars. If I want any amount of money from 0 to n dollars, you
must be able to hand me 0 to b boxes so that I get exactly what I
request." The two questions were "What are the restrictions on b and
n, and how is money distributed among the boxes?"
There are
2 rooms. First has 3 switches (on/off) and the other one has 3 bulbs (electric
lamps). Initially all the switches are off and all bulbs are turned off. Every
bulb is connected to one switch and only one. First you are in the room with
switches. You can play with switches however you want and whenever you want,
but in the rooms with bulbs you can enter only once. Find the correspondence
between switches and bulbs. - (Sent by Oliviu Burlacu)
There is
a prisioner who has two doors infront of him one leads to freedom and one leads
to hell, he has no idea which one is which, but there is 2 guards there on tell
the truth and one always lies. You can ask them one question that will lead you
to your freedom. What is your question? - (Sent by Karl Hamaoui)
If you
look at a clock and the time is 3:15, what is the angle between the hour and
the minute hands? ( The answer to this is not zero!)
What is
the sum of the numbers from 1 to 1000?
You are
an employer. You have ten employees. Each month, each one of your ten employees
gives you ten bags of gold. Each bag of gold has ten pieces of gold in it. Each
piece of gold weighs one pound. One of your employees is cheating you by only
putting nine pieces of gold in each of his ten bags of gold. You have a scale
(not a balance, a scale), and you can only take one measurement from the scale,
only one (1) reading.
How can you tell which of the ten
employees is cheating you by using this scale and only taking one measurement?
How many
points are there on the globe where by walking one mile south, one mile east
and one mile north you reach the place where you started.
Imagine
that you have 26 constants, labelled A through Z. Each constant is assigned a
value in the following way: A = 1; the rest of the values equal their position
in the alphabet (B corresponds to the second position so it equals 2, C = 3,
etc.) raised to the power of the preceeding constant value. So, B = 2 ^ (A's
value), or B = 2^1 = 2. C = 3^2 = 9. D = 4^9, etc., etc. Find the exact
numerical value to the following equation:
(X - A) * (X - B) * (X - C) * ... * (X - Y) * (X
- Z)
You have
two jars, 50 red marbles and 50 blue marbles. A jar will be picked at random,
and then a marble will be picked from the jar. Placing all of the marbles in
the jars, how can you maximize the chances of a red marble being picked? What
are the exact odds of getting a red marble using your scheme
How would
go about finding out where to look for a book in a library? (You do not know
how the books are organized beforehand)
Imagine
you are standing in front of a mirror, facing it. Raise your left hand. Raise
your right hand. Look at your reflection. When you raise your left hand your
reflection raises what appears to be his right hand. But when you tilt your
head up, your reflection does too, and does not appear to tilt his/her head
down. Why is it that the mirror appears to reverse left and right, but not up
and down?
You have
a bucket of jelly beans. Some are red, some are blue, and some green. With your
eyes closed, pick out 2 of a like color. How many do you have to grab to be
sure you have 2 of the same?
You are
given a scale which you are to use to measure eight balls. Seven of these balls
have the same weight: the eigth ball is heavier than the rest. What is the
minimum number of weighs you could perform to find the heaviest of the eight
balls?. Remmber it's a scale not a balance. (i.e. It can just tell you if one side
is heavier than the other it can't give you the exact weight).
You are
given two 60 minute long fuse ropes (ie. the kind you'd find on the end of a
bomb) and a lighter. The fuses do not necessarily burn at a fixed rate. For
example, given an 8 foot rope, it may take 5 minutes for the first 4 feet of
the fuse to burn, while the last 4 feet could take 55 minutes to burn (a much
slower rate) (5+55=60 minutes). Using these two fuses and the lighter, how can
you determine 45 minutes? HINT: You can use the lighter any number of times
How would
you design a toaster?
How would
you design an universal remote control?
How would
you design a clock for a blind person?
A cable,
16 meters in length, hangs between two pillars that are both 15 meters high.
The ends of the cable are attached to the tops of the pillars. At its lowest
point, the cable hangs 7 meters above the ground. Question: How far are the two
pillars apart? ( Sent by Oliviu Burlacu )
There was
a sheriff in a town who caught three outlaws. He said he was going to give them
all a chance to go free. All they had to do is figure out what color hat they
were wearing. The sheriff had 5 hats 3 black and 2 white. The first guy guessed
and was wrong so he was put in jail. The second guy also guessed and was also
put in jail. finally, a third blind man guessed and he guessed correctly. How
did he know?
There are
n couples attending a party. Each one shakes hands with the persons he doesn't
know. (Assuming each person knows his/her partner) Mary and John are a couple.
John asked the rest of the party-attenders how many times he has shaken hands.
Each one gives a unique answer. How many times does Mary shake hands?
How would
you find a cycle in a linked list? Try to do it in O(n) time. Try it using a constant
amount of memory.
(Avg. of 64 ) : Given a history of URLs, how
would you determine if a particular URL had been seen before?
(Avg. of 10 ) : Since pages can have multiple
URLs pointing to them, how can you make sure you've never seen the same CONTENT
before?
(Avg. of 28 ) : Write a function to print the
Fibonacci numbers.
(Avg. of 32 ) : Write a function to print all
of the permutations of a string.
(Avg. of 20 ) : Design a memory management
scheme.
(Avg. of 28 ) : Give a one-line C expression to
test whether a number is a power of 2. Now implement it without using loops.