Thursday, 20 October 2011

Frequently Asked microcontroller Interview questions

1. What are the flags in 8086? - In 8086 Carry flag, Parity flag, Auxiliary carry flag, Zero flag, Overflow flag, Trace flag, Interrupt flag, Direction flag, and Sign flag.
2. What are the various interrupts in 8086? - Maskable interrupts, Non-Maskable interrupts.
3. What is meant by Maskable interrupts? - An interrupt that can be turned off by the programmer is known as Maskable interrupt.

4. What is Non-Maskable interrupts? - An interrupt which can be never be turned off (ie.disabled) is known as Non-Maskable interrupt.
5. Which interrupts are generally used for critical events? - Non-Maskable interrupts are used in critical events. Such as Power failure, Emergency, Shut off etc.,
6. Give examples for Maskable interrupts? - RST 7.5, RST6.5, RST5.5 are Maskable interrupts
7. Give example for Non-Maskable interrupts? - Trap is known as Non-Maskable interrupts, which is used in emergency condition.
8. What is the Maximum clock frequency in 8086? - 5 Mhz is the Maximum clock frequency in 8086.
9. What are the various segment registers in 8086? - Code, Data, Stack, Extra Segment registers in 8086.
10. Which Stack is used in 8086? - LIFO (First In last Out) stack is used in 8086.In this type of Stack the first stored information is retrieved first.
11. What are the address lines for the software interrupts? -
RST 0 0000 H
RST1 0008 H
RST2 0010 H
RST3 0018 H
RST4 0020 H
RST5 0028 H
RST6 0030 H
RST7 0038 H
12. What is SIM and RIM instructions? - SIM is Set Interrupt Mask. Used to mask the hardware interrupts. RIM is Read Interrupt Mask. Used to check whether the interrupt is Masked or not.
13. Which is the tool used to connect the user and the computer? - Interpreter is the tool used to connect the user and the tool.
14. What is the position of the Stack Pointer after the PUSH instruction? - The address line is 02 less than the earlier value.
15. What is the position of the Stack Pointer after the POP instruction? - The address line is 02 greater than the earlier value.
16. Logic calculations are done in which type of registers? - Accumulator is the register in which Arithmetic and Logic calculations are done.
17. What are the different functional units in 8086? - Bus Interface Unit and Execution unit, are the two different functional units in 8086.
18. Give examples for Micro controller? - Z80, Intel MSC51 &96, Motorola are the best examples of Microcontroller.
19. What is meant by cross-compiler? - A program runs on one machine and executes on another is called as cross-compiler.
20. What are the address lines for the hardware interrupts? -
RST 7.5 003C H
RST 6.5 0034 H
RST 5.5 002C H
TRAP 0024 H
21. Which Segment is used to store interrupt and subroutine return address registers? - Stack Segment in segment register is used to store interrupt and subroutine return address registers.
22. Which Flags can be set or reset by the programmer and also used to control the operation of the processor? - Trace Flag, Interrupt Flag, Direction Flag.
23. What does EU do? - Execution Unit receives program instruction codes and data from BIU, executes these instructions and store the result in general registers.
24. Which microprocessor accepts the program written for 8086 without any changes? - 8088 is that processor.
25. What is the difference between 8086 and 8088? - The BIU in 8088 is 8-bit data bus & 16- bit in 8086.Instruction queue is 4 byte long in 8088and 6 byte in 8086.

Written Interview Apptitude Questions

1.Three types of tea the a,b,c costs Rs. 95/kg,100/kg and70/kg respectively.

How many kgs of each should be blended to produce 100 kg of mixture worth Rs.90/kg,

given that the quntities of band c are equal

a)70,15,15

b)50,25,25

c)60,20,20

d)40,30,30


Ans: (b)


2.What is the maximum number of half-pint bottles of cream that can be filled with a 4-gallon can of cream (2 pt. =1 qt. and 4 qt. =1 gal)

A.16

B.24

C.30

D.64


Ans: D


3.There are two circles, one circle is inscribed and another circle is circumscribed over a square. What is the ratio of area of inner to outer

circle?

Ans: 1 : 2


4.In the following figure: A B C

D

E F G

H

I

Each of the digits 1, 2, 3, 4, 5, 6, 7, 8, and 9 is:

a)Represented by a different letter in the figure above.

b) Positioned in the figure above so that each of A + B + C,C + D +E,E + F + G, and G + H + I is equal to 13.

Which digit does E represent?


Ans: E is 4


5.There are 12 boys and 15 girls, How many different dancing groups can be formed with 2 boys and 3 girls.

48Which of the following fractions is less than 1/3

(a) 22/62

(b) 15/46

(c) 2/3

(d) 1


Ans: (b)


6.One of Mr. Horton,his wife,their son,and Mr. Horton's mother is a doctor and another is a lawyer.

a)If the doctor is younger than the lawyer, then the doctor and the lawyer are not blood relatives.

b)If the doctor is a woman, then the doctor and the lawyer are blood relatives.

c)If the lawyer is a man, then the doctor is a man.

Whose occupation you know?


Ans: Mr. Horton:he is the doctor.


7.A person wants to buy 3 paise and 5 paise stamps costing exactly one rupee. If he buys which of the following number of stamps he won't able to

buy 3 paise stamps.

Ans: 9


8.Mr. and Mrs. Aye and Mr. and Mrs. Bee competed in a chess tournament.Of the three games played:

a)In only the first game werethe two players married to each other.

b)The men won two games and the women won one game.

c)The Ayes won more games than the Bees.

d)Anyone who lost game did not play the subsequent game.

Who did not lose a game?


Ans:Mrs.Bee did not lose a game.


9.Two cars are 15 kms apart. One is turning at a speed of 50kmph and the other at 40kmph . How much time will it take for the two cars to meet?


Ans: 3/2 hours


10.Three piles of chips--pile I consists one chip, pile II consists of chips, and pile III consists of three chips--are to be used in game played by

Anita and Brinda.The game requires:

a)That each player in turn take only one chip or all chips from just one pile.

b)That the player who has to take the last chip loses.

c)That Anita now have her turn.

From which pile should Anita draw in order to win?


Ans:Pile II


11. 9.In a class composed of x girls and y boys what part of the class is composed of girls

A.y/(x + y)

B.x/xy

C.x/(x + y)

D.y/xy

Ans:C


12.One of the following is my secret word:AIM DUE MOD OAT TIE.With the list in front of you, if I were to tell you any one of my secret word,

then you would be able to tell me the number of vowels in my secret word.Which is my secret word?

Ans:TIE


13.If the operation,^ is defined by the equation x ^ y = 2x + y,what is the value of a in 2 ^ a = a ^ 3

A.0

B.1

C.-1

D.4

Ans:B


14.A coffee shop blends 2 kinds of coffee,putting in 2 parts of a 33p. a gm. grade to 1 part of a 24p. a gm.If the mixture is changed to 1 part

of the 33p. a gm. to 2 parts of the less expensive grade,how much will the shop save in blending 100 gms.

A.Rs.90

B.Rs.1.00

C.Rs.3.00

D.Rs.8.00


Ans:C


15.There are 200 questions on a 3 hr examination.Among these questions are 50 mathematics problems.It is suggested that twice as much time be

spent on each maths problem as for each other question.How many minutes should be spent on mathematics problems

A.36

B.72

C.60

D.100

Ans:B


16.In a group of 15,7 have studied Latin, 8 have studied Greek, and 3 have not studied either.How many of these studied both Latin and Greek

A.0 B.3 C.4 D.5

Ans.B


17.If 13 = 13w/(1-w) ,then (2w)2 =

A.1/4

B.1/2

C.1

D.2

Ans:C


18. If a and b are positive integers and (a-b)/3.5 = 4/7, then

(A) b < a

(B) b > a

(C) b = a

(D) b >= a

Ans: A


18. In june a baseball team that played 60 games had won 30% of its game played. After a phenomenal winning streak this team raised its average

to 50% .How many games must the team have won in a row to attain this average?

A. 12

B. 20

C. 24

D. 30

Ans: C


19. M men agree to purchase a gift for Rs. D. If three men drop out how much more will each have to contribute towards the purchase of the gift/

A. D/(M-3)

B. MD/3

C. M/(D-3)

D. 3D/(M2-3M)

Ans: D


20. A company contracts to paint 3 houses. Mr.Brown can paint a house in 6 days while Mr.Black would take 8 days and Mr.Blue 12 days. After 8

days Mr.Brown goes on vacation and Mr. Black begins to work for a period of 6 days. How many days will it take Mr.Blue to complete the contract?

A. 7

B. 8

C. 11

D. 12

Ans:C

21. 2 hours after a freight train leaves Delhi a passenger train leaves the same station travelling in the same direction at an average speed of

16 km/hr. After travelling 4 hrs the passenger train overtakes the freight train. The average speed of the freight train was?

A. 30

B. 40

C.58

D. 60

Ans: B

22. If 9x-3y=12 and 3x-5y=7 then 6x-2y = ?

A.-5

B. 4

C. 2

D. 8

Ans: D


23. There are 5 red shoes, 4 green shoes. If one draw randomly a shoe what is the probability of getting a red shoe

Ans: 5c1/ 9c1


24. What is the selling price of a car? If the cost of the car is Rs.60 and a profit of 10% over selling price is earned

Ans: Rs 66/-


25. 1/3 of girls , 1/2 of boys go to canteen .What factor and total number of classmates go to canteen.

Ans: Cannot be determined.


26. The price of a product is reduced by 30% . By what percentage should it be increased to make it 100%

Ans: 42.857%


27. There is a square of side 6cm . A circle is inscribed inside the square. Find the ratio of the area of circle to square.

Ans: 11/14


28. There are two candles of equal lengths and of different thickness. The thicker one lasts of six hours. The thinner 2 hours less than the

thicker one. Ramesh lights the two candles at the same time. When he went to bed he saw the thicker one is twice the length of the thinner one. How

long ago did Ramesh light the two candles .

Ans: 3 hours.


29. If M/N = 6/5,then 3M+2N = ?


30. If p/q = 5/4 , then 2p+q= ?


31. If PQRST is a parallelogram what it the ratio of triangle PQS & parallelogram PQRST .

Ans: 1:2


32. The cost of an item is Rs 12.60. If the profit is 10% over selling price what is the selling price ?

Ans: Rs 13.86/-


33. There are 6 red shoes & 4 green shoes . If two of red shoes are drawn what is the probability of getting red shoes

Ans: 6c2/10c2


34. To 15 lts of water containing 20% alcohol, we add 5 lts of pure water. What is % alcohol.

Ans : 15%


35. A worker is paid Rs.20/- for a full days work. He works 1,1/3,2/3,1/8.3/4 days in a week. What is the total amount paid for that worker ?

Ans : 57.50


36. If the value of x lies between 0 & 1 which of the following is the largest?

(a) x

(b) x2

(c) -x

(d) 1/x


Ans : (d)


37. If the total distance of a journey is 120 km .If one goes by 60 kmph and comes back at 40kmph what is the average speed during the journey?

Ans: 48kmph


38. A school has 30% students from Maharashtra .Out of these 20% are Bombey students. Find the total percentage of Bombay?

Ans: 6%


39. An equilateral triangle of sides 3 inch each is given. How many equilateral triangles of side 1 inch can be formed from it?

Ans: 9


40. If A/B = 3/5,then 15A = ?

Ans : 9B


41. Each side of a rectangle is increased by 100% .By what percentage does the area increase?

Ans : 300%


42. Perimeter of the back wheel = 9 feet, front wheel = 7 feet on a certain distance, the front wheel gets 10 revolutions more than the back

wheel.What is the distance?

Ans : 315 feet.


43. Perimeter of front wheel =30, back wheel = 20. If front wheel revolves 240 times. How many revolutions will the back wheel take?

Ans: 360 times


44. 20% of a 6 litre solution and 60% of 4 litre solution are mixed. What percentage of the mixture of solution

Ans: 36%


45.City A's population is 68000, decreasing at a rate of 80 people per year. City B having population 42000 is increasing at a rate of 120 people per year. In how many years both the cities will have same population?

Ans: 130 years

Wednesday, 19 October 2011

Embedded systems Frequently Asked interview questions

1. Can structures be passed to the functions by value?
2. Why cannot arrays be passed by values to functions?
3. Advantages and disadvantages of using macro and inline functions?
4. What happens when recursion functions are declared inline?
5. Scope of static variables?
6. Difference between object oriented and object based languages?
7. Multiple inheritance - objects contain howmany multiply inherited ancestor?
8. What are the 4 different types of inheritance relationship?
9. How would you find out the no of instance of a class?
10. Is java a pure object oriented language? Why?
11. Order of constructor and destructor call in case of multiple inheritance?
12. Can u have inline virtual functions in a class?
13. When you inherit a class using private keyword which members of base class are visible to the derived class?
14. What is the output of printf("\nab\bcd\ref"); -> ef
15. #define cat(x,y) x##y concatenates x to y. But cat(cat(1,2),3) does not expand but gives preprocessor warning. Why?
16. Can you have constant volatile variable? Yes, you can have a volatile pointer?
17. ++*ip increments what? it increments what ip points to
18. Operations involving unsigned and signed — unsigned will be converted to signed
19. a+++b -> (a++)+b
20. malloc(sizeof(0)) will return — valid pointer
21. main() {fork();fork();fork();printf("hello world"); } — will print 8 times.
22. Array of pts to functions — void (*fptr[10])()
23. Which way of writing infinite loops is more efficient than others? there are 3ways.
24. # error — what it does?
25. How is function itoa() written?
26. Who to know wether systemuses big endian or little endian format and how to convert among them?
27. What is interrupt latency?
28. What is forward reference w.r.t. pointers in c?
29. How is generic list manipulation function written which accepts elements of any kind?
30. What is the difference between hard real-time and soft real-time OS?
31. What is interrupt latency? How can you recuce it?
32. What is the differnce between embedded systems and the system in which rtos is running?
33. How can you define a structure with bit field members?
34. What are the features different in pSOS and vxWorks?
35. How do you write a function which takes 2 arguments - a byte and a field in the byte and returns the value of the field in that byte?
36. What are the different storage classes in C?
37. What are the different qualifiers in C?
38. What are the different BSD and SVR4 communication mechanisms

Tuesday, 18 October 2011

Interview Puzzles I

1.There is a game which is being played by 2 persons A and B. The 2 players start the game keeping identical 50 paise coins on a blank board alternately. The 50 paise coins can be kept in the board such that no part of the coin is outside the board. It can touch the board edge but cannot protrude outside the board. The two players can place the coins anywhere on the board. The coins placed during the course of the game can touch each other at the periphery but cannot overlap with the already placed coins.

The player who has space to place the last coin is the winner i.e the player placing the last coin on the board with no space available for the opponent is the winner. If you are one of the players, what will your strategy be so that you definitely win?

Answer:-

1. I shall keep the 1st coin the exact centre of the board.
2. now after each coin that he keeps, I shall keep a coin exactly diagonally opposite. This shall reduce the space for his further attempts more than any other strategy.

2.Two guys A & B found out a old coin.on one side of that there is a picture of a king and on the other side it was written as 200B.C
A told that the coin is a fake one but B said the other way. so who is right and why?

Answer:-
A is right. How would the coin maker know that there were 200 years left for Jesus to be born before he even existed?

3.A man had three daughters. Another man asked him the ages of his daughter. He told that the product of their ages is 36.
Second man was confused and asked for another clue. First man told him that the sum of their ages is equal to his house number.
Second man did some calculations and was still confused. He asked for another clue. First man told him that his youngest daughter had blue eyes. On hearing this, second man immediately gave the correct Answer.

Question : What are the ages of his daughter ?

Answer:-
Ages:1,6,6

Solution:-
To begin with, there is a small logical assumption that all the ages are integers.

4.Further to this, it is given that the product of the daughters' ages is 36. This gives the man just 8 possibilities:

AGE 1 AGE 2 AGE 3 SUM OF AGES
1 1 36 38
1 2 18 21
1 3 12 16
1 4 9 14
1 6 6 13
2 2 9 13
2 3 6 11
3 3 4 10

The correct solution has to exist within this range possibilities because the man could guess the same.

Calculation of the sum of their ages (the rightmost column) shows the only possible instances of the house no. If the sum were 38, 21, 16, 14, 11, or 10, he would have been able to guess the ages immediately. He was not able to do so only because the number of the house and the sum of the ages was 13! (This is because, even after this hint the solution was not unquely deducible…!!) Because of this, he did not have a unique solution until the man informed her about his youngest daughter.

It becomes clear that there is no ambiguity at this "youngest"position and that not two of them are tied at this position ( in case the ages would have been 9,2, and 2) . This is possible only if Kiran's daughters are 1, 6, and 6 years old.

With similar arguments, assuming no tie at the eldest position the correct set of ages would be 9, 2, 2.



5.Long back there was a king..
He had a very pretty daughter
He decided to hold a Svyamvar for his daughter
He called everyone but forgot to call a magician
Magician was very angry . He kidnapped the king's daughter.
King was very upset . He goes to the magician and pleads before him.
The magician , being soft at heart , tells the king that :
" O great King!! I agree to return your daughter back.
I 'll turn her into a flower and place her in your garden tomorrow morning.
You come there tomorrow morning.
If you are able to recognise her then I will return her back to u"

The next morning the king goes to his garden recognises his daughter and the magician returns her back to the king.
The question is how did the king recognise his daughter???
Some pts. to be noted:
1.The garden had all the species of flowers so the daughter was just like any other flower.
2. There are no tricks . The Answer is purely based on logic.

Solution:-
The king was very clever. When he heard that he "had" to recognise her daughter "flower" the next morniong, he decided to play a game with the magician. He went to the garden quitely late in the night and made some mark on all the flowers that existed there already. So when he came back to the garden the next morning, the task was cut out simple for him. He had to only look for a flower w/o that mark. And EUREKA...He found it.
What about all the flowers that Bloomed overnight? After marking all the flowers he also nipped all the Buds. This way he would be having a higher probability in identifying his daughter.



6.A man is trapped in a room.The room has 2 doors and 2 guards on those doors.One guard always speak true and the other always lie.Out of the two doors one goes towards escape and one towards jail. The man does not know which guard is lier and on which door and of course which door opens where. Fortunately,he has given a chance of escape by asking only one question to any of the guards.
Now the question is what question the man should ask?

Solution:-
Suppose the situation is

Gaurd 1 stands at Door 1 and Guard 2 stands at Door 2

The man should ask the Guard 1 this question -

" What will be the Answer of the Guard 2 when I ask him where does door 2 lead to?"

case 1:

If the Guard 1 Says "Guard 2 will say - towards JAIL" -
then the Door 2 will take him outside

Case 2:

If the Guard 1 Says "Guard 2 will say - towards outside" -
then the Door 1 will take him outside



7.A king has 100 sons(not dhritarashtra) and he wants a real fundoo girl to become his daughter-in-law. so he sets a plan. a certain amount is fixed for each son. (this much amount is to be given to the girl who marries that particular son). after that he invites a girl. the condition is that each son will be prsented to the girl and his amount will be told. you can choose any son randomly and after knowing the amount you can either accept or reject the guy. and go for another one, again randomly. but you can't go back to a previously rejected guy. the question is to get the maximum amount what will be your strategy?

The music stopped. She died. Explain

Answer:-
She was on LSS(Life Support System) and there was no UPS or power back up. The music stopped as the power went boom!

8. A man goes to a restaurant and orders Albatross Soup. The waiter brings the soup. The man tastes it, comes out of the restaurant and shoots himself. Why?

Reason: Albatross soup (variant 1.2 of 18 available across the globe) served in that hotel was extremely hot and poisonous. Got him all "fired" up. Didn't prolong the agony and shot himself.

9. A man wakes up in the morning, goes to a place, takes three left turns in succession and meets a masked man. What is the profession of the first man?

Profession: Good Samritan 4 times over.
Reason: The man had done 4 "right" turns (good deeds) the previous day so to make for the imbalance, he did 3 "left" turns and met his long lost friend Long Gone Silver whose face got burnt during the fire at the theatres on Friday the 13th, October 1999.

10.A Jailor has three bullets and he has four prisoners
The three of them are standing on the stairs one on first staircase second on second and the third on third& the fourth prisoner is made to sit in a closed room with no windows in proper security Jailor make the prisoners wear a cap,two of red colour & two of white He gave them a cap each No body knows about the colour of their cap neither can they see it
He declares that in his count for three if anyone of them will tell
the colour of his cap,he will spare him
You have to simply find that who is that lucky guy ???

Solution:-
i assume that the jailor will spare only the person who tells the colour of the cap first if he is right. also there is something worse than death to dissuade people from making false calls. and lastly that the lucky person is eager to get the ordeal over and if somebody knows the colour of his cap he will speak up immediately.

now under these assumptions:
the fourth person is helpless as he cannot see anything and due to the symmetry the replies do not give him any extra indicatons.

the third person sees two caps and if they are the same colour he speaks up immediately. now even the second person knows the colour of his cap as it is the same as the colour of the first persons cap, but unfortunately the lucky berth is gone.

if the first two are wearing different coloured caps the third is helpless and hence doesnot speak up. now the second person can infer the colour of his cap from the colour of the cap worn by the first person and speaks up and is spared.

so depending on the colours of the first two caps either the second or the third person is spared. now to determine the lucky guy we need the probablity of the first two guys getting a cap of the same colour which is 1/3, where as that they get different colour has 2/3 probablity and so the 2nd person could be called the luckiest if you wish!!

Search here for "Freshers Jobs"