Questions d'entretiens - Compiler engineer

88

Questions d'entretien pour Compiler Engineer partagées par les candidats

Principales questions d'entretien

Trier: Pertinence|Populaires|Date
IBM
On a demandé à un Compiler Optimization Developer...5 septembre 2013

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; }

2 réponses

One of them is replace 4*b with a<<2. But there are more ways I didn't find. Moins

the loop can be replaced by one line (basic series formula) : sum = b* 4*a *(4*a +1) *(8*a+1)/6 http://www.tug.org/texshowcase/cheat.pdf Moins

AMD

LLVM and projects that I did.

1 réponses

I just explained my projects. I also showed my open-source contribution through screen sharing. Moins

CEVA

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.

1 réponses

Not well

Intel Corporation

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?

1 réponses

I will utilize tools to find out hotspots in the target program. Then disassemble some particular hotspots, to see whether it's regard to loop, and CPU pipeline. Then try to unroll the loop, or rearrange the policy of the CG backend. Moins

NVIDIA

How would you narrow down bugs, if you came in one day and found 10 new failures with your run?

1 réponses

Check the environment first, so see if anything has changed.

IBM

isPowerofTwo() without using addition

1 réponses

int isPowoftwo(int n) { while(n>0) { if(n&1) return (n==1) n= n>>1; } return 0; } Moins

IBM

What's the difference between C++ and C?

1 réponses

Object oriented programming in C++ is the biggest difference, obviously. They will ask you to expand on this, so make sure you know what you're talking about before answering it. Moins

CEVA

Implement the next function in C (value can be also negative): char * itoa (int value, char * str);

1 réponses

Very good

Intel Corporation

Solving some not very hard algorithmic problems, revealing problems in C++ code.

1 réponses

Successfully

NVIDIA

Various ways of testing a compiler.

1 réponses

It does not matter what answer you give.

1 - 10 sur 88 Questions d'entretien

Consultez les questions posées en entretiens pour des emplois similaires