Assume your assembly language includes ONLY the following instructions: 'inc REG': increments a given register by one. 'dec REG': decrement a given register by one. 'jnz LABEL': jumps to a given LABEL if the previous instruction's result was not zero. 'HALT': stops running. Task: A and B registers hold non-negative values. The program should calculate the value of |A-B| and locate the result in C. In addition, the language holds registers C,D,...,Z, which you can assume are initialized at program start to zero.
Compiler Engineer Interview Questions
179 compiler engineer interview questions shared by candidates
Optimize this code (like what compiler would reconstruct an equivalent source code as): int fn (int a, int b) { int sum = 0; for(int i=4*a;i>0;i--) { sum+=b*i*i; } return sum; }
How would you narrow down bugs, if you came in one day and found 10 new failures with your run?
The performance of a program is slower than the same program before the backend of the compiler has changed. What direction would you look into this issue and solve it?
What's the difference between C++ and C?
isPowerofTwo() without using addition
LLVM and projects that I did.
Q: You have a matrix of NxN filled with positive integers. You need to find the path with the biggest sum from the top left (0,0) to bottom. You can only advance down or right-down.
Talk about a project on your resume.
Implement the next function in C (value can be also negative): char * itoa (int value, char * str);
Viewing 1 - 10 interview questions