Quiz On Chessboard Problem

Last Updated :
Discuss
Comments

Question 1

The "Eight Queens Puzzle" involves placing 8 queens on an 8x8 chessboard such that no two queens threaten each other. How many solutions are there for this problem?

  • A

    8

  • B

    12

  • C

    32

  • D

    92

Question 2

If a knight piece is placed on a chessboard, how many legal moves can it make in a single turn?

  • A

    6

  • B

    8

  • C

    10

  • D

    12

Question 3

Which of the following methods can be used to solve n-queen’s problem?

  • A

     Greedy algorithm

  • B

    Iterative improvement

  • C

    Divide and conquer

  • D

    Backtracking

Question 4

What is the N-Queens problem?

  • A

    Placing N queens on an N x N chessboard so that no two queens threaten each other. 

  • B

    Placing N kings on an N x N chessboard so that they can capture each other.

  • C

    Placing N queens on an N x N chessboard with no constraints.

  • D

    Placing N pawns on an N x N chessboard so that they can reach the other side.

Question 5

What is the Knight's Tour problem?

  • A

    A puzzle involving a knight in chess capturing other pieces. 

  • B

    A puzzle involving a knight moving to every square on a chessboard exactly once. 

  • C

    A puzzle involving placing knights on a chessboard without conflicts. 

  • D

    A puzzle involving the longest path a knight can take on a chessboard.

Question 6

Which type of graph problem is the Knight's Tour problem an example of?

  • A

    Shortest path problem

  • B

    Traveling Salesman problem 

  • C

    Graph coloring problem 

  • D

    Hamiltonian cycle problem

Question 7

What is the output of the code below if the input is qX = 4, qY = 5, oX = 6, oY = 7 : 

C++
bool canQueenAttack(int qR, int qC, int oR, int oC)
{
    if (qR == oR)
        return true;
    if (qC == oC)
        return true;
    if (abs(qR - oR) == abs(qC - oC))
        return true;

    return false;
}
  • A

    True

  • B

    False

Question 8

Given a square chessboard of N*N size, the position of the knight and the position of a target are given as (1, 3) and (5, 0) respectively. Find out the minimum steps a knight will take to reach the target position.


 

  • A

    2

  • B

    4

  • C

    3

  • D

    5

Question 9

What is the total number of squares (including all sizes) on a standard 8x8 chessboard? 

  • A

    36

  • B

    64

  • C

    72

  • D

    128

Question 10

How will Queen move in the chess-board?

  • A

    Diagonal

  • B

    Forward

  • C

    Backward

  • D

    All of these

There are 10 questions to complete.

Take a part in the ongoing discussion