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?

Crossing Bridge Brain Teaser

Four friends need to cross a dangerous bridge at night. Unfortunately, they have only one torch and the bridge is too dangerous to cross without one. The bridge is only strong enough to support two people at a time. Not all people take the same time to cross the bridge. Times for each person: 1 min, 2 mins, 7 mins and 10 mins. What is the shortest time needed for all four of them to cross the bridge?

Spatial Trivia Physics Puzzle

As shown in picture, there are four gears with the following specification
* Gear A has 60 teeth
* Gear B has 40 teeth
* Gear C has 20 teeth
* Gear D has 60 teeth
* Every minute, Gear B makes 15 complete turns.

What is the relative speed of Gear A and Gear B?

Maths Magic Riddle

I can prove why 1 = 2

Step1. Lets say y = x
Step2. Multiply through by x xy = x2
Step3. Subtract y2 from each side xy - y2 = x2 - y2
Step4. Factor each side y(x-y) = (x+y)(x-y)
Step5. Divide both sides by (x-y) y = x+y
Step6. Divide both sides by y y/y = x/y + y/y
Step7. And so... 1 = x/y + 1
Step8. Since x=y, x/y = 1 1 = 1 + 1
Step9. And so... 1 = 2

How is this possible ?

Pirates Probability Brain Teaser

You are stuck with the pirates who might even kill you on board. They give you a chance to survive. There are hundred black rocks and hundred red rocks. There are two empty sacks which are labelled as heads and tails respectively. You have to divide the rocks in two bags as per your wish. Then a fair coin will be flipped. If its heads, you will have to pick a rock on random from the sack labelled heads and if its tails, you will pick up from the tails sack. If you pick up a black rock, you will be freed and if you pick up a red rock, you will be killed.

How will you distribute the rocks so that your chances of survival are the best?

Funny Brain Twister

We all know that New Year occurs after a week from Christmas and thus it falls on the same day as of Christmas. But this will not happen in 2050. In 2050, Christmas will appear on Sunday while New Year will appear on Saturday.

How can this be possible ?
category : LOGIC | TRICK

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

Fake Coin Brain Teaser

In front of you, there are 9 coins. They all look absolutely identical, but one of the coins is fake. However, you know that the fake coin is lighter than the rest, and in front of you is a balance scale. What is the least number of weightings you can use to find the counterfeit coin?
category : LOGIC

Hard Ten Boxes Interview Puzzle

You have ten boxes and an electronic weighing machine. In those ten boxes, you have chocolates. Each chocolate weigh 20 grams. But in one box the chocolates are defective and each weigh 19 grams exactly.

Now you can weigh in the electronic weighing machine but you can use that machine just once. How will you find out which box has the defected chocolates.
category : LOGIC

Toothpick Donkey Puzzle

The toothpicks in the picture have been arranged to form a donkey shaped figure. You have to move two matchsticks in a way that the entire shape is rotated / reflected while being intact. Also, you can't change the tail's direction it should be pointing up.

category : LOGIC | PICTURE

Puzzles Tags :

Illusions Tags :