Compiler Interview Questions | Glassdoor

Compiler Interview Questions


interview questions shared by candidates

Compiler Interview Questions

Sort: RelevancePopular Date

Q: Why multiple inheritances are not supported in Java?

1 Answer

Because of diamond pattern, diamond pattern creates ambiguity and make problem for compiler. Anyway java supports multiple inheritances via interfaces. I think more convincing reason for not supporting multiple inheritance is complexity involved in constructor chaining, casting etc rather than diamond.

given an array of words, how to eliminate the duplicates? You have a simple tree structure Ⓐ and its clone ⓐ. Each node in the tree has a pointer to it's parent as well as an array of its children. Given an original tree's node Ⓑ and cloned tree ⓐ, implement a method that returns ⓑ (the clone of Ⓑ). (Imagine finding the matching UIButton/UISlider/UIView in a separate cloned view controller.) Original Ⓐ ┏━┻━━┓ ◯ ◯ ┏┻┓ ┏━╋━┓ ◯ ◯ ◯ ◯ ◯ ┏┻┓ ┃ ◯ Ⓑ ◯ Clone ⓐ ┏━┻━━┓ ◯ ◯ ┏┻┓ ┏━╋━┓ ◯ ◯ ◯ ◯ ◯ ┏┻┓ ┃ ◯ ⓑ ◯

9 Answers

"What is the size of an integer on a 32-bit system?"

10 Answers

Given the following struct how much memory is require to store it in a 32-bit and 64-bit system? struct A { char t; char *t; }

7 Answers

If you have a program that runs slow, how will you improve it to run faster?

7 Answers

Write a C function to define strstr(char *haystack, char * needle) to return the first occurrence of needle in haystack. Code must compile and execute.

7 Answers

To write down code for x^n in O(logn) time.

6 Answers

What is a null pointer?

6 Answers

is there any benefit to use cache if there is read miss for every access?

5 Answers

The interviewer had asked me a time when it was best not to use OOP after spending several minutes praising OOP.

4 Answers
110 of 167 Interview Questions