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

3 Gallon Brain Teaser

You have been given three jars of 3 liters, 5 liters and 8 liters capacity out of which the 8 liters jar is filled completely with water. Now you have to use these three jars to divide the water into two parts of 4 liters each.

How can you do it making the least amount of transfers?
category : LOGIC

Tricky Iq Question

In a jar, there are some orange candies and some strawberry candies. You pick up two candies at a time randomly. If the two candies are of same flavor, you throw them away and put a strawberry candy inside. If they are of opposite flavors, you throw them away and put an orange candy inside.

In such manner, you will be reducing the candies in the jar one at a time and will eventually be left with only one candy in the jar.

If you are told about the respective number of orange and strawberry candies at the outset, will it be feasible for you to predict the flavor of the final remaining candy ?
category : LOGIC

Tricky Math Race Riddle

Rooney, Hernandez, and Robin race each other in a 100 meters race. All of them run at a constant speed throughout the race.

Rooney beats Hernandez by 20 meters.
Hernandez beats Robin by 20 meters.

How many meters does Rooney beat Robin by ?
category : LOGIC | MATHS

Decipher MatchSticks Puzzle

Can you decipher the two rows to find the hidden word?

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

Logic Problem Brain Teaser

The world is facing a serious viral infection. The government of various countries have issued every citizen two bottles. You as well have been given the same. Now one pill from each bottle is to be taken every day for a month to become immune to the virus. The problem is that if you take just one, or if you take two from the same bottle, you will die a painful death.

While using it, you hurriedly open the bottles and pour the tablets in your hand. Three tablets come down in your hand and you realize they look exactly the same and have same characteristics. You can’t throw away the pill as they are limited and you can’t put them back or you may put it wrong and may die someday.

How will you ensure that you are taking the right pill?
category : LOGIC

Logic Birthday Puzzle

For my anniversary, I decided to surprise my wife. Since she is a voracious reader, I decided to collect a lot of books for her. On the first day of the month, I bought one book, on the second, I bought two and on the third, I bought three. This process went on till the anniversary and on the day, I had 276 books with me to gift her.

Can you calculate, on which day is our anniversary?
category : LOGIC | MATHS

Hard Logic Statement Riddle

There are a hundred statements.
1st person says: At least one of the statements is incorrect.
2nd person says: At least two of the statements is incorrect.
3rd person says: At least three of the statements are incorrect.
4th person says: At least four of the statements are incorrect.
..
..
..
100th person says: At least a hundred of the statements are incorrect.

Now analyze all the statements and find out how many of them are incorrect and how many are true?

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

Induction Brain Teasers

Three college toppers are summoned by the inspecting faculty. To identify the best from them, the faculty takes them into a room and places one hat on each of their heads. Now all of them can see the hats on other’s heads but can’t see his own. There are two colored hats – green and red.

Now the faculty announces that he had made sure that the competition is extremely fair to all three of them. He also gives them a hint that at least one of them is wearing a red hat. Now the first one who is able to deduce his own hat color will be awarded the most intelligent student of all award. After a few minutes, one of them raises his hand and is able to deduce the color correctly.

How?
category : LOGIC

Puzzles Tags :

Illusions Tags :