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.

Of the following given options, which one of the following does not provides an optimal solution for 8-queens problem?(a) (5,3,8,4,7,1,6,2)(b) (1,6,3,8,3,2,4,7)(c) (4,1,5,8,6,3,7,2)(d) (6,2,7,1,4,8,5,3)I got this question by my school principal while I was bunking the class.My question is based upon Backtracking in portion Backtracking of Data Structures & Algorithms II

Answer»

Correct CHOICE is (B) (1,6,3,8,3,2,4,7)

Best explanation: The FOLLOWING GIVEN OPTIONS for optimal solutions of 8-queens problem, (1,6,3,8,3,2,4,7) does not provide an optimal solution.

2.

What is the domination number for 8-queen’s problem?(a) 8(b) 7(c) 6(d) 5The question was posed to me in an international level competition.This intriguing question originated from Backtracking topic in chapter Backtracking of Data Structures & Algorithms II

Answer»

The correct option is (d) 5

Easiest EXPLANATION - The minimum number of QUEENS NEEDED to occupy EVERY square in n-queens PROBLEM is called domination number. While n=8, the domination number is 5.

3.

If n=1, an imaginary solution for the problem exists.(a) true(b) falseI have been asked this question in an online interview.This interesting question is from Backtracking in portion Backtracking of Data Structures & Algorithms II

Answer»

The correct choice is (b) false

The EXPLANATION is: For n=1, the n-queen PROBLEM has a trivial and real solution and it is REPRESENTED by

4.

How many possible solutions occur for a 10-queen problem?(a) 850(b) 742(c) 842(d) 724This question was addressed to me during an interview.I want to ask this question from Backtracking topic in portion Backtracking of Data Structures & Algorithms II

Answer» RIGHT option is (d) 724

Easiest EXPLANATION - For a 10-queen problem, 724 POSSIBLE combinations of optimal SOLUTIONS are available.
5.

How many possible solutions exist for an 8-queen problem?(a) 100(b) 98(c) 92(d) 88The question was asked in examination.I'm obligated to ask this question of Backtracking in portion Backtracking of Data Structures & Algorithms II

Answer»

Correct answer is (C) 92

Easy EXPLANATION - For an 8-queen problem, there are 92 possible combinations of optimal SOLUTIONS.

6.

Of the following given options, which one of the following is a correct option that provides an optimal solution for 4-queens problem?(a) (3,1,4,2)(b) (2,3,1,4)(c) (4,3,2,1)(d) (4,2,3,1)I got this question in quiz.The above asked question is from Backtracking in chapter Backtracking of Data Structures & Algorithms II

Answer»

The CORRECT answer is (a) (3,1,4,2)

For EXPLANATION: Of the following GIVEN options for OPTIMAL solutions of 4-queens problem, (3, 1, 4, 2) is the right option.

7.

Which of the following methods can be used to solve n-queen’s problem?(a) greedy algorithm(b) divide and conquer(c) iterative improvement(d) backtrackingI got this question by my school teacher while I was bunking the class.The question is from Backtracking in chapter Backtracking of Data Structures & Algorithms II

Answer»

Correct ANSWER is (d) backtracking

To explain: Of the following GIVEN APPROACHES, n-queens PROBLEM can be SOLVED using backtracking. It can also be solved using branch and bound.

8.

In n-queen problem, how many values of n does not provide an optimal solution?(a) 1(b) 2(c) 3(d) 4The question was posed to me by my college director while I was bunking the class.I'm obligated to ask this question of Backtracking in portion Backtracking of Data Structures & Algorithms II

Answer»

Right OPTION is (b) 2

The explanation is: N-queen problem does not provide an OPTIMAL SOLUTION of only three values of n (i.e.) n=2,3.

9.

Not more than 2 queens can occur in an n-queens problem.(a) true(b) falseThis question was posed to me in final exam.This key question is from Backtracking in chapter Backtracking of Data Structures & Algorithms II

Answer» CORRECT ANSWER is (b) false

Best explanation: Unlike a REAL chess game, n-queens occur in a n-queen problem SINCE it is the problem of dealing with n-queens.
10.

Where is the n-queens problem implemented?(a) carom(b) chess(c) ludo(d) cardsThis question was addressed to me in examination.The query is from Backtracking in division Backtracking of Data Structures & Algorithms II

Answer»

Right CHOICE is (B) chess

For explanation: N-queens problem OCCURS in chess. It is the problem of PLACING n- queens in a n*n chess board.

11.

Placing n-queens so that no two queens attack each other is called?(a) n-queen’s problem(b) 8-queen’s problem(c) Hamiltonian circuit problem(d) subset sum problemThe question was posed to me in a job interview.My question comes from Backtracking in portion Backtracking of Data Structures & Algorithms II

Answer»

The correct option is (a) n-queen’s problem

Easiest EXPLANATION - PLACING n QUEENS so that no two queens ATTACK each other is n-queens problem. If n=8, it is called as 8-queens problem.

12.

In how many directions do queens attack each other?(a) 1(b) 2(c) 3(d) 4I have been asked this question in a national level competition.This key question is from Backtracking topic in division Backtracking of Data Structures & Algorithms II

Answer» RIGHT option is (c) 3

The explanation is: Queens attack each other in three directions- vertical, horizontal and diagonal.
13.

Which ordered board is the highest enumerated board till now?(a) 25*25(b) 26*26(c) 27*27(d) 28*28I had been asked this question by my college professor while I was bunking the class.The origin of the question is Backtracking topic in chapter Backtracking of Data Structures & Algorithms II

Answer» RIGHT answer is (c) 27*27

The best I can EXPLAIN: The 27*27 board has the HIGHEST order board with total 234,907,967,154,122,528 solutions. It also has total of 29,363,495,934,315,694 FUNDAMENTAL solution.
14.

The six queen puzzle has a fewer solution than the five queen puzzle.(a) True(b) FalseThis question was posed to me by my college professor while I was bunking the class.This intriguing question comes from Backtracking topic in section Backtracking of Data Structures & Algorithms II

Answer»

Right answer is (a) True

Explanation: There are total 4 SOLUTIONS for the SIX queen puzzle and one FUNDAMENTAL solution while there are total of 10 solutions for 5 queen puzzle and 2 fundamental solutions.

15.

How many fundamental solutions are the for 3 queens on a 3*3 board?(a) 1(b) 12(c) 3(d) 0The question was posed to me in an interview for internship.The above asked question is from Backtracking in section Backtracking of Data Structures & Algorithms II

Answer»

The correct answer is (d) 0

To explain: There are in total ZERO SOLUTION to the 3 queen PUZZLE for 3*3 chess board. Hence there are no fundamental SOLUTIONS. For 8*8 chess board with 8 queens there are total of 12 fundamental solutions for the puzzle.

16.

Is it possible to have no four queens in a straight line as the part of one of the solution to the eight queen puzzle.(a) True(b) FalseThe question was asked during an interview for a job.My question comes from Backtracking in division Backtracking of Data Structures & Algorithms II

Answer» RIGHT option is (B) False

Easy explanation - No three queens LIE in a straight line in one of the fundamental SOLUTION of the EIGHT queen puzzle.
17.

How many fundamental solutions are there for the eight queen puzzle?(a) 92(b) 10(c) 11(d) 12This question was posed to me at a job interview.My question is taken from Backtracking topic in division Backtracking of Data Structures & Algorithms II

Answer»

Correct answer is (d) 12

To explain: There are total of 12 FUNDAMENTAL solutions to the eight queen PUZZLE after removing the symmetrical solutions DUE to rotation. For 8*8 CHESS board with 8 queens there are total of 92 solutions for the puzzle.

18.

Who publish the bitwise operation method to solve the eight queen puzzle?(a) Zongyan Qiu(b) Martin Richard(c) Max Bezzel(d) Frank NauckI have been asked this question in an internship interview.Question is taken from Backtracking topic in chapter Backtracking of Data Structures & Algorithms II

Answer»

Right OPTION is (a) Zongyan Qiu

For explanation: The FIRST person to publish the BITWISE operation method to solve the EIGHT queen puzzle was Zongyan Qiu. After him, it was published by Martin Richard.

19.

How many solutions are there for 8 queens on 8*8 board?(a) 12(b) 91(c) 92(d) 93The question was asked by my college director while I was bunking the class.Origin of the question is Backtracking in division Backtracking of Data Structures & Algorithms II

Answer»

Right answer is (c) 92

For EXPLANATION: For 8*8 chess board with 8 queens there are total of 92 solutions for the puzzle. There are total of 12 fundamental solutions to the EIGHT queen puzzle.

20.

Who proposed the depth first backtracking algorithm?(a) Edsger Dijkshtra(b) Max Bezzel(c) Frank Nauck(d) Carl FriedrichThe question was asked in my homework.I would like to ask this question from Backtracking in division Backtracking of Data Structures & Algorithms II

Answer»

Right choice is (a) Edsger Dijkshtra

For explanation: In 1972, depth first backtracking algorithm was proposed by Edsger Dijkshtra to illustrate the EIGHT Queen PUZZLE. MAX Friedrich William Bezzel PUBLISHED the puzzle and the first SOLUTION to the Eight Queen Puzzle was given by Franz Nauck.

21.

Who was the first person to find the solution of Eight Queen Puzzle using determinant?(a) Max Bezzel(b) Frank Nauck(c) Gunther(d) FriedrichI had been asked this question during an interview.This intriguing question originated from Backtracking topic in section Backtracking of Data Structures & Algorithms II

Answer» CORRECT ANSWER is (c) Gunther

Best explanation: S. Gunther was the first person to PROPOSE a solution to the eight queen puzzle using DETERMINANT. MAX Friedrich William Bezzel published the puzzle and the first solution to the Eight Queen Puzzle was given by Franz Nauck.
22.

For how many queens was the extended version of Eight Queen Puzzle applicable for n*n squares?(a) 5(b) 6(c) 8(d) nThe question was posed to me in an interview for job.This question is from Backtracking topic in section Backtracking of Data Structures & Algorithms II

Answer»

Right answer is (d) n

Easy explanation - The EXTENDED version GIVEN by FRANZ Nauck of the Eight Queen Puzzle was for n queens on n*n square chessboard. EARLIER the puzzle was proposed with 8 queens on 8*8 board.

23.

Who published the extended version of eight queens puzzle?(a) Franz Nauck(b) Max Bezzel(c) Carl(d) FriedrichThis question was posed to me during a job interview.This key question is from Backtracking topic in division Backtracking of Data Structures & Algorithms II

Answer»

The CORRECT option is (a) FRANZ Nauck

To explain: The FIRST extended version to the EIGHT Queen Puzzle was given by Franz Nauck in 1850. Max Friedrich William Bezzel published the puzzle in 1848.

24.

When was the first solution to Eight Queen Puzzle published?(a) 1850(b) 1847(c) 1848(d) 1849The question was asked during an interview.My question comes from Backtracking topic in division Backtracking of Data Structures & Algorithms II

Answer»

Correct option is (a) 1850

For EXPLANATION: The FIRST solution to the Eight Queen Puzzle was given by Franz Nauck in 1850. MAX Friedrich WILLIAM Bezzel, who was a German chess COMPOSER by profession published the puzzle in 1848.

25.

Who published the first solution of the eight queens puzzle?(a) Franz Nauck(b) Max Bezzel(c) Carl(d) FriedrichI had been asked this question in examination.Question is taken from Backtracking in section Backtracking of Data Structures & Algorithms II

Answer»

The correct option is (a) Franz Nauck

For explanation: The FIRST solution to the Eight Queen Puzzle was given by Franz Nauck in 1850. While the first Eight Queen Puzzle was PUBLISHED by Max FRIEDRICH William Bezzel, who was a German chess COMPOSER.

26.

When was the Eight Queen Puzzle published?(a) 1846(b) 1847(c) 1848(d) 1849This question was posed to me in final exam.My question is taken from Backtracking topic in division Backtracking of Data Structures & Algorithms II

Answer» CORRECT answer is (c) 1848

The best EXPLANATION: The first Eight Queen Puzzle was PUBLISHED by Max Friedrich William Bezzel, who was a German chess COMPOSER by PROFESSION. He published the puzzle in 1848.
27.

Who published the eight queens puzzle?(a) Max Bezzel(b) Carl(c) Gauss(d) FriedrichThis question was addressed to me in examination.Query is from Backtracking topic in chapter Backtracking of Data Structures & Algorithms II

Answer»

Right ANSWER is (a) Max Bezzel

To explain: The first EIGHT Queen Puzzle was published by Max Friedrich William Bezzel, who was a chess COMPOSER by profession in 1848. He was a German chess composer and the first person to publish the puzzle.

28.

The problem of placing n queens in a chessboard such that no two queens attack each other is called as?(a) n-queen problem(b) eight queens puzzle(c) four queens puzzle(d) 1-queen problemI had been asked this question in an international level competition.The doubt is from Backtracking in division Backtracking of Data Structures & Algorithms II

Answer»

The correct ANSWER is (a) n-queen problem

The best explanation: The problem of placing n-QUEENS in a chessboard such that no two queens are VERTICAL or horizontal or diagonal to each other is an n-queen problem. The problem only EXISTS for n = 1, 4, 8.

29.

The problem of finding a subset of positive integers whose sum is equal to a given positive integer is called as?(a) n- queen problem(b) subset sum problem(c) knapsack problem(d) hamiltonian circuit problemThis question was addressed to me in semester exam.This question is from Backtracking in chapter Backtracking of Data Structures & Algorithms II

Answer»

Correct option is (b) subset sum problem

Easiest explanation - Subset sum problem is the problem of FINDING a subset using the backtracking algorithm when summed, EQUALS a given INTEGER.

30.

___________ enumerates a list of promising nodes that could be computed to give the possible solutions of a given problem.(a) Exhaustive search(b) Brute force(c) Backtracking(d) Divide and conquerI have been asked this question by my college director while I was bunking the class.The doubt is from Backtracking in portion Backtracking of Data Structures & Algorithms II

Answer»

The correct answer is (C) Backtracking

Explanation: Backtracking is a GENERAL algorithm that EVALUATES partially CONSTRUCTED candidates that can be DEVELOPED further without violating problem constraints.

31.

Who coined the term ‘backtracking’?(a) Lehmer(b) Donald(c) Ross(d) FordI got this question in final exam.I'm obligated to ask this question of Backtracking topic in section Backtracking of Data Structures & Algorithms II

Answer» RIGHT answer is (a) Lehmer

Best explanation: D.H. Lehmer was the FIRST person to coin the term BACKTRACKING. Initially, the backtracking facility was PROVIDED using SNOBOL.
32.

The problem of finding a list of integers in a given specific range that meets certain conditions is called?(a) Subset sum problem(b) Constraint satisfaction problem(c) Hamiltonian circuit problem(d) Travelling salesman problemThe question was posed to me during an interview.I'm obligated to ask this question of Backtracking in chapter Backtracking of Data Structures & Algorithms II

Answer» RIGHT CHOICE is (b) Constraint satisfaction PROBLEM

For explanation: Constraint satisfaction problem is the problem of finding a list of integers under given constraints. Constraint satisfaction problem is SOLVED USING a backtracking approach.
33.

Which of the following logical programming languages is not based on backtracking?(a) Icon(b) Prolog(c) Planner(d) FortranThis question was posed to me in exam.Asked question is from Backtracking topic in section Backtracking of Data Structures & Algorithms II

Answer»

The CORRECT CHOICE is (d) Fortran

The explanation is: Backtracking ALGORITHM form the basis for icon, planner and PROLOG whereas fortran is an ancient assembly LANGUAGE used in second generation computers.

34.

Backtracking algorithm is faster than the brute force technique(a) true(b) falseThis question was addressed to me in a job interview.The origin of the question is Backtracking topic in section Backtracking of Data Structures & Algorithms II

Answer» RIGHT answer is (a) true

The EXPLANATION is: BACKTRACKING is faster than brute force approach since it can remove a LARGE set of ANSWERS in one test.
35.

Which one of the following is an application of the backtracking algorithm?(a) Finding the shortest path(b) Finding the efficient quantity to shop(c) Ludo(d) CrosswordThe question was posed to me during an interview.This intriguing question comes from Backtracking topic in chapter Backtracking of Data Structures & Algorithms II

Answer»

The correct option is (d) CROSSWORD

The best I can explain: Crossword puzzles are BASED on backtracking approach whereas the rest are travelling salesman PROBLEM, KNAPSACK problem and dice GAME.

36.

In general, backtracking can be used to solve?(a) Numerical problems(b) Exhaustive search(c) Combinatorial problems(d) Graph coloring problemsI had been asked this question during an interview.My query is from Backtracking topic in section Backtracking of Data Structures & Algorithms II

Answer»

Correct choice is (c) COMBINATORIAL problems

To EXPLAIN: BACKTRACKING approach is used to solve complex combinatorial problems which cannot be SOLVED by EXHAUSTIVE search algorithms.

37.

The leaves in a state-space tree represent only complete solutions.(a) true(b) falseI had been asked this question in a job interview.My doubt is from Backtracking in chapter Backtracking of Data Structures & Algorithms II

Answer»

Right answer is (B) false

Best explanation: The leaves in a state space tree can either REPRESENT non-promising dead ends or complete solutions FOUND by the ALGORITHM.

38.

In what manner is a state-space tree for a backtracking algorithm constructed?(a) Depth-first search(b) Breadth-first search(c) Twice around the tree(d) Nearest neighbour firstThis question was posed to me during an online interview.The question is from Backtracking in division Backtracking of Data Structures & Algorithms II

Answer»

The CORRECT CHOICE is (a) Depth-first search

The explanation is: A state-space TREE for a backtracking algorithm is CONSTRUCTED in the manner of depth-first search so that it is easy to look into.

39.

A node is said to be ____________ if it has a possibility of reaching a complete solution.(a) Non-promising(b) Promising(c) Succeeding(d) PrecedingThe question was asked in my homework.My doubt stems from Backtracking topic in chapter Backtracking of Data Structures & Algorithms II

Answer»

Correct OPTION is (b) PROMISING

For explanation: If a node has a possibility of reaching the FINAL solution, it is called a promising node. Otherwise, it is non-promising.

40.

What happens when the backtracking algorithm reaches a complete solution?(a) It backtracks to the root(b) It continues searching for other possible solutions(c) It traverses from a different route(d) Recursively traverses through the same routeThis question was addressed to me by my school teacher while I was bunking the class.This is a very interesting question from Backtracking in chapter Backtracking of Data Structures & Algorithms II

Answer»

The CORRECT ANSWER is (B) It continues searching for other possible solutions

Easiest EXPLANATION - When we reach a final solution using a backtracking algorithm, we either STOP or continue searching for other possible solutions.

41.

Backtracking algorithm is implemented by constructing a tree of choices called as?(a) State-space tree(b) State-chart tree(c) Node tree(d) Backtracking treeThis question was posed to me by my school principal while I was bunking the class.Question is from Backtracking in chapter Backtracking of Data Structures & Algorithms II

Answer»

Right option is (a) State-space TREE

For explanation: BACKTRACKING problem is solved by CONSTRUCTING a tree of choices called as the state-space tree. Its ROOT represents an initial state before the search for a SOLUTION begins.

42.

Which of the problems cannot be solved by backtracking method?(a) n-queen problem(b) subset sum problem(c) hamiltonian circuit problem(d) travelling salesman problemI had been asked this question at a job interview.This question is from Backtracking in division Backtracking of Data Structures & Algorithms II

Answer»

Right option is (d) travelling salesman PROBLEM

The best explanation: N-queen problem, SUBSET SUM problem, Hamiltonian circuit problems can be solved by BACKTRACKING METHOD whereas travelling salesman problem is solved by Branch and bound method.