Explore topic-wise InterviewSolutions in .

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.

The value of 12 mod 3 is?(a) 0(b) 1(c) 2(d) 3This question was addressed to me in an international level competition.This question is from Algorithms topic in chapter Algorithms of Discrete Mathematics

Answer»

The correct option is (a) 0

The best I can explain: By the DIVISION ALGORITHM 12 = 3(4) + 0. Where remainder is 12 mod 3.

2.

The quotient and remainder when -1 is divided by 3 is?(a) -1 and -1(b) -1 and 2(c) 1 and2(d) -1 and -2I got this question at a job interview.The doubt is from Algorithms in chapter Algorithms of Discrete Mathematics

Answer»

The correct ANSWER is (b) -1 and 2

To explain I WOULD say: According to the Division Algorithm -1 = 3(-1) + 2. Hence, QUOTIENT when -1 divided by 3 is -1 = -1 div 3 and remainder when -1 divided by 3 is 2 = -1 mod 3.

3.

The greatest common divisor of 414 and 662 is?(a) 4(b) 5(c) 2(d) 6I have been asked this question in a national level competition.My question comes from Integers and Algorithms topic in portion Algorithms of Discrete Mathematics

Answer»

Right CHOICE is (C) 2

The best EXPLANATION: By using EUCLID Lemma.

4.

The hexadecimal expansion of (177130)10 is ___________(a) (2B3EB)16(b) (2B3EA)16(c) (2C3AA)16(d) (2B2AA)16This question was addressed to me during an interview for a job.I need to ask this question from Integers and Algorithms topic in division Algorithms of Discrete Mathematics

Answer»

The correct CHOICE is (B) (2B3EA)16

Easy EXPLANATION: SUCCESSIVELY DIVIDE 177130 by 16 to obtain remainder they are (2B3EA)16.

5.

The value of 15 mod 11 is?(a) 1(b) 2(c) 3(d) 4I had been asked this question in exam.My question comes from Algorithms topic in section Algorithms of Discrete Mathematics

Answer»

Right choice is (d) 4

For EXPLANATION: By the Division algorithm 15 = 11(1) + 4. Where the REMAINDER is 15 mod 11.

6.

The quotient and remainder when 18 is divided by 5 is?(a) 2 and 3(b) 1 and 2(c) 3 and 2(d) 3 and 3I got this question in homework.Query is from Algorithms in division Algorithms of Discrete Mathematics

Answer»

The CORRECT answer is (d) 3 and 3

The EXPLANATION is: According to the DIVISION Algorithm 18 = 5(3) + 3. Hence, quotient when 18 divided by 5 is 3 = 18 div 5 and remainder when 18 divided by 5 is 3 = 18 mod 5.

7.

If a|b and a|c, then?(a) a|bc(b) c|a(c) a|(b+c)(d) b|aI got this question in homework.This interesting question is from Algorithms topic in division Algorithms of Discrete Mathematics

Answer»

Right option is (C) a|(B+c)

To EXPLAIN: If a|b and a|c then b = am and c = an for some integer m and N. HENCE, b + c = a(m + n). Therefore, a|(b+c).

8.

Is 102 congruent to 6 modulo 16.(a) True(b) FalseI have been asked this question by my college director while I was bunking the class.The doubt is from Algorithms topic in chapter Algorithms of Discrete Mathematics

Answer»
9.

Is 17 congruent to 4 modulo 6.(a) True(b) FalseThe question was posed to me during an online interview.I want to ask this question from Algorithms in portion Algorithms of Discrete Mathematics

Answer»

Right OPTION is (b) False

The BEST I can EXPLAIN: 6 does not divide 17 – 4 = 13.

10.

The value of 155 mod 9 is?(a) 0(b) 1(c) 2(d) 3This question was posed to me in quiz.This interesting question is from Algorithms topic in portion Algorithms of Discrete Mathematics

Answer»

The CORRECT choice is (c) 2

For explanation: By the DIVISION algorithm 155 = 9(17) + 2. Where remainder is 155 mod 9.

11.

The remainder when 111 is divided by 12 is?(a) 0(b) 1(c) 2(d) 3The question was asked during an online exam.The origin of the question is Algorithms in section Algorithms of Discrete Mathematics

Answer»

Right answer is (d) 3

The BEST explanation: According to the Division ALGORITHM 111 = 12(9) + 3. Hence, REMAINDER when 111 divided by 12 is 3 = 111 MOD 12.

12.

The quotient when 19 is divided by 6 is?(a) 1(b) 2(c) 3(d) 0The question was posed to me in unit test.Query is from Algorithms topic in division Algorithms of Discrete Mathematics

Answer»

Right ANSWER is (C) 3

Best EXPLANATION: According to the DIVISION Algorithm 19 = 6(3) + 1. Hence, quotient when 19 divided by 6 is 3 = 19 div 6.

13.

The decimal expansion of (2AE0B)16 is?(a) (175627)10(b) (175624)10(c) (178566)10(d) (175622)10The question was posed to me in homework.I want to ask this question from Integers and Algorithms in chapter Algorithms of Discrete Mathematics

Answer»

Right answer is (a) (175627)10

For explanation: (2AE0B)16 = 2*164 + 10*163 + 14*162 + 0*16+11 = (175627)10.

14.

The greatest common divisor of 7 and 5 is?(a) 1(b) 2(c) 5(d) 7I got this question in an interview for internship.My question comes from Integers and Algorithms topic in section Algorithms of Discrete Mathematics

Answer»

Correct answer is (a) 1

The best explanation: TWO numbers 7 and 5 are relatively PRIME, so GCD(7, 5) = 1.

15.

The greatest common divisor of 12 and 18 is?(a) 2(b) 3(c) 4(d) 6I got this question during a job interview.The question is from Integers and Algorithms in section Algorithms of Discrete Mathematics

Answer»

Right choice is (d) 6

Easy EXPLANATION: By using EUCLID Lemma, 6 DIVIDES 12 and 18.

16.

The octal expansion of (10 1011 1011)2 is ___________(a) (1245)8(b) (1276)8(c) (1275)8(d) (1273)8I have been asked this question during an interview.This intriguing question comes from Integers and Algorithms in chapter Algorithms of Discrete Mathematics

Answer»

The correct OPTION is (d) (1273)8

The best I can explain: (10 1011 1011)2 = (699)10. USING BASE CONVERSION algorithm, (699)10 = (1273)8.

17.

The hexadecimal notation of (1011 0111 1011)2 is ___________(a) (B2B)16(b) (B5B)16(c) (B7B)16(d) (A7B)16I got this question in an online interview.The query is from Integers and Algorithms topic in chapter Algorithms of Discrete Mathematics

Answer» CORRECT option is (c) (B7B)16

The best I can explain: (1011)2 = 11 and (0111)2 = 7, 11 in hexadecimal notation REPRESENTS B. So it is (B7B)16.
18.

The binary notation of ABBA is ___________(a) 1010 1011 1011 1010(b) 1010 1001 1011 1011(c) 1011 1000 1010 1001(d) 1001 1000 1000 1111The question was posed to me during an online interview.My doubt stems from Integers and Algorithms in portion Algorithms of Discrete Mathematics

Answer» RIGHT choice is (a) 1010 1011 1011 1010

To ELABORATE: By the base CONVERSION ALGORITHM.
19.

The decimal notation of 101010101 is ___________(a) 34010(b) 34110(c) 34210(d) 31510The question was asked in an online interview.My question comes from Integers and Algorithms topic in section Algorithms of Discrete Mathematics

Answer»

The CORRECT ANSWER is (B) 34110

The best I can explain: (101010101)2 = 1*2^0 + 1*2^2 + 1*2^4 + 1*2^6 + 1*2^8 = 341.

20.

The binary notation of 231 is ___________(a) (11010111)2(b) (10111011)2(c) (11100011)2(d) (11100111)2The question was asked by my college director while I was bunking the class.This intriguing question comes from Integers and Algorithms in division Algorithms of Discrete Mathematics

Answer»

Right choice is (d) (11100111)2

To elaborate: By BINARY Expansion of 11100111 is 1*2^0 + 1*2^1 + 1*2^2 + 1*2^5 + 1*2^6 + 1*2^7 is EQUAL to 231.

21.

The time complexity of the linear search is given by ___________(a) O(log2n)(b) O(1)(c) exponential(d) none of the mentionedI have been asked this question in semester exam.The query is from Algorithms topic in portion Algorithms of Discrete Mathematics

Answer»

The correct ANSWER is (d) none of the mentioned

To ELABORATE: It is O(n), THEREFORE COMPLEXITY will be linear.

22.

Time complexity of the binary search algorithm is constant.(a) True(b) FalseThe question was asked in an international level competition.My doubt is from Algorithms topic in portion Algorithms of Discrete Mathematics

Answer» CORRECT OPTION is (b) False

For EXPLANATION I WOULD say: It is O(log2n), therefore COMPLEXITY will be logarithmic.
23.

Which algorithm is better for sorting between bubble sort and quicksort?(a) bubble sort(b) quick sort(c) both are equally good(d) none of the mentionedThe question was asked by my school principal while I was bunking the class.My question comes from Algorithms in chapter Algorithms of Discrete Mathematics

Answer»

The CORRECT option is (B) quick SORT

Explanation: RUNNING time of quicksort is logarithmic whereas for bubble sort it is quadratic.

24.

The time complexity of binary search is given by ___________(a) constant(b) quardratic(c) exponential(d) none of the mentionedI got this question by my school principal while I was bunking the class.Question is taken from Algorithms in division Algorithms of Discrete Mathematics

Answer»

Right choice is (d) NONE of the mentioned

For explanation I WOULD say: It is O(log2n), therefore COMPLEXITY will be LOGARITHMIC.

25.

If for an algorithm time complexity is given by O((^3⁄2)^n) then complexity will be ___________(a) constant(b) quardratic(c) exponential(d) none of the mentionedI have been asked this question in exam.My question is from Algorithms topic in portion Algorithms of Discrete Mathematics

Answer»

The CORRECT option is (c) EXPONENTIAL

Easiest explanation: The GROWTH RATE of that function will be exponential therefore COMPLEXITY will be exponential.

26.

If for an algorithm time complexity is given by O(n^2) then complexity will ___________(a) constant(b) quadratic(c) exponential(d) none of the mentionedI got this question in unit test.My question is based upon Algorithms topic in chapter Algorithms of Discrete Mathematics

Answer»
27.

If for an algorithm time complexity is given by O(n) then the complexity of it is ___________(a) constant(b) linear(c) exponential(d) none of the mentionedThis question was addressed to me by my college professor while I was bunking the class.Enquiry is from Algorithms topic in division Algorithms of Discrete Mathematics

Answer»

Correct OPTION is (B) linear

Explanation: The GROWTH rate of that FUNCTION will be linear.

28.

If for an algorithm time complexity is given by O(log2n) then complexity will be ___________(a) constant(b) polynomial(c) exponential(d) none of the mentionedThis question was addressed to me during an interview.I need to ask this question from Algorithms in section Algorithms of Discrete Mathematics

Answer» RIGHT choice is (d) none of the mentioned

The explanation is: The GROWTH RATE of that function will be LOGARITHMIC THEREFORE complexity will be logarithmic.
29.

If for an algorithm time complexity is given by O(1) then the complexity of it is ____________(a) constant(b) polynomial(c) exponential(d) none of the mentionedThe question was asked in semester exam.My query is from Algorithms in portion Algorithms of Discrete Mathematics

Answer»
30.

Which is used to measure the Time complexity of an algorithm Big O notation?(a) describes limiting behaviour of the function(b) characterises a function based on growth of function(c) upper bound on growth rate of the function(d) all of the mentionedThis question was posed to me in an interview.My doubt is from Algorithms topic in chapter Algorithms of Discrete Mathematics

Answer»

Correct option is (d) all of the mentioned

To explain I WOULD say: BIG O notation describes LIMITING behaviour, and also gives UPPER bound on growth RATE of a function.

31.

The worst case complexity of quick sort is _________(a) O(n)(b) O(log n)(c) O(n^2)(d) O(n log n)The question was asked in class test.This is a very interesting question from Algorithms topic in chapter Algorithms of Discrete Mathematics

Answer» RIGHT choice is (c) O(n^2)

For EXPLANATION: The worst CASE COMPLEXITY of QUICK sort is O(n^2).
32.

The complexity of Fibonacci series is _________(a) O(2^n)(b) O(log n)(c) O(n^2)(d) O(n log n)I have been asked this question in an interview for job.I need to ask this question from Algorithms topic in division Algorithms of Discrete Mathematics

Answer»

Right choice is (a) O(2^N)

For EXPLANATION: Fibonacci is f(n) = f(n-1) + f(n-2), f(0) = 0, f(1) = 1. LET g(n) = 2^n. Now prove inductively that f(n) > = g(n).

33.

The worst case occurs in quick sort when _________(a) Pivot is the median of the array(b) Pivot is the smallest element(c) Pivot is the middle element(d) None of the mentionedThe question was asked in class test.My question is taken from Algorithms topic in division Algorithms of Discrete Mathematics

Answer»

Right ANSWER is (B) PIVOT is the smallest ELEMENT

To ELABORATE: This happens when the pivot is the smallest (or the largest) element. Then one of the partitions is empty, and we repeat recursively the procedure for N-1 elements.

34.

The worst case complexity for insertion sort is _________(a) O(n)(b) O(log n)(c) O(n^2)(d) O(n log n)The question was posed to me in a national level competition.My question is taken from Algorithms topic in section Algorithms of Discrete Mathematics

Answer»

Correct CHOICE is (c) O(n^2)

Explanation: In worst CASE NTH comparison are required to insert the nth element into correct POSITION.

35.

The Worst case occur in linear search algorithm when _________(a) Item is somewhere in the middle of the array(b) Item is not in the array at all(c) Item is the last element in the array(d) Item is the last element in the array or is not there at allThis question was posed to me in my homework.Origin of the question is Algorithms in chapter Algorithms of Discrete Mathematics

Answer»

Correct OPTION is (d) Item is the last ELEMENT in the array or is not there at all

To explain I would SAY: The Worst CASE occur in linear SEARCH algorithm when Item is the last element in the array or is not there at all.

36.

The complexity of merge sort algorithm is _________(a) O(n)(b) O(log n)(c) O(n^2)(d) O(n log n)I have been asked this question in an internship interview.I need to ask this question from Algorithms in chapter Algorithms of Discrete Mathematics

Answer»

The correct option is (d) O(N log n)

EASIEST explanation: The worst case COMPLEXITY for MERGE sort is O(NLOGN).

37.

The complexity of Binary search algorithm is _________(a) O(n)(b) O(log)(c) O(n^2)(d) O(n log n)This question was addressed to me during an interview.This interesting question is from Algorithms topic in chapter Algorithms of Discrete Mathematics

Answer» CORRECT answer is (B) O(log)

To EXPLAIN: The compexity of binary search is O(LOGN).
38.

The complexity of linear search algorithm is _________(a) O(n)(b) O(log n)(c) O(n^2)(d) O(n log n)The question was posed to me in a national level competition.This is a very interesting question from Algorithms topic in chapter Algorithms of Discrete Mathematics

Answer» CORRECT answer is (a) O(N)

BEST explanation: The worst case complexity of linear SEARCH is O(n).
39.

There are two algorithms suppose A takes 1.41 milli seconds while B takes 0.9 milliseconds, which one of them is better considering all other things the same?(a) A is better than B(b) B is better than A(c) Both are equally good(d) None of the mentionedI had been asked this question during an online exam.This question is from Algorithms topic in division Algorithms of Discrete Mathematics

Answer»

Right answer is (B) B is better than A

For explanation: B TAKES less TIME than A for the same task.

40.

Which of the following case does not exist in complexity theory?(a) Best case(b) Worst case(c) Average case(d) Null caseThis question was posed to me by my college director while I was bunking the class.My doubt stems from Algorithms topic in division Algorithms of Discrete Mathematics

Answer»

The CORRECT OPTION is (d) NULL case

The explanation is: Null case does not EXIST in complexity Theory.

41.

An algorithm: can be represented through _________(a) flow charts(b) pseudo codes(c) instructions in common language(d) all of the mentionedThe question was posed to me in a job interview.This intriguing question comes from Algorithms in chapter Algorithms of Discrete Mathematics

Answer»

The correct answer is (d) all of the mentioned

The explanation is: ALGORITHM is REPRESENTED through pseudo codes, normal language SENTENCES or FLOW charts.

42.

For an algorithm which is the most important characteristic that makes it acceptable _________(a) Fast(b) Compact(c) Correctness and Precision(d) None of the mentionedThis question was posed to me by my school principal while I was bunking the class.I want to ask this question from Algorithms topic in portion Algorithms of Discrete Mathematics

Answer»

Right answer is (C) CORRECTNESS and Precision

Best EXPLANATION: An algorithm should be correct otherwise it’s of no USE even if it is FAST and compact.

43.

Optimization of algorithm means _________(a) making that algorithm fast by time and compact by space(b) making that algorithm slow by time and large by space(c) making that algorithm fast by time and large by space(d) making that algorithm slow by time and compact by spaceThis question was addressed to me during an internship interview.I need to ask this question from Algorithms in chapter Algorithms of Discrete Mathematics

Answer»

The correct CHOICE is (a) MAKING that algorithm fast by time and COMPACT by space

To ELABORATE: An Algorithm should be fast and compact.

44.

For a recursive algorithm _________(a) a base case is necessary and is solved without recursion.(b) a base case is not necessary(c) doesnot solve a base case directly(d) none of the mentionedThis question was posed to me in an interview.My query is from Algorithms in portion Algorithms of Discrete Mathematics

Answer»
45.

An algorithm which tries all the possibilities unless results are satisfactory is and generally is time-consuming is _________(a) Brute Force(b) Divide and Conquer(c) Dynamic programming algorithms(d) None of the mentionedI had been asked this question in class test.The question is from Algorithms topic in chapter Algorithms of Discrete Mathematics

Answer» RIGHT CHOICE is (a) BRUTE Force

Best explanation: In Brute force, all the POSSIBILITIES are TRIED.
46.

An algorithm in which we divide the problem into subproblem and then we combine the subsolutions to form solution to the original problem is known as _________(a) Brute Force(b) Divide and Conquer(c) GreedyAlgorithm(d) None of the mentionedThis question was addressed to me during a job interview.My doubt stems from Algorithms in portion Algorithms of Discrete Mathematics

Answer»

Right answer is (b) DIVIDE and CONQUER

Easiest explanation: In Divide and Conquer we divide the PROBLEM and then recombine the SOLUTION.

47.

A Complexity of algorithm depends upon _________(a) Time only(b) Space only(c) Both Time and Space(d) None of the mentionedThe question was posed to me during an online exam.Asked question is from Algorithms topic in chapter Algorithms of Discrete Mathematics

Answer»

The CORRECT answer is (C) Both Time and SPACE

To explain: For COMPLEXITY, we calculate both time and space consumed.

48.

An algorithm which uses the past results and uses them to find the new results is _________(a) Brute Force(b) Divide and Conquer(c) Dynamic programming algorithms(d) None of the mentionedI got this question in examination.My question is taken from Algorithms in portion Algorithms of Discrete Mathematics

Answer»

The correct choice is (C) DYNAMIC programming ALGORITHMS

Explanation: In Dynamic programming algorithms we utilize PREVIOUS results for new ones.

49.

An Algorithm is ___________(a) A procedure for solving a problem(b) A problem(c) A real life mathematical problem(d) None of the mentionedThis question was posed to me by my college director while I was bunking the class.Question is taken from Algorithms in division Algorithms of Discrete Mathematics

Answer» RIGHT choice is (a) A procedure for SOLVING a problem

To explain: An algorithm is a STEPWISE solution to the problem.
50.

The complexity of Bubble sort algorithm is _________(a) O(n)(b) O(log n)(c) O(n^2)(d) O(n log n)I have been asked this question by my school teacher while I was bunking the class.I'd like to ask this question from Algorithms in section Algorithms of Discrete Mathematics

Answer»

Correct option is (C) O(n^2)

To EXPLAIN: The COMPLEXITY of Bubble SORT algorithm is O(n^2).