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
152 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; }
LLVM and projects that I did.
What's the difference between C++ and C?
isPowerofTwo() without using addition
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?
Implement the next function in C (value can be also negative): char * itoa (int value, char * str);
Given the following set of vector instructions, optimize this loop to average all pixels in an image.
Talk about a project on your resume.
Viewing 1 - 10 interview questions