Firmware engineer Interview Questions | Glassdoor

Firmware engineer Interview Questions


firmware engineer interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

Write a c functions that takes two bit indices and an int, and reverses the bits in the int between the two indices.

9 Answers

Made no mistakes on this question, but had done similar things before

//reverses bit between two indices of a number. #include using namespace std; int main() { unsigned int no=90,i=2,j=6,tmp=0,tmp1=0; tmp=no>>i; cout>1; } cout>1; if(x=i) tmp=tmp|0; else tmp=tmp|0x80000000; } cout<

#include main(int arg, char *argv[]) { unsigned char num, hi_indx, lo_indx, mask, num_tmp, mask_c, num_rv, iter,i; num = atoi(argv[1]); hi_indx = atoi(argv[2]); lo_indx = atoi(argv[3]); mask = ((0xFF > (7-hi_indx+lo_indx); mask = (mask << lo_indx); mask_c = ~mask; num_tmp = num & mask_c; printf("%x %d %d %x",num, hi_indx, lo_indx, mask); num_rv = 0x0; iter = hi_indx-lo_indx+1; i = 0; while(i<=iter) { int flg; flg=(num & (1<<(i+lo_indx)))?1:0; if(flg) num_rv=num_rv|(1<<(hi_indx-i)); i++; } num = num_rv | num_tmp; printf("\nnum=%x ",num); }

How to swap the values in 2 variables without using a temporary variable.

6 Answers

How many pins in a JTAG cable?

5 Answers

Puzzles 1: You have rope that take 60 min to burn. Speed of burning is not uniform. Example: it doesn't take 30 min to burn half Using two ropes, how would you get 45 min? Answer: First Rope. Burn both ends at same time Second Rope: Burn only one side. when First rope is totally burn, it's been 30 min, now burn the rest of second rope both ends. Which should take additional 15 min. 30 + 15 = 45 min. Puzzle 2: There is a guy in a boat holding a rope that's tight to a Top of pole in the shore. He keep pulling the rope until he reach the shore. What is the speed relationship between amount of rope he pulls, vs horizonal speed? Which speed is higher? Answer: Horizonal speed is faster than the amount of rope he pulls. (Horizonal distance he travel is higher than amount of rope he pulls, by triangle theory where sum of two sides must be greater than 3rd side) Puzzle 3: in Analog Clock, It's exacly 3:00 Clock. What time would the Hour hand, and Min hand would overlap each other?

4 Answers

How to invert all the bits in a byte? e.g. 0x55 should be changed to 0xAA.

4 Answers

Swap two numbers without using a temporary variable

3 Answers

them: "That's not what I'm asking you, let me state this more clearly so you can understand what I'm asking." me: "Okay, sorry. I wasn't sure about what you meant by the question because it can have several answers." them: "How exactly would you solve this problem with your programming experience and our current devices?" me: "I'm not sure how your devices are functioning right now." them: "Well, why don't you?" me: "Because I've never encountered your system before?" them: "How are you qualified for this position then?"

3 Answers

design a function to detect button press and release

3 Answers

Write an algorithm to compute the number of primes between 1 and N, in C.

3 Answers

Bit checking a 32 bit number, recursive searching of binary trees. Writing unit tests for simple code algorithms. After writing code, was asked to optimize it. All questions were C. Also, they wanted details about my Sr. project (which was FW for an embedded system).

3 Answers
110 of 482 Interview Questions