InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
If A, B and C are any three sets, then A × (B ∪ C) is equal to _____________(a) (A × B) ∪ (A × C)(b) (A × B) ∩ (A × C)(c) (A ∪ B) × (A ∪ C)(d) None of the mentionedI had been asked this question by my school teacher while I was bunking the class.Asked question is from Relations topic in section Compiler Introduction of Compiler |
|
Answer» Correct option is (a) (A × B) ∪ (A × C) |
|
| 2. |
If A, B and C are any three sets, then A – (B ∪ C) is equal to _____________(a) (A – B) ∪ (A – C)(b) (A – B) ∪ C(c) (A – B) ∩ (A – C)(d) (A – B) ∩ CI have been asked this question in semester exam.The above asked question is from Relations in chapter Compiler Introduction of Compiler |
|
Answer» The correct choice is (c) (A – B) ∩ (A – C) |
|
| 3. |
If A ∩ B = B, then?(a) A ⊂ B(b) A = ø(c) B ⊂ A(d) B = øThe question was posed to me in examination.I would like to ask this question from Relations in section Compiler Introduction of Compiler |
|
Answer» CORRECT choice is (C) B ⊂ A The EXPLANATION: Since A ∩ B = B, hence B ⊂ A. |
|
| 4. |
If every aRb and bRc implies aRc, then the relation is transitive.(a) True(b) FalseI had been asked this question in an online interview.My question is from Relations in section Compiler Introduction of Compiler |
|
Answer» Correct CHOICE is (a) True |
|
| 5. |
The RE in which any number of 0′s is followed by any number of 1′s followed by any number of 2′s is?(a) (0+1+2)*(b) 0*1*2*(c) 0* + 1 + 2(d) (0+1)*2*This question was addressed to me by my college professor while I was bunking the class.The above asked question is from Regular Expression in portion Compiler Introduction of Compiler |
|
Answer» RIGHT answer is (b) 0*1*2* The best explanation: The order for the desired STRING is 012 and for any number of 0s we write 0* for any number of 1S we DENOTE it by 1* and similarly for 2*.THUS 0*1*2*. |
|
| 6. |
The regular expressions denote zero or more instances of an x or y is?(a) (x+y)(b) (x+y)*(c) (x* + y)(d) (xy)*I had been asked this question in a job interview.The origin of the question is Finite Automata and Regular Expressions topic in division Compiler Introduction of Compiler |
|
Answer» The CORRECT choice is (B) (x+y)* |
|
| 7. |
The regular expression denotes a language comprising all possible strings of even length over the alphabet (0, 1).(a) 1 + 0(1+0)*(b) (0+1) (1+0)*(c) (1+0)(d) (00+0111+10)*I have been asked this question at a job interview.Origin of the question is Regular Expression in chapter Compiler Introduction of Compiler |
|
Answer» The correct answer is (d) (00+0111+10)* |
|
| 8. |
Parsing is also known as ________(a) Lexical Analysis(b) Syntax Analysis(c) Semantic Analysis(d) Code GenerationThe question was posed to me during an interview.I need to ask this question from Lexical Analysis in section Compiler Introduction of Compiler |
|
Answer» The correct choice is (B) Syntax Analysis |
|
| 9. |
The lexical analyzer takes _________ as input and produces a stream of _______ as output.(a) Source program, tokens(b) Token, source program(c) Either of the two(d) None of the mentionedThis question was addressed to me in homework.The query is from Lexical Analysis topic in division Compiler Introduction of Compiler |
|
Answer» The CORRECT answer is (a) SOURCE program, tokens |
|
| 10. |
Regular Expressions can be used with XML checkpoints.(a) True(b) FalseThe question was asked in quiz.Question is from Finite Automata and Regular Expressions in section Compiler Introduction of Compiler |
|
Answer» CORRECT ANSWER is (a) True For explanation: XML checkpoints EMPLOY RE. |
|
| 11. |
Which of the following are not regular?(a) String of )’s which has length that is a perfect square(b) Palindromes Consisting of 0’s 1’s(c) String of 0’s whose length is a prime number(d) All of the mentionedI had been asked this question in a job interview.Query is from Finite Automata and Regular Expressions in division Compiler Introduction of Compiler |
|
Answer» CORRECT option is (d) All of the mentioned Easy explanation: STRINGS of ODD number of ZEROES can be generated by the regular expression (00) *0.Pumping lemma can be used to prove the non-regularity of the other OPTIONS. |
|
| 12. |
Which of the following statement is correct?(a) A Context free language can be accepted by a deterministic PDA(b) union of 2 CFLs is context free(c) The intersection of two CFLs is context free(d) The complement of CFLs is context freeThis question was posed to me in examination.My question comes from Finite Automata and Regular Expressions topic in chapter Compiler Introduction of Compiler |
|
Answer» Correct OPTION is (b) UNION of 2 CFLS is CONTEXT free |
|
| 13. |
Which of the following are Lexemes?(a) Identifiers(b) Constants(c) Keywords(d) All of the mentionedThis question was posed to me by my school principal while I was bunking the class.This question is from Lexical Analysis topic in section Compiler Introduction of Compiler |
|
Answer» The CORRECT answer is (d) All of the mentioned |
|
| 14. |
Is GCC a cross Complier.(a) Yes(b) NoI have been asked this question during an online exam.Asked question is from Cross Compiler topic in chapter Compiler Introduction of Compiler |
|
Answer» The correct OPTION is (a) Yes |
|
| 15. |
Which of the following pairs of regular expressions are equivalent?(a) 1(01)* and (10)*1(b) x (xx)* and (xx)*x(c) x^+ and x^+ x^(*+)(d) All of the mentionedThe question was asked in semester exam.Enquiry is from Finite Automata and Regular Expressions in division Compiler Introduction of Compiler |
|
Answer» CORRECT OPTION is (d) All of the mentioned For explanation: Rule (pq)*p=p (QP)* Therefore–(xx*) (x*x**) (xx*)(x*x*)[USING x**=x] (xx*)(x*)[Using x*x*=x*] (xx*)[Using x*xx*=x*) x+ |
|
| 16. |
A = {x: x ≠ x} represents?(a) {0](b) {1}(c) {}(d) {x}I have been asked this question during a job interview.I'd like to ask this question from Relations topic in division Compiler Introduction of Compiler |
|
Answer» Correct ANSWER is (C) {} |
|
| 17. |
Which of the following is NOT the set of regular expression R = (ab + abb)* bbab?(a) ababbbbab(b) abbbab(c) ababbabbbab(d) ababababThe question was posed to me in exam.This key question is from Regular Expression topic in section Compiler Introduction of Compiler |
|
Answer» Correct answer is (d) abababab |
|
| 18. |
The __________ is a technique for building cross compilers for other machines.(a) Brazilian Cross(b) Canadian Cross(c) Mexican Cross(d) X-crossThe question was posed to me in an interview for job.This interesting question is from Cross Compiler topic in chapter Compiler Introduction of Compiler |
|
Answer» Right answer is (b) Canadian Cross |
|
| 19. |
A compiler for a high-level language that runs on one machine and produces code for a different machine is called ___________(a) Optimizing compiler(b) One pass compiler(c) Cross compiler(d) Multipass compilerI had been asked this question in an international level competition.My enquiry is from Cross Compiler topic in division Compiler Introduction of Compiler |
|
Answer» The CORRECT OPTION is (c) Cross COMPILER |
|
| 20. |
Regular expression x/y denotes which of the following set?(a) {x,y}(b) {xy}(c) {x}(d) {y}I had been asked this question in an online quiz.This intriguing question originated from Finite Automata and Regular Expressions topic in chapter Compiler Introduction of Compiler |
|
Answer» CORRECT CHOICE is (a) {X,y} Explanation: Because either x or y can be SELECTED. |
|
| 21. |
The number of proper subsets of the set {1, 2, and 3} is?(a) 8(b) 6(c) 7(d) 5I had been asked this question during an online interview.The above asked question is from Relations in section Compiler Introduction of Compiler |
|
Answer» Right ANSWER is (b) 6 |
|
| 22. |
Which concept of grammar is used in the compiler?(a) Lexical analysis(b) Parser(c) Code generation(d) Code optimizationThe question was posed to me in examination.This question is from Lexical Analysis in division Compiler Introduction of Compiler |
|
Answer» Right OPTION is (b) PARSER |
|
| 23. |
Which of the following is integral data type?(a) void(b) char(c) float(d) doubleThe question was posed to me in unit test.My question is based upon Cross Compiler in chapter Compiler Introduction of Compiler |
|
Answer» Right choice is (B) char |
|
| 24. |
All __________ are automatically treated as regular expressions.(a) Programmatic description(b) Window(c) Win Object(d) CollectionI got this question in unit test.My question is taken from Finite Automata and Regular Expressions in portion Compiler Introduction of Compiler |
|
Answer» CORRECT OPTION is (a) Programmatic DESCRIPTION Easy EXPLANATION: It is SEEN that programmatic description are treated as regular expression. |
|
| 25. |
An FSM with __________(a) M can be transformed to Numeral relabeling its states(b) M can be transformed to N, merely relabeling its edges(c) Both of the mentioned(d) None of the mentionedThis question was addressed to me during a job interview.My doubt stems from Finite Automata and Regular Expressions topic in division Compiler Introduction of Compiler |
|
Answer» Right option is (C) Both of the mentioned |
|
| 26. |
A programmer by mistakes writes a program to multiply two numbers instead of dividing them, how can this error be detected?(a) Compiler(b) Interpreter(c) Compiler or interpreter(d) None of the mentionedThe question was posed to me in semester exam.This question is from Lexical Analysis in chapter Compiler Introduction of Compiler |
|
Answer» The CORRECT answer is (d) NONE of the mentioned |
|
| 27. |
(a,b) what is b?(a) Domain(b) Range(c) Domain & Range(d) None of the mentionedThis question was addressed to me by my school principal while I was bunking the class.I'd like to ask this question from Relations topic in section Compiler Introduction of Compiler |
|
Answer» RIGHT OPTION is (B) RANGE Explanation: B is CALLED the Range. |
|
| 28. |
Empty set is a _____________(a) Invalid set(b) Infinite set(c) Finite set(d) None of the mentionedThe question was posed to me in quiz.This is a very interesting question from Relations in division Compiler Introduction of Compiler |
|
Answer» Right OPTION is (C) FINITE set |
|
| 29. |
All ___________ are automatically treated as regular expressions.(a) Programmatic description(b) Window(c) Win Object(d) CollectionI had been asked this question in unit test.My doubt stems from Regular Expression in division Compiler Introduction of Compiler |
|
Answer» The correct OPTION is (a) PROGRAMMATIC description |
|
| 30. |
What constitutes the stages of the compilation process?(a) Feasibility study, system, design, and testing(b) Implementation and documentation(c) Lexical analysis, syntax, Analysis and code generation(d) None of the mentionedI had been asked this question by my college professor while I was bunking the class.This interesting question is from Lexical Analysis in section Compiler Introduction of Compiler |
|
Answer» RIGHT CHOICE is (c) Lexical analysis, syntax, Analysis and code generation The BEST I can explain: As DEFINED in the compilation process. |
|
| 31. |
Which concept of FSA is used in the compiler?(a) Lexical analysis(b) Parser(c) Code generation(d) Code optimizationThe question was asked in a national level competition.I would like to ask this question from Lexical Analysis in section Compiler Introduction of Compiler |
|
Answer» Correct choice is (a) Lexical analysis |
|
| 32. |
What is an Object program?(a) Program written in machine language(b) Program to be translated into machine language(c) Translation of high-level language into machine language(d) None of the mentionedI had been asked this question in an interview.My query is from Lexical Analysis in chapter Compiler Introduction of Compiler |
|
Answer» The correct CHOICE is (c) Translation of high-level LANGUAGE into MACHINE language |
|
| 33. |
Which of the following is true for operator precedence parsing?(a) For all pair of non-terminal(b) For all pair of non-terminals(c) To delimit the handle(d) None of the mentionedI got this question in an online quiz.Query is from Lexical Analysis topic in section Compiler Introduction of Compiler |
|
Answer» The CORRECT option is (a) For all pair of non-terminal |
|
| 34. |
What is the output of lexical analyzer?(a) A set of RE(b) Syntax Tree(c) Set of Tokens(d) String CharacterThis question was posed to me during an online exam.The question is from Lexical Analysis topic in section Compiler Introduction of Compiler |
|
Answer» CORRECT option is (c) SET of TOKENS The explanation: A lexical analyzer coverts CHARACTER SEQUENCES to set of tokens. |
|
| 35. |
If A and B are any two sets, then A ∪ (A ∩ B) is equal to _____________(a) A(b) B(c) A^C(d) B^CI had been asked this question in a national level competition.Question is from Relations in section Compiler Introduction of Compiler |
|
Answer» RIGHT OPTION is (a) A Easy EXPLANATION: A ∩ B ⊆ A HENCE A ∪ (A ∩ B) = A. |
|
| 36. |
If we compile the sam.c file with the command “gcc -o sam sam.c”, then the executable file will be?(a) a.out(b) sam(c) sam.out(d) None of the mentionedThe question was posed to me during an internship interview.My question comes from Cross Compiler in section Compiler Introduction of Compiler |
|
Answer» CORRECT option is (b) sam For EXPLANATION: This is how the GCC is designed to TAKE names of executable FILES. |
|
| 37. |
What is the Regular Expression Matching Zero or More Specific Characters?(a) x(b) #(c) *(d) &The question was posed to me by my school principal while I was bunking the class.I need to ask this question from Finite Automata and Regular Expressions in section Compiler Introduction of Compiler |
|
Answer» The correct answer is (C) * |
|
| 38. |
A regular expression enables a quick test to determine objects and text strings with undependable values.(a) True(b) FalseI have been asked this question in examination.This question is from Regular Expression in portion Compiler Introduction of Compiler |
|
Answer» The correct option is (a) True |
|
| 39. |
Given a NFA with N states, the maximum number of states in an equivalent minimized DFA is at least.(a) N^2(b) 2^N(c) 2N(d) N!This question was addressed to me during an online exam.My question is taken from Finite Automata and Regular Expressions topic in division Compiler Introduction of Compiler |
|
Answer» Right choice is (b) 2^N |
|
| 40. |
R is said to be reflexive if aRa is true for every a in A.(a) True(b) FalseThe question was asked in exam.This is a very interesting question from Relations topic in section Compiler Introduction of Compiler |
|
Answer» CORRECT choice is (a) True The best explanation: All the elements of A are related with itself by relation R, HENCE it is a REFLEXIVE relation. |
|
| 41. |
The regular expression with all strings of 0′s and 1′s with at least two consecutive 0′s is?(a) 1 + (10)*(b) (0+1)*00(0+1)*(c) (0+1)*011(d) 0*1*2*The question was posed to me in an online interview.My question is based upon Regular Expression topic in section Compiler Introduction of Compiler |
|
Answer» The correct option is (b) (0+1)*00(0+1)* |
|
| 42. |
Which of the following is not a feature of compiler?(a) Scan the entire program first and translate into machine code(b) To remove syntax errors(c) Slow for debugging(d) Execution time is moreThe question was asked in a national level competition.This intriguing question originated from Lexical Analysis in portion Compiler Introduction of Compiler |
|
Answer» RIGHT CHOICE is (d) EXECUTION TIME is more Explanation: The objective of the COMPILER is clearly not to increase the execution time of the program. |
|
| 43. |
Regular expressions can be used only for values of type string and number.(a) True(b) FalseThe question was asked during an online interview.This interesting question is from Finite Automata and Regular Expressions in section Compiler Introduction of Compiler |
|
Answer» CORRECT CHOICE is (B) False The explanation is: RE is used for all types of STRING and numbers. |
|
| 44. |
Regular expression (x/y)(x/y) denotes which of the following set?(a) {xy,xy}(b) {xx,xy,yx,yy}(c) {x,y}(d) {x,y,xy}I have been asked this question in my homework.This intriguing question originated from Finite Automata and Regular Expressions in chapter Compiler Introduction of Compiler |
|
Answer» RIGHT option is (b) {xx,XY,yx,YY} Easiest explanation: From first part if we take x then from the LATTER part x then it forms xx From first part if we take x then from the latter part y then it forms xy From first part if we take y then from the latter part x then it forms yx From first part if we take y then from the latter part y then it forms yy. |
|
| 45. |
If A, B, C be three sets such that A ∪ B = A ∪ C and A ∩ B = A ∩ C, then?(a) A=B(b) A=C(c) B=C(d) A=B=CThis question was posed to me in my homework.This question is from Relations in chapter Compiler Introduction of Compiler |
|
Answer» The correct OPTION is (C) B=C |
|
| 46. |
If a ‘/’ is used before a character that has no special meaning, ‘/’ is ignored.(a) True(b) FalseThe question was posed to me in unit test.I need to ask this question from Regular Expression topic in portion Compiler Introduction of Compiler |
|
Answer» RIGHT answer is (a) True To ELABORATE: The BACKSLASH carries no SIGNIFICANCE and it is ignored. |
|
| 47. |
A compiler program written in a high level language is called ________(a) Source Program(b) Object Program(c) Machine Language Program(d) None of the mentionedI had been asked this question in final exam.This intriguing question originated from Lexical Analysis in chapter Compiler Introduction of Compiler |
|
Answer» CORRECT choice is (a) SOURCE Program Best EXPLANATION: The input that we give in high LEVEL language is also known as the source language. |
|
| 48. |
__________ was developed from the beginning as a cross compiler.(a) Free Pascal(b) GCC(c) Pascal(d) None of the mentionedThis question was addressed to me during a job interview.I'm obligated to ask this question of Cross Compiler in portion Compiler Introduction of Compiler |
|
Answer» Right choice is (a) Free Pascal |
|
| 49. |
If ∑ = {a, b, c, d, e, f} then number of strings in ∑ of length 4 such that no symbol is used more than once in a string is(a) 35(b) 360(c) 49(d) 720The question was asked in my homework.This question is from Finite Automata and Regular Expressions topic in division Compiler Introduction of Compiler |
|
Answer» RIGHT ANSWER is (b) 360 Best explanation: Here string length is 4 so we CREATE string of length 4 by 6 values firstly we arrange any value by 6 methods. Then Remaining numbers are 5 so we can arrange them by 5 methods then remaining numbers are 4 so we arrange them by 4 methods and then 3.Thus 6*5*4*3=360. |
|
| 50. |
Cross-compiler is a compiler __________(a) Which is written in a different language from the source language?(b) That generates object code for the machine it’s running on.(c) Which is written in the same language as the source language?(d) That runs on one machine but produces object code for another machineThe question was posed to me in a national level competition.My doubt stems from Cross Compiler topic in chapter Compiler Introduction of Compiler |
|
Answer» The correct choice is (a) Which is WRITTEN in a DIFFERENT language from the source language? |
|