Interview Process   |   Interview Puzzles / Aptitude   |   Technical Questions
Organization : Athenahealth
Position : Software Developer
1. Do you think that it is valid if we address one element beyond the end of an array?

2. Is it necessary that the array subscripts always start with zero?

3. Do you know the difference between a string copy [s t r cpy] and a memory copy [memcpy]. When should be use each of both?

4. Write a program that can analyze the string:
char str[90]="i am shorter than my sister@1234321. She always a long girl, but not smarter than me"

a) Remove the spaces in between the words.
b) Which is the longest word in t he String?
c) How many letter 'e' are present in the String?
d) Find out the number of integers in the String.
e) Identify the number of doubles in the String.
f) Find out the number of words in teh String.
g) Extract the number of sentences in the String.

5. You are given with N players with weights as input. You need to divide them into two teams comprising of equal weights. But while dividing you need to make sure that the the difference between the number of players in the teams is minimum. Also, output the difference between the number of players in the two teams.
Input Weights: 3 2 1
Output: 1

6. Suppose that a String comprises of just three characters in a String - 'x', 'y', 'z'. Now suppose that in that string, if two different characters appear together they are replaced by the third character. This operation keeps repeating till no reduction is feasible. The String must now be always evaluated from left to right.
Input: abbc
Output: 1

7. How will you right-justify a string?

8. What can you do to avoid including a header more than once?

9. When is the concatenation operator used?

10. Do you think that we can execute a code even when the program exits the main() function?


Thanks Alex for sharing the details of your interview.
Send more details and your personal experiences [email protected]
Suggestions

Candle Trick Teaser Problem

Husband has prepared for a candle light dinner on the honeymoon for his wife. While they were having the dinner, a strong breeze flew through the open window and four candles out of ten were extinguished. After that, the husband closed the window.

How many candles were left in the end?

Best Thinking Brain Teaser Ever

Three men are living in a desert namely – Alex, Brian and Chris.

Alex hates Chris and thus he decides to kill him. To succeed in his evil intentions, he poison the water supply of Chris. Since they are living in desert, he will have to drink water or he will die of thirst.

Brian is not aware of the actions of Alex and he plans to kill Chris as well. To do this, he killed the water supply of Chris.

Chris dies due to his thirst. Who killed him?

Box Ball Logic Problem

There are three bags.The first bag has two blue rocks. The second bag has two red rocks. The third bag has a blue and a red rock. All bags are labeled but all labels are wrong.You are allowed to open one bag, pick one rock at random, see its color and put it back into the bag, without seeing the color of the other rock.

How many such operations are necessary to correctly label the bags ?
category : LOGIC | TRICK

Logic Fruits Riddle

There is a box full of fruits,
all but two are grapes,
all but two are apples,
and all but two are oranges.

How many fruits are in the box ?
category : LOGIC | MATHS

Hard Logic Puzzle

A great meeting is held by a great logician where all the other logicians are called upon. The master logician takes them in a room and makes them sit in circle. A hat is placed on each of their heads. Now all of them can see the color of hats others are wearing but can’t see his own. They are told that there different colors of hats.

The master logician explains that a bell will be rung at regular intervals and the moment when a logician knows the color of his hat, he will leave on the next bell. If anyone leaves at the wrong bell, he will be disqualified and sent home.

All of them are assured of one thing that the puzzle will not be impossible for anyone of them. How will they manage the situation?
category : LOGIC

Hard Logic Brain Teaser

There are 100 doors. 100 strangers have been gathered in the adjacent room. The first one goes and opens every door. The second one goes and shuts down all the even numbered doors – second, fourth, sixth... and so on. The third one goes and reverses the current position of every third door (third, sixth, ninth… and so on.) i.e. if the door is open, he shuts it and if the door is shut, he switches opens it. All the 100 strangers progresses in the similar fashion.

After the last person has done what he wanted, which doors will be left open and which ones will be shut at the end?
category : LOGIC

Weight Balance Riddle

You can place weights on both side of weighing balance and you need to measure all weights between 1 and 1000. For example if you have weights 1 and 3,now you can measure 1,3 and 4 like earlier case, and also you can measure 2,by placing 3 on one side and 1 on the side which contain the substance to be weighed. So question again is how many minimum weights and of what denominations you need to measure all weights from 1kg to 1000kg.

Infoedge Interview Aptitude Problem

On a magical-intellectual land of gpuzzles , all the animal are rational(real smart).

There are six leopards and one sheep.
Leopard can eat sheep but since as the land is magical, the leopards who eats the sheep , turns into sheep and then can be eaten by the remaining leopard(s).

If we leave them for some time then how many sheep and leopard will be there , when we come back ?

Famous Water Jug Problem

You live in Dubai and had an infinite supply of oil and a 5 liters and 3 liters jar,
how would you measure exactly 4 liters (of-course in minimum numbers of step) ?
category : LOGIC | MEASURE

Measure Water Supply Brain Teaser

You had an infinite supply of water and a 5 ml and 3 ml gallons.

How would you measure exactly 4 ml in least number of steps ?
category : LOGIC | MEASURE

Puzzles Tags :

Illusions Tags :