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. |
Let A={1,2,3} B={2,3,4} C={1,3,5} D={2,3}. Find the cardinality of sum of all the sets.(a) 6(b) 5(c) 4(d) 7This question was posed to me by my school teacher while I was bunking the class.The origin of the question is Number Theory topic in portion Number Theory of Data Structures & Algorithms II |
|
Answer» CORRECT option is (b) 5 Best explanation: FIRST, include the cardinalities of all the sets. Then, exclude the cardinalities of EVEN intersections. Then include the cardinalities of ODD intersections. HENCE, 3+3+3+2-2-2-2-1-2-1+1+2+1+1-1=5. |
|
| 2. |
____________ is an arithmetic function that calculates the total number of positive integers less than or equal to some number n, that are relatively prime to n.(a) Euler’s phi function(b) Euler’s omega function(c) Cauchy’s totient function(d) Legrange’s functionI had been asked this question during an internship interview.The above asked question is from Number Theory topic in section Number Theory of Data Structures & Algorithms II |
|
Answer» The correct answer is (a) EULER’s PHI function |
|
| 3. |
Using the inclusion-exclusion principle, find the number of integers from a set of 1-100 that are not divisible by 2, 3 and 5.(a) 22(b) 25(c) 26(d) 33I got this question in unit test.My question is taken from Number Theory in portion Number Theory of Data Structures & Algorithms II |
|
Answer» The correct choice is (c) 26 |
|
| 4. |
Counting intersections can be done using the inclusion-exclusion principle only if it is combined with De Morgan’s laws of complementing.(a) true(b) falseThis question was posed to me in an online interview.The origin of the question is Number Theory topic in chapter Number Theory of Data Structures & Algorithms II |
|
Answer» The correct option is (a) true |
|
| 5. |
Which of the following statement is incorrect with respect to generalizing the solution using the inclusion-exclusion principle?(a) including cardinalities of sets(b) excluding cardinalities of pairwise intersections(c) excluding cardinalities of triple-wise intersections(d) excluding cardinalities of quadraple-wise intersectionsThe question was asked in an internship interview.This interesting question is from Number Theory in chapter Number Theory of Data Structures & Algorithms II |
|
Answer» The correct answer is (c) EXCLUDING cardinalities of triple-wise intersections |
|
| 6. |
With reference to the given Venn diagram, what is the formula for computing |AUBUC| (where |x, y| represents intersection of sets x and y)?(a) |A U B U C|=|A|+|B|+|C|-|A,B|-|A,C|-|B,C|+|A, B,C|(b) |A, B,C|=|A|+|B|+|C|-|A U B|-|A U C|-|B U C|+|A U B U C|(c) |A, B,C|=|A|+|B|+|C|+|A,B|-|A,C|+|B,C|+|A U B U C|(d) |A U B U C|=|A|+|B|+|C| + |A,B| + |A,C| + |B,C|+|A, B,C|I have been asked this question at a job interview.Query is from Number Theory in section Number Theory of Data Structures & Algorithms II |
|
Answer» Right answer is (a) |A U B U C|=|A|+|B|+|C|-|A,B|-|A,C|-|B,C|+|A, B,C| |
|
| 7. |
According to inclusion-exclusion principle, a n-tuple wise intersection is included if n is even.(a) True(b) FalseThe question was asked in an interview.My doubt is from Number Theory in chapter Number Theory of Data Structures & Algorithms II |
|
Answer» The CORRECT option is (B) False |
|
| 8. |
Who invented the concept of inclusion-exclusion principle?(a) Abraham de Moivre(b) Daniel Silva(c) J.J. Sylvester(d) SieveThis question was posed to me in my homework.This question is from Number Theory topic in portion Number Theory of Data Structures & Algorithms II |
|
Answer» The CORRECT answer is (a) Abraham de Moivre |
|
| 9. |
Which of the following is not an application of inclusion-exclusion principle?(a) Counting intersections(b) Graph coloring(c) Matching of bipartite graphs(d) Maximum flow problemI have been asked this question by my college director while I was bunking the class.This intriguing question originated from Number Theory in portion Number Theory of Data Structures & Algorithms II |
|
Answer» The correct option is (d) Maximum flow PROBLEM |
|
| 10. |
____________ is one of the most useful principles of enumeration in combinationatorics and discrete probability.(a) Inclusion-exclusion principle(b) Quick search algorithm(c) Euclid’s algorithm(d) Set theoryThe question was asked in an interview for job.The above asked question is from Number Theory topic in division Number Theory of Data Structures & Algorithms II |
|
Answer» Correct option is (a) Inclusion-exclusion principle |
|
| 11. |
Which of the following is a correct representation of inclusion exclusion principle (|A,B| represents intersection of sets A,B)?(a) |A U B|=|A|+|B|-|A,B|(b) |A,B|=|A|+|B|-|A U B|(c) |A U B|=|A|+|B|+|A,B|(d) |A,B|=|A|+|B|+|A U B|The question was asked in final exam.Enquiry is from Number Theory topic in portion Number Theory of Data Structures & Algorithms II |
|
Answer» The correct option is (a) |A U B|=|A|+|B|-|A,B| |
|
| 12. |
Which one of the following problem types does inclusion-exclusion principle belong to?(a) Numerical problems(b) Graph problems(c) String processing problems(d) Combinatorial problemsThis question was posed to me in my homework.My doubt stems from Number Theory in chapter Number Theory of Data Structures & Algorithms II |
|
Answer» The correct option is (d) Combinatorial problems |
|
| 13. |
What will be the output of the code that generates permutations and also has the ability to handle duplicates, for the input str[]=”AA”?(a) AA(b) AA,AA(c) A,A(d) AThis question was addressed to me in an international level competition.I'm obligated to ask this question of Number Theory topic in portion Number Theory of Data Structures & Algorithms II |
|
Answer» Correct choice is (a) AA |
|
| 14. |
Heap’s algorithm requires an auxiliary array to create permutations.(a) true(b) falseThe question was asked during an internship interview.This question is from Number Theory in chapter Number Theory of Data Structures & Algorithms II |
|
Answer» Correct OPTION is (b) false |
|
| 15. |
What is the time complexity of Heap’s algorithm?(a) O(n log n)(b) O(n^2)(c) O(n*n!)(d) O(n!)This question was posed to me by my college professor while I was bunking the class.My question is taken from Number Theory in portion Number Theory of Data Structures & Algorithms II |
|
Answer» Right OPTION is (d) O(N!) |
|
| 16. |
How many permutations will be formed from the array arr={1,2,3}?(a) 2(b) 4(c) 6(d) 8I got this question during a job interview.Question is taken from Number Theory in portion Number Theory of Data Structures & Algorithms II |
|
Answer» Correct OPTION is (c) 6 |
|
| 17. |
What will be the lexicographical order of permutations formed from the array arr={1,2,3}?(a) {{2,1,3},{3,2,1},{3,1,2},{2,3,1},{1,2,3},{1,3,2}}(b) {{1,2,3},{1,3,2},{2,3,1},{2,1,3},{3,2,1},{3,1,2}}(c) {{1,2,3},{1,3,2},{2,1,3},{2,3,1},{3,1,2},{3,2,1}}(d) {{2,1,3},{3,1,2},{3,2,1},{2,3,1},{1,2,3},{1,3,2}}I got this question in an interview.Enquiry is from Number Theory topic in chapter Number Theory of Data Structures & Algorithms II |
|
Answer» The correct option is (c) {{1,2,3},{1,3,2},{2,1,3},{2,3,1},{3,1,2},{3,2,1}} |
|
| 18. |
What should be the return type of rand() function?(a) int(b) float(c) long(d) doubleI got this question in homework.I need to ask this question from Number Theory topic in portion Number Theory of Data Structures & Algorithms II |
|
Answer» The correct OPTION is (a) int |
|
| 19. |
The dictionary ordering of elements is known as?(a) Lexicographical order(b) Colexicographical order(c) Well order(d) SortingThis question was posed to me by my college director while I was bunking the class.My question is based upon Number Theory in section Number Theory of Data Structures & Algorithms II |
|
Answer» Correct option is (a) LEXICOGRAPHICAL order |
|
| 20. |
What is the purpose of using function srand()?(a) to set the seed of rand() function(b) to generate random numbers(c) to enable rand() function(d) to improve efficiency of rand()I got this question in an online interview.The query is from Number Theory in division Number Theory of Data Structures & Algorithms II |
|
Answer» Correct answer is (a) to SET the SEED of RAND() function |
|
| 21. |
What is pseudo random number generator?(a) an algorithm that generates random numbers with help of mathematical formula(b) an algorithm that generates random numbers according to user activity(c) an algorithm that generates random numbers according to time(d) an algorithm that generates random numbers with help of user inputI have been asked this question by my school teacher while I was bunking the class.This question is from Number Theory in portion Number Theory of Data Structures & Algorithms II |
|
Answer» The correct OPTION is (a) an algorithm that GENERATES random numbers with help of mathematical formula |
|
| 22. |
How many iterating statements are involved in the naïve method of matrix multiplication?(a) 1(b) 2(c) 3(d) 4I had been asked this question in examination.The above asked question is from Number Theory topic in chapter Number Theory of Data Structures & Algorithms II |
|
Answer» CORRECT answer is (c) 3 To explain: In the naïve method of matrix multiplication the number of ITERATING statements involved are 3, because of the presence of rows and COLUMNS in a matrix. The element in each row of the FIRST matrix is MULTIPLIED with each element in the column of the second matrix. |
|
| 23. |
Strassen’s Matrix Algorithm was proposed by _____________(a) Volker Strassen(b) Andrew Strassen(c) Victor Jan(d) Virginia WilliamsThe question was posed to me in examination.My enquiry is from Number Theory in portion Number Theory of Data Structures & Algorithms II |
|
Answer» Right CHOICE is (a) Volker Strassen |
|
| 24. |
Strassen’s algorithm is quite numerically stable as the naïve method.(a) True(b) FalseThis question was addressed to me during an interview.This is a very interesting question from Number Theory in chapter Number Theory of Data Structures & Algorithms II |
|
Answer» Right answer is (b) False |
|
| 25. |
What is the formula to calculate the element present in second row, first column of the product matrix?(a) M1+M7(b) M1+M3(c) M2+M4 – M5 + M7(d) M2+M4The question was posed to me during an online interview.This key question is from Number Theory in portion Number Theory of Data Structures & Algorithms II |
|
Answer» The correct OPTION is (d) M2+M4 |
|
| 26. |
Who discussed techniques for reducing the memory requirements for Strassen’s algorithm?(a) Strassen(b) Lederman(c) Bailey(d) HighamI had been asked this question in examination.This interesting question is from Number Theory topic in division Number Theory of Data Structures & Algorithms II |
|
Answer» Right answer is (c) Bailey |
|
| 27. |
What is the recurrence relation used in Strassen’s algorithm?(a) 7T(n/2) + Theta(n^2)(b) 8T(n/2) + Theta(n^2)(c) 7T(n/2) + O(n^2)(d) 8T(n/2) + O(n^2)This question was addressed to me during an interview for a job.My enquiry is from Number Theory in division Number Theory of Data Structures & Algorithms II |
|
Answer» Right choice is (a) 7T(n/2) + Theta(n^2) |
|
| 28. |
Who demonstrated the difference in numerical stability?(a) Strassen(b) Bailey(c) Lederman(d) HighamThis question was addressed to me in a national level competition.I would like to ask this question from Number Theory in section Number Theory of Data Structures & Algorithms II |
|
Answer» The correct option is (d) Higham |
|
| 29. |
Running time of Strassen’s algorithm is better than the naïve Theta(n^3) method.(a) True(b) FalseI had been asked this question during an interview.Origin of the question is Number Theory topic in division Number Theory of Data Structures & Algorithms II |
|
Answer» Correct ANSWER is (a) True |
|
| 30. |
The number of scalar additions and subtractions used in Strassen’s matrix multiplication algorithm is ________(a) O(n^2.81)(b) Theta(n^2)(c) Theta(n)(d) O(n^3)This question was posed to me in semester exam.The origin of the question is Number Theory topic in portion Number Theory of Data Structures & Algorithms II |
|
Answer» Correct answer is (b) THETA(n^2) |
|
| 31. |
Strassen’s matrix multiplication algorithm follows ___________ technique.(a) Greedy technique(b) Dynamic Programming(c) Divide and Conquer(d) BacktrackingThe question was posed to me by my college professor while I was bunking the class.This interesting question is from Number Theory in division Number Theory of Data Structures & Algorithms II |
|
Answer» Right answer is (c) Divide and Conquer |
|
| 32. |
What is the running time of naïve matrix multiplication algorithm?(a) O(n^2.81)(b) O(n^4)(c) O(n)(d) O(n^3)I had been asked this question during an interview.I'd like to ask this question from Number Theory topic in portion Number Theory of Data Structures & Algorithms II |
|
Answer» Correct answer is (d) O(n^3) |
|
| 33. |
What is the running time of Strassen’s algorithm for matrix multiplication?(a) O(n^2.81)(b) O(n^3)(c) O(n^1.8)(d) O(n^2)I got this question during an interview.I want to ask this question from Number Theory in chapter Number Theory of Data Structures & Algorithms II |
|
Answer» Correct answer is (a) O(n^2.81) |
|
| 34. |
Strassen’s algorithm is a/an_____________ algorithm.(a) Non- recursive(b) Recursive(c) Approximation(d) AccurateI got this question during an interview.The question is from Number Theory in chapter Number Theory of Data Structures & Algorithms II |
|
Answer» CORRECT CHOICE is (b) Recursive The EXPLANATION is: Strassen’s Algorithm for MATRIX multiplication is a recursive algorithm since the present output depends on previous outputs and INPUTS. |
|
| 35. |
What is the GCD of 20 and 12 using Euclid’s algorithm?(a) 8(b) 2(c) 4(d) 6This question was addressed to me in final exam.The doubt is from Number Theory in portion Number Theory of Data Structures & Algorithms II |
|
Answer» The CORRECT ANSWER is (c) 4 |
|
| 36. |
What is the total running time of the binary GCD algorithm?(a) O(N)(b) O(N^2)(c) O(log N)(d) O(N log N)The question was asked during an online exam.Question is taken from Number Theory topic in chapter Number Theory of Data Structures & Algorithms II |
|
Answer» Right choice is (B) O(N^2) |
|
| 37. |
What is the formula for Euclidean algorithm?(a) GCD (m,n) = GCD (n, m mod n)(b) LCM(m,n)=LCM(n, m mod n)(c) GCD(m,n,o,p) = GCD (m, m mod n, o, p mod o)(d) LCM (m,n,o,p) = LCM (m, m mod n, o, p mod o)The question was asked in unit test.I'm obligated to ask this question of Number Theory topic in chapter Number Theory of Data Structures & Algorithms II |
|
Answer» The correct option is (a) GCD (m,n) = GCD (n, m MOD n) |
|
| 38. |
Euclidean algorithm does not require the calculation of prime factors.(a) True(b) FalseI had been asked this question during an internship interview.I'd like to ask this question from Number Theory in portion Number Theory of Data Structures & Algorithms II |
|
Answer» The correct choice is (a) True |
|
| 39. |
What is the total running time of Euclid’s algorithm?(a) O(N)(b) O(N log M)(c) O(N log N)(d) O(log N +1)I have been asked this question in an interview.My enquiry is from Number Theory in section Number Theory of Data Structures & Algorithms II |
|
Answer» The correct CHOICE is (a) O(N) |
|
| 40. |
If GCD of two numbers is 1, then the two numbers are said to be ________(a) Co-prime numbers(b) Prime numbers(c) Composite numbers(d) Rational numbersThis question was addressed to me in an interview for internship.My question is taken from Number Theory in section Number Theory of Data Structures & Algorithms II |
|
Answer» Right choice is (a) Co-prime numbers |
|
| 41. |
Which of the following is the correct mathematical application of Euclid’s algorithm?(a) Determination of prime numbers(b) Lagrange’s four square theorem(c) Cauchy-Euler theorem(d) Residue theoremI got this question in a job interview.This is a very interesting question from Number Theory in division Number Theory of Data Structures & Algorithms II |
|
Answer» The CORRECT choice is (b) Lagrange’s FOUR square theorem |
|
| 42. |
According to Gabriel lame, how many steps does Euclid’s algorithm require to solve a problem?(a) Less than five times the number of digits(b) More than five times the number of digits(c) Less than two times the number of digits(d) More than two times the number of digitsI got this question in unit test.My doubt stems from Number Theory in chapter Number Theory of Data Structures & Algorithms II |
|
Answer» Right option is (a) Less than five times the number of digits |
|
| 43. |
The Euclid’s algorithm runs efficiently if the remainder of two numbers is divided by the minimum of two numbers until the remainder is zero.(a) True(b) FalseI had been asked this question by my college director while I was bunking the class.The query is from Number Theory topic in portion Number Theory of Data Structures & Algorithms II |
|
Answer» Correct choice is (a) True |
|
| 44. |
Who invented Euclid’s algorithm?(a) Sieve(b) Euclid(c) Euclid-Sieve(d) Gabriel lameI have been asked this question during an online interview.I'd like to ask this question from Number Theory in section Number Theory of Data Structures & Algorithms II |
|
Answer» The correct choice is (b) Euclid |
|
| 45. |
Which of the following is not an application of Euclid’s algorithm?(a) Simplification of fractions(b) Performing divisions in modular arithmetic(c) Solving quadratic equations(d) Solving diophantine equationsThe question was posed to me during an online interview.This interesting question is from Number Theory topic in division Number Theory of Data Structures & Algorithms II |
|
Answer» Correct choice is (C) SOLVING quadratic equations |
|
| 46. |
If 4 is the GCD of 16 and 12, What is the GCD of 12 and 4?(a) 12(b) 6(c) 4(d) 2The question was asked in a job interview.Query is from Number Theory in portion Number Theory of Data Structures & Algorithms II |
|
Answer» The correct choice is (C) 4 |
|
| 47. |
Euclid’s algorithm is used for finding ___________(a) GCD of two numbers(b) GCD of more than three numbers(c) LCM of two numbers(d) LCM of more than two numbersI had been asked this question in a national level competition.This interesting question is from Number Theory topic in division Number Theory of Data Structures & Algorithms II |
|
Answer» The correct option is (a) GCD of TWO numbers |
|