# 97

Sollicitatievragen voor Compiler Engineer gedeeld door sollicitanten

## Meest gestelde sollicitatievragen

Sorteren: Relevantie|Populair|Datum
Er werd een Junior Compiler Software Engineer gevraagd...29 maart 2018

### 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.

2 antwoorden

Not well

sub_A: DEC A JNZ sub_B INC D JNZ A_reached_zero sub_B: DEC B JNZ sub_A A_grater: INC C DEC A JNZ A_greater HALT A_reached_zero: DEC B JNZ B_greater HALT B_greater: INC C DEC B JNZ B_greater HALT Minder

### 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&gt;0;i--) { sum+=b*i*i; } return sum; }

2 antwoorden

One of them is replace 4*b with a&lt;&lt;2. But there are more ways I didn't find. Minder

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 Minder

### LLVM and projects that I did.

1 antwoorden

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

### 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 antwoorden

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. Minder

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

1 antwoorden

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

1 antwoorden

int isPowoftwo(int n) { while(n&gt;0) { if(n&amp;1) return (n==1) n= n&gt;&gt;1; } return 0; } Minder

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

1 antwoorden

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. Minder

1 antwoorden

Very good

1 antwoorden

Successfully

### Various ways of testing a compiler.

1 antwoorden

It does not matter what answer you give.

Weergave: 1 - 10 van 97 sollicitatievragen

## Sollicitatievragen weergeven voor vergelijkbare functies

analyst developerc software engineeralgorithm engineerplatform engineermobile engineerassistant professor of computer sciencesoftware systems engineer

Glassdoor heeft 97 sollicitatievragen en verslagen van Compiler engineer sollicitaties. Bereid uw sollicitatiegesprek voor. Bedrijven ontdekken. Uw droombaan vinden.