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.

What is the worst case time complexity of dynamic programming solution of set partition problem(sum=sum of set elements)?(a) O(n)(b) O(sum)(c) O(n^2)(d) O(sum*n)The question was posed to me in an interview.This intriguing question originated from Checksum, Complexity Classes & NP Complete Problems in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Right choice is (d) O(sum*n)

To explain: Set partition problem has both recursive as WELL as dynamic PROGRAMMING SOLUTION. The dynamic programming solution has a time complexity of O(n*sum) as it as a NESTED loop with limits from 1 to n and 1 to sum RESPECTIVELY.

2.

Which of the following is true about the time complexity of the recursive solution of set partition problem?(a) It has an exponential time complexity(b) It has a linear time complexity(c) It has a logarithmic time complexity(d) it has a time complexity of O(n2)This question was posed to me by my school teacher while I was bunking the class.The above asked question is from Checksum, Complexity Classes & NP Complete Problems topic in section Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The CORRECT choice is (a) It has an EXPONENTIAL time complexity

The explanation is: Set partition PROBLEM has both recursive as WELL as dynamic programming solution. The recursive solution has an exponential time complexity as it will require to check for all subsets in the WORST case.

3.

What is the set partition problem?(a) finding a subset of a set that has sum of elements equal to a given number(b) checking for the presence of a subset that has sum of elements equal to a given number(c) checking whether the set can be divided into two subsets of with equal sum of elements and printing true or false based on the result(d) finding subsets with equal sum of elementsThis question was posed to me in homework.The query is from Checksum, Complexity Classes & NP Complete Problems topic in section Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The correct option is (c) checking whether the set can be DIVIDED into two SUBSETS of with equal sum of elements and printing true or false based on the result

Explanation: In set partition problem we check whether a set can be divided into 2 subsets such that the sum of elements in each SUBSET is equal. If such subsets are present then we print true OTHERWISE false.

4.

What is meant by the power set of a set?(a) subset of all sets(b) set of all subsets(c) set of particular subsets(d) an empty setThis question was addressed to me during an online interview.The doubt is from Checksum, Complexity Classes & NP Complete Problems topic in portion Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The correct ANSWER is (B) set of all subsets

Easiest explanation - Power set of a set is defined as the set of all subsets. Ex- if there is a set S={1,3} then power set of set S will be P={{},{1},{3}{1,3}}.

5.

Which of the following is true about the time complexity of the recursive solution of the subset sum problem?(a) It has an exponential time complexity(b) It has a linear time complexity(c) It has a logarithmic time complexity(d) it has a time complexity of O(n2)The question was posed to me in examination.The query is from Checksum, Complexity Classes & NP Complete Problems topic in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer» CORRECT option is (a) It has an exponential TIME complexity

Easiest explanation - Subset sum problem has both recursive as well as DYNAMIC PROGRAMMING solution. The recursive solution has an exponential time complexity as it will require to check for all subsets in WORST case.
6.

What is a subset sum problem?(a) finding a subset of a set that has sum of elements equal to a given number(b) checking for the presence of a subset that has sum of elements equal to a given number and printing true or false based on the result(c) finding the sum of elements present in a set(d) finding the sum of all the subsets of a setThis question was posed to me by my college professor while I was bunking the class.The origin of the question is Checksum, Complexity Classes & NP Complete Problems topic in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The correct option is (b) checking for the presence of a subset that has sum of elements equal to a given number and printing TRUE or false based on the result

Best EXPLANATION: In subset sum problem CHECK for the presence of a subset that has sum of elements equal to a given number. If such a subset is PRESENT then we print true otherwise false.

7.

Under what condition any set A will be a subset of B?(a) if all elements of set B are also present in set A(b) if all elements of set A are also present in set B(c) if A contains more elements than B(d) if B contains more elements than AThis question was posed to me in an international level competition.The doubt is from Checksum, Complexity Classes & NP Complete Problems in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Right OPTION is (b) if all elements of SET A are also present in set B

Easy EXPLANATION - Any set A will be called a subset of set B if all elements of set A are also present in set B. So in such a case set A will be a PART of set B.

8.

How many Hamiltonian paths does the following graph have?(a) 1(b) 2(c) 0(d) 3I had been asked this question in class test.Enquiry is from Checksum, Complexity Classes & NP Complete Problems topic in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The correct OPTION is (c) 0

The BEST I can explain: The above graph has no Hamiltonian PATHS. That is, we cannot traverse the graph with meeting VERTICES EXACTLY once.

9.

How many Hamiltonian paths does the following graph have?(a) 1(b) 2(c) 3(d) 4The question was posed to me in my homework.My doubt is from Checksum, Complexity Classes & NP Complete Problems in section Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The correct CHOICE is (a) 1

Explanation: The above GRAPH has only ONE Hamiltonian PATH that is from a-b-c-d-e.

10.

What is the time complexity for finding a Hamiltonian path for a graph having N vertices (using permutation)?(a) O(N!)(b) O(N! * N)(c) O(log N)(d) O(N)This question was addressed to me during an interview.My question is taken from Checksum, Complexity Classes & NP Complete Problems in section Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer» RIGHT choice is (b) O(N! * N)

To explain: For a graph having N vertices TRAVERSE the PERMUTATIONS in N! iterations and it traverses the permutations to SEE if adjacent vertices are connected or not takes N iterations (i.e.) O(N! * N).
11.

For a graph of degree three, in what time can a Hamiltonian path be found?(a) O(0.251^n)(b) O(0.401^n)(c) O(0.167^n)(d) O(0.151^n)This question was posed to me in quiz.This interesting question is from Checksum, Complexity Classes & NP Complete Problems in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The correct answer is (a) O(0.251^n)

Easy explanation - For a GRAPH of maximum degree THREE, a HAMILTONIAN path can be FOUND in TIME O(0.251^n).

12.

Who invented the inclusion-exclusion principle to solve the Hamiltonian path problem?(a) Karp(b) Leonard Adleman(c) Andreas Bjorklund(d) MartelloI had been asked this question during an interview.This question is from Checksum, Complexity Classes & NP Complete Problems in chapter Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Correct option is (c) Andreas Bjorklund

The BEST I can explain: Andreas Bjorklund CAME up with the inclusion-exclusion PRINCIPLE to reduce the counting of number of HAMILTONIAN CYCLES.

13.

In graphs, in which all vertices have an odd degree, the number of Hamiltonian cycles through any fixed edge is always even.(a) true(b) falseThis question was posed to me in an online quiz.The origin of the question is Checksum, Complexity Classes & NP Complete Problems in portion Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Right option is (a) true

Explanation: According to a handshaking lemma, in graphs, in which all VERTICES have an ODD DEGREE, the number of Hamiltonian CYCLES through any fixed edge is ALWAYS even.

14.

In what time can the Hamiltonian path problem can be solved using dynamic programming?(a) O(N)(b) O(N log N)(c) O(N^2)(d) O(N^2 2^N)The question was posed to me in an international level competition.My enquiry is from Checksum, Complexity Classes & NP Complete Problems in section Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Correct option is (d) O(N^2 2^N)

The best explanation: USING DYNAMIC programming, the TIME taken to solve the Hamiltonian path PROBLEM is mathematically FOUND to be O(N^2 2^N).

15.

Who formulated the first ever algorithm for solving the Hamiltonian path problem?(a) Martello(b) Monte Carlo(c) Leonard(d) BellmanI had been asked this question in an interview for internship.The query is from Checksum, Complexity Classes & NP Complete Problems topic in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The correct choice is (a) Martello

For EXPLANATION: The FIRST EVER problem to solve the HAMILTONIAN path was the enumerative algorithm formulated by Martello.

16.

Which of the following problems is similar to that of a Hamiltonian path problem?(a) knapsack problem(b) closest pair problem(c) travelling salesman problem(d) assignment problemI had been asked this question by my college professor while I was bunking the class.My question is based upon Checksum, Complexity Classes & NP Complete Problems topic in portion Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer» CORRECT option is (c) travelling salesman problem

Easy explanation - HAMILTONIAN PATH problem is SIMILAR to that of a travelling salesman problem since both the problem traverses all the NODES in a graph exactly once.
17.

There is no existing relationship between a Hamiltonian path problem and Hamiltonian circuit problem.(a) true(b) falseThe question was asked during an interview.Origin of the question is Checksum, Complexity Classes & NP Complete Problems in section Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Right CHOICE is (b) false

Easy explanation - There is a relationship between HAMILTONIAN PATH PROBLEM and Hamiltonian circuit problem. The Hamiltonian path in graph G is EQUAL to Hamiltonian cycle in graph H under certain conditions.

18.

Hamiltonian path problem is _________(a) NP problem(b) N class problem(c) P class problem(d) NP complete problemI got this question in a national level competition.My question is taken from Checksum, Complexity Classes & NP Complete Problems topic in portion Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer» CORRECT CHOICE is (d) NP complete problem

The EXPLANATION is: HAMILTONIAN path problem is found to be NP complete. Hamiltonian cycle problem is ALSO an NP- complete problem.
19.

The problem of finding a path in a graph that visits every vertex exactly once is called?(a) Hamiltonian path problem(b) Hamiltonian cycle problem(c) Subset sum problem(d) Turnpike reconstruction problemThe question was asked in a national level competition.This interesting question is from Checksum, Complexity Classes & NP Complete Problems topic in section Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer» RIGHT answer is (a) HAMILTONIAN path problem

To explain: Hamiltonian path problem is a problem of finding a path in a GRAPH that visits every node exactly once whereas Hamiltonian CYCLE problem is finding a cycle in a graph.
20.

Which of the following algorithm can be used to solve the Hamiltonian path problem efficiently?(a) branch and bound(b) iterative improvement(c) divide and conquer(d) greedy algorithmThe question was posed to me in exam.The doubt is from Checksum, Complexity Classes & NP Complete Problems topic in chapter Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Correct answer is (a) branch and BOUND

For EXPLANATION: The Hamiltonian path problem can be SOLVED EFFICIENTLY USING branch and bound approach. It can also be solved using a backtracking approach.

21.

The choice of polynomial class has led to the development of an extensive theory called ________(a) computational complexity(b) time complexity(c) problem complexity(d) decision complexityI have been asked this question during an interview.My question is taken from Checksum, Complexity Classes & NP Complete Problems topic in portion Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Right CHOICE is (a) computational complexity

Easiest explanation - An extensive theory called computational complexity seeks to CLASSIFY problems according to their INHERENT difficulty.

22.

Which of the following problems is not NP complete?(a) Hamiltonian circuit(b) Bin packing(c) Partition problem(d) Halting problemThe question was posed to me during an interview for a job.I'd like to ask this question from Checksum, Complexity Classes & NP Complete Problems in portion Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The correct CHOICE is (d) HALTING problem

Easy EXPLANATION - HAMILTONIAN CIRCUIT, bin packing, partition problems are NP complete problems. Halting problem is an undecidable problem.

23.

How many steps are required to prove that a decision problem is NP complete?(a) 1(b) 2(c) 3(d) 4The question was asked by my college director while I was bunking the class.My question is taken from Checksum, Complexity Classes & NP Complete Problems in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Right OPTION is (b) 2

Easiest EXPLANATION - FIRST, the problem should be NP. Next, it should be PROVED that every problem in NP is reducible to the problem in question in polynomial time.

24.

To which of the following class does a CNF-satisfiability problem belong?(a) NP class(b) P class(c) NP complete(d) NP hardI have been asked this question in an internship interview.Question is taken from Checksum, Complexity Classes & NP Complete Problems topic in portion Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Correct choice is (c) NP complete

The best EXPLANATION: The CNF SATISFIABILITY PROBLEM belongs to NP complete class. It deals with BOOLEAN expressions.

25.

How many conditions have to be met if an NP- complete problem is polynomially reducible?(a) 1(b) 2(c) 3(d) 4I had been asked this question by my college professor while I was bunking the class.My query is from Checksum, Complexity Classes & NP Complete Problems topic in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The correct choice is (b) 2

To explain: A function t that maps all yes INSTANCES of decision problems D1 and D2 and t should be COMPUTED in polynomial time are the TWO conditions.

26.

A non-deterministic algorithm is said to be non-deterministic polynomial if the time-efficiency of its verification stage is polynomial.(a) true(b) falseI had been asked this question in an interview for internship.My question is taken from Checksum, Complexity Classes & NP Complete Problems topic in chapter Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The correct choice is (a) true

Easy explanation - One of the PROPERTIES of NP class problems STATES that A non-deterministic algorithm is said to be non-deterministic POLYNOMIAL if the time-efficiency of its verification STAGE is polynomial.

27.

How many stages of procedure does a non-deterministic algorithm consist of?(a) 1(b) 2(c) 3(d) 4This question was addressed to me in my homework.My enquiry is from Checksum, Complexity Classes & NP Complete Problems topic in portion Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Correct option is (B) 2

The best I can explain: A non-deterministic ALGORITHM is a two-STAGE procedure- guessing stage and VERIFICATION stage.

28.

Halting problem is an example for?(a) decidable problem(b) undecidable problem(c) complete problem(d) trackable problemI had been asked this question in exam.My enquiry is from Checksum, Complexity Classes & NP Complete Problems topic in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Correct OPTION is (b) UNDECIDABLE problem

Easiest explanation - HALTING problem by Alan Turing cannot be solved by any ALGORITHM. HENCE, it is undecidable.

29.

To which class does the Euler’s circuit problem belong?(a) P class(b) NP class(c) Partition class(d) Complete classI had been asked this question in an interview for job.I'm obligated to ask this question of Checksum, Complexity Classes & NP Complete Problems in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer» RIGHT choice is (a) P class

For explanation: EULER’s circuit problem can be SOLVED in polynomial time. It can be solved in O(N^2).
30.

The Euler’s circuit problem can be solved in?(a) O(N)(b) O( N log N)(c) O(log N)(d) O(N^2)I have been asked this question in an interview for job.I'd like to ask this question from Checksum, Complexity Classes & NP Complete Problems in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The correct CHOICE is (d) O(N^2)

Easiest explanation - Mathematically, the run time of EULER’s circuit PROBLEM is DETERMINED to be O(N^2).

31.

Problems that cannot be solved by any algorithm are called?(a) tractable problems(b) intractable problems(c) undecidable problems(d) decidable problemsThe question was asked during an online interview.I want to ask this question from Checksum, Complexity Classes & NP Complete Problems topic in portion Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Right ANSWER is (C) UNDECIDABLE problems

The explanation is: Problems cannot be solved by any ALGORITHM are called undecidable problems. Problems that can be solved in polynomial TIME are called Tractable problems.

32.

_________ is the class of decision problems that can be solved by non-deterministic polynomial algorithms.(a) NP(b) P(c) Hard(d) CompleteI had been asked this question during an online interview.I'd like to ask this question from Checksum, Complexity Classes & NP Complete Problems in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Right answer is (a) NP

The BEST I can explain: NPproblems are CALLED as non-deterministic polynomial problems. They are a class of DECISION problems that can be SOLVED using NP ALGORITHMS.

33.

The sum and composition of two polynomials are always polynomials.(a) true(b) falseI had been asked this question in an interview.The origin of the question is Checksum, Complexity Classes & NP Complete Problems topic in portion Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Correct option is (a) true

The best EXPLANATION: ONE of the properties of POLYNOMIAL FUNCTIONS states that the sum and composition of two polynomials are always polynomials.

34.

Problems that can be solved in polynomial time are known as?(a) intractable(b) tractable(c) decision(d) completeThe question was asked during an internship interview.The doubt is from Checksum, Complexity Classes & NP Complete Problems topic in portion Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The correct answer is (b) tractable

The best I can explain: Problems that can be SOLVED in POLYNOMIAL TIME are known as tractable. Problems that cannot be solved in polynomial time are INTRACTABLE.

35.

The worst-case efficiency of solving a problem in polynomial time is?(a) O(p(n))(b) O(p( n log n))(c) O(p(n^2))(d) O(p(m log n))I had been asked this question by my college director while I was bunking the class.Asked question is from Checksum, Complexity Classes & NP Complete Problems in chapter Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer» CORRECT answer is (a) O(p(n))

The EXPLANATION is: The worst-case EFFICIENCY of solving an PROBLEM in polynomial TIME is O(p(n)) where p(n) is the polynomial time of input size.
36.

What is the rate of the hamming code of parity bit m=8?(a) 0.94(b) 0.92(c) 0.90(d) 0.97The question was posed to me by my school principal while I was bunking the class.My question comes from Checksum, Complexity Classes & NP Complete Problems in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The CORRECT choice is (d) 0.97

Explanation: For a hamming code of PARITY BIT 8, total BITS = 255 and data bits = 247. Rate= data bits/ total bits

= 247/255 = 0.969 = 0.97.

37.

For a hamming code of parity bit m=8, what is the total bits and data bits?(a) (255, 247)(b) (127, 119)(c) (31, 26)(d) (0, 8)This question was addressed to me in quiz.Query is from Checksum, Complexity Classes & NP Complete Problems topic in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The correct OPTION is (a) (255, 247)

EXPLANATION: Total BITS are COMPUTED as, 2^m-1 = 2^8-1 =255.

Data bits are computed as 2^m-m-1= 2^8-8-1= 247.

38.

What is the code rate of a repetition Hamming code (3, 1)?(a) 1(b) 3(c) 1/3(d) 1.3I got this question in an interview.This interesting question is from Checksum, Complexity Classes & NP Complete Problems topic in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Right choice is (C) 1/3

Easy explanation - The CODE rate of a REPETITION hamming code is the second number divided by the first number. Here, it is 1/3.

39.

An Extended hamming code is also called as __________(a) SEDDEC(b) SEDDED(c) SECDED(d) SECDECI got this question by my college director while I was bunking the class.Query is from Checksum, Complexity Classes & NP Complete Problems in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer» RIGHT option is (c) SECDED

The best I can explain: An Extended Hamming code is also called as SECDED (Single ERROR Correction DOUBLE Error Detection). The most popular codes are (72, 64) code and (127,120) code.
40.

________ is the mechanism of sending data bits multiple times to ensure consistency.(a) Repetition(b) Duplication(c) Mirroring(d) RedundancyThe question was posed to me in a national level competition.My doubt is from Checksum, Complexity Classes & NP Complete Problems in section Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Correct option is (a) REPETITION

The best I can EXPLAIN: Repeating data BITS multiple times is done to ensure consistency. If the data bit to be sent is a 1, a n=3 repetition code will send 111. If the bits are not the same, an ERROR has occurred.

41.

Including a parity bit along with the data surely detects the errors.(a) true(b) falseThis question was posed to me in a job interview.My enquiry is from Checksum, Complexity Classes & NP Complete Problems in portion Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Correct ANSWER is (B) false

The explanation is: If error has occurred in a DATA string, PARITY will change inorder to indicate errors. However, if the error occurs in parity bit, the error goes undetected.

42.

A two-out-of-five code consists of _________(a) Two 0s and three 1s(b) Three 0s and two 1s(c) Four 0s and one 1s(d) One 0s and four 1sI have been asked this question by my school teacher while I was bunking the class.The question is from Checksum, Complexity Classes & NP Complete Problems topic in chapter Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The correct option is (B) Three 0S and two 1s

Best explanation: A two-out-of-five code consists of three 0s and two 1s. Hence, it contains TEN POSSIBLE combinations to represent DIGITS from 0-9.

43.

What is the rate of hamming codes?(a) 1-[r/(2^r-1)](b) 1-(r/2^r)(c) 1+(r/2^r)(d) r/2^r+1This question was posed to me in a job interview.I want to ask this question from Checksum, Complexity Classes & NP Complete Problems topic in portion Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Correct option is (a) 1-[r/(2^r-1)]

The best explanation: Rate of a hamming code is message length divided by BLOCK length (i.e.) 2^r-r-1/2^r-1 = 1-[r/(2^r-1)]. It is the HIGHEST rate for a minimum distance of THREE.

44.

What is the message length ‘k’ of a Hamming(7,4) code?(a) 2^r-1(b) 2^r-r+1(c) 2^r-r-1(d) 2^r+1-rThis question was posed to me during an internship interview.My question is based upon Checksum, Complexity Classes & NP Complete Problems topic in portion Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer» RIGHT answer is (c) 2^r-r-1

Easiest EXPLANATION - Hamming CODES are a class of binary linear codes, hence r>=2. For a hamming(7,4) code, the message length ‘k’ is 2^r-r-1 where r is the parity BIT. Here, r=3.
45.

What is the total block length ‘n’ of a Hamming code?(a) 2^r(b) 2^r-1(c) 2^r-1-1(d) 2^r+1The question was asked in unit test.I want to ask this question from Checksum, Complexity Classes & NP Complete Problems topic in chapter Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Correct option is (B) 2^R-1

The best I can explain: Hamming codes are a class of binary linear codes, hence r>=2. For a hamming(7, 4) CODE, the BLOCK length ‘n’ is 2^r-1 where r is the parity bit. Here, r=3.

46.

Who invented Hamming codes?(a) Richard Hamming(b) Ross Hamming(c) Shannon(d) HuffmanThis question was addressed to me in an online quiz.My doubt stems from Checksum, Complexity Classes & NP Complete Problems in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Right choice is (a) RICHARD Hamming

The best explanation: Richard W. Hamming invented hamming CODES in BELL TELEPHONE Laboratory to minimize the errors in punched CARD readers. Huffman invented huffman codes. Shannon invented Shannon-Fanno codes.

47.

Hamming codes can be used for both single-bit error and burst error detection and correction.(a) True(b) FalseThe question was posed to me in semester exam.The question is from Checksum, Complexity Classes & NP Complete Problems topic in chapter Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

Right answer is (b) False

For EXPLANATION: Hamming BITS are suitable only for single-bit error DETECTION and correction and two bit error detection. It is very unlikely to detect BURST ERRORS.

48.

Why do we require hamming codes?(a) Error correction(b) Encryption only(c) Decryption(d) Bit stuffingThe question was posed to me in a job interview.Origin of the question is Checksum, Complexity Classes & NP Complete Problems topic in section Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The correct option is (a) ERROR correction

The EXPLANATION is: HAMMING codes are used for the purpose of error detection and correction. It is also used for channel ENCODING and decoding. They are linear-error correcting codes.

49.

What is the minimal Hamming distance between any two correct codewords?(a) 1(b) 2(c) 3(d) 4I have been asked this question at a job interview.This question is from Checksum, Complexity Classes & NP Complete Problems in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The CORRECT option is (C) 3

To explain: Since we use a generalized version of HAMMING(7, 4) code, the minimal hamming distance is 3. It cannot correct BURST errors.

50.

The most common hamming codes are a generalized version of?(a) Hamming(7, 4) code(b) Hamming(8, 4) code(c) Hamming(6, 3) code(d) Hamming(5, 7) codeI have been asked this question by my school teacher while I was bunking the class.I want to ask this question from Checksum, Complexity Classes & NP Complete Problems in section Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The CORRECT choice is (a) HAMMING(7, 4) code

To explain: The most COMMON hamming codes generalize to form hamming(7, 4) code. It ENCODES four bits of data into seven bits by adding three parity bits.