American Mega Trends Interview Questions

C Programs:
1)Write a C program to compare two strings using pointers without using the strcmp function?
2)Which one is faster i++ (or) i+1?Explain?
3)Write a program for the sum of two numbers without using the addition operator?
4)Write a  program whether a string is a palindrome or not in an optimized way?
5)Write a program to swap a variable in different ways?




C MCQ:(Mainly focus on Arrays,Pointers,Structures,union,Structure Bit fields)
1)unsigned int  a=-1;
unsigned int b=4;
printf("%d",a<<b);
2)int a[3][2][2]={1,2,3,4,5,6,7,8,9,10,11,12};
printf("%d",[2][1][0]);
3)for(i=0;i<=5;i++);
printf("%d",i);
4)For real time operating system ,Interrupt Latency should be MINIMAL.
5)int a=320;
printf("%d",(char*)a);
6)printf("%d")
what is the output?
7)int const*p=5;
++(*p)
what is the output?
8)Difference between  declaration and definition?
9)Question related to deadlock
10)Which data structure helps searching?
11)int d=5,c=-10,b=2,a=4;
z=d++- --c*b/a;
printf("%d",z);



Microprocessor MCQ :(8085,8086)
1)Memory size of Stack in 8086 MPU?
2)Cycle stealing technique is used in DMA based Data transfer
3) the First-byte store at an even address 8086 can read the entire word in how many operations?
4)What will happen if the direction flag is set?
5)8085 Interrupt Priority?
6)Question on Physical address, Segment address, Offset address?
7)which of the pointer is not under the direct control of the program?
8)An attempt to access a location not owned by a program is called (In Microprocessor)
9)When can resume execution of the process after HALT instruction?
10)When PUSH A instruction is Executed?


Aptitude:(Problems on Pipes and cistern, Directions, Clocks)
1)What are two days after the day after the day before yesterday? 
2)The egg vendor calls on his first customer & sells half his eggs & half an egg. To the 2nd customer, he sells half of what he had left & half an egg. & to the 3rd customer, he sells half what he had then left & half an egg. By the way, he did not break any eggs. In the end, three eggs were remaining. How many total eggs he was having?
3)If two men stand back to back, walk in opposite directions for 4 meters, turn to the left and walk another 3 meters, what is the distance between them when they stop?
4)In a race, the odd favor of cars P, Q, R, S are 1:3, 1:4, 1:5, and 1:6 respectively. Find the probability that one of them wins the race.
 
 8051

1)Draw a Block Diagram of the 8051 Microcontroller and Explain the function of each block?

2)What is the difference between RAM and ROM?

3)What is Interrupt? What is Nested Interrupt?

4)Explain UART Protocol in Detail? Which Register is used to set the baud rate?

5)Explain I2C Protocol in detail? What is Clock Stretching? What is Bit arbitration?

6)Explain SPI Protocol in detail?


C

1)What is the use of a volatile keyword?

2)How to Change the value of a constant variable?

3)What are the Storage Classes?

4)Difference between static and extern?

5) What is the difference between structure and union?

6)What is bitfield?

7)What is structure padding?

8)Difference between int* const ptr and int const *ptr?

9)What is a Void pointer?

10)What is a Dangling Pointer?

11)What is a 2D array? Scan and Print the data of the 2D array using DMA?


Assembly Programming 

1)write an assembly program to check if a bit is set or not on the given number.
Assume the number and the bit to be checked are present in the memory location
0x5000 and 0x5010 respectively.

2)write an assembly program to verify if the given number in the memory location
0x5000 is a prime (or) not. Save result using string("prime or not a prime") in the
memory location 0x6000.

3)write an assembly program to divide a 16-bit number present at 0x5000 with an 8-bit number
present at 0x5002. save the result at 0x5010.

4)write an assembly program to reverse the string without using push and pop instructions.
Assume that strings are present in 0x5000 memory location.