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 will be the chromatic index for a complete graph having n vertices (consider n to be an even number)?(a) n(b) n + 1(c) n – 1(d) 2n + 1The question was asked during an interview for a job.The above asked question is from Graph Coloring in portion Graph Coloring of Data Structures & Algorithms II

Answer»

Correct option is (C) N – 1

The best explanation: A complete graph is the one in which each VERTEX is DIRECTLY connected with all other vertices with an edge. The CHROMATIC index for even number of vertices will be n-1.

2.

What will be the chromatic index for a complete graph having n vertices (consider n to be an odd number)?(a) n(b) n + 1(c) n – 1(d) 2n + 1I have been asked this question by my college professor while I was bunking the class.The above asked question is from Graph Coloring topic in division Graph Coloring of Data Structures & Algorithms II

Answer»

The correct option is (a) n

Best EXPLANATION: A COMPLETE graph is the one in which each VERTEX is DIRECTLY connected with all other VERTICES with an edge. The chromatic index for an odd number of vertices will be n.

3.

What will be the chromatic index of the following graph?(a) 0(b) 1(c) 2(d) 3I got this question by my college professor while I was bunking the class.I'd like to ask this question from Graph Coloring in division Graph Coloring of Data Structures & Algorithms II

Answer»

Right option is (c) 2

To EXPLAIN: The given graph will REQUIRE 2 unique colors so that no TWO incident edges have the same color. So its CHROMATIC index will be 2.

4.

What will be the chromatic index of the following graph?(a) 2(b) 3(c) 4(d) 5I have been asked this question in final exam.The origin of the question is Graph Coloring in portion Graph Coloring of Data Structures & Algorithms II

Answer»

Correct answer is (b) 3

To explain: The GIVEN graph will require 3 unique colors so that no two INCIDENT edges have the same color. So its chromatic INDEX will be 3.

5.

What will be the chromatic index of the following graph?(a) 1(b) 2(c) 3(d) 4The question was asked by my school teacher while I was bunking the class.I need to ask this question from Graph Coloring in chapter Graph Coloring of Data Structures & Algorithms II

Answer»

The correct choice is (b) 2

For explanation: The given graph will REQUIRE 2 UNIQUE colors so that no two incident edges have the same COLOR. So its CHROMATIC index will be 2.

6.

Bipartite graph belongs to class 1 graphs.(a) True(b) FalseI had been asked this question at a job interview.Origin of the question is Graph Coloring topic in section Graph Coloring of Data Structures & Algorithms II

Answer»

The correct CHOICE is (a) True

The BEST I can explain: A BIPARTITE graph has an EDGE chromatic number equal to Δ. So bipartite GRAPHS belongs to class 1 graphs.

7.

Chromatic number of line graph is always equal to the chromatic index of the graph.(a) True(b) FalseThe question was asked in my homework.The above asked question is from Graph Coloring in chapter Graph Coloring of Data Structures & Algorithms II

Answer»

The correct ANSWER is (a) True

The best explanation: The CHROMATIC index of a GRAPH is always EQUAL to the chromatic number of its line graph. So we can calculate the chromatic index of a graph by calculating the chromatic number of its line graph.

8.

Calculating the chromatic index of a graph is a ______________(a) P problem(b) NP hard problem(c) NP complete problem(d) Cannot be identified as any of the given problem typesI had been asked this question during an internship interview.The query is from Graph Coloring in portion Graph Coloring of Data Structures & Algorithms II

Answer»

Right ANSWER is (c) NP COMPLETE problem

The explanation is: Chromatic index of an arbitrary graph cannot be determined by using any convenient method. So CALCULATING the chromatic index of a graph is an NP complete problem.

9.

If chromatic number of a line graph is 4 then the chromatic index of the graph will be?(a) 0(b) 1(c) 4(d) information insufficientThis question was posed to me during an interview.The doubt is from Graph Coloring in section Graph Coloring of Data Structures & Algorithms II

Answer» CORRECT CHOICE is (c) 4

For explanation: The chromatic index of a graph is always equal to the chromatic number of its LINE graph. So the chromatic index of the graph will be 4.
10.

What will be the chromatic index for an empty graph having n vertices?(a) 0(b) 1(c) 2(d) nI have been asked this question in examination.My question comes from Graph Coloring in chapter Graph Coloring of Data Structures & Algorithms II

Answer» RIGHT answer is (a) 0

To EXPLAIN: An empty graph is a graph WITHOUT any edges. So the CHROMATIC index for such a graph will be 0.
11.

What is a chromatic index?(a) The maximum number of colors required for proper edge coloring of graph(b) The maximum number of colors required for proper vertex coloring of graph(c) The minimum number of colors required for proper vertex coloring of graph(d) The minimum number of colors required for proper edge coloring of graphThis question was posed to me in a national level competition.The query is from Graph Coloring in section Graph Coloring of Data Structures & Algorithms II

Answer»

The CORRECT choice is (d) The minimum number of colors REQUIRED for proper EDGE coloring of graph

Explanation: The minimum number of colors required for proper edge coloring of graph is called chromatic index whereas the minimum number of colors required for proper VERTEX coloring of graph is called chromatic number of a graph.

12.

The number of colors used by a proper edge coloring graph is called?(a) k edge coloring graph(b) x edge coloring graph(c) m edge coloring graph(d) n edge coloring graphI have been asked this question in an online interview.My enquiry is from Graph Coloring in portion Graph Coloring of Data Structures & Algorithms II

Answer»

Correct CHOICE is (a) k edge COLORING graph

To explain: A proper edge coloring graph ENSURES that no two incident edges has the same color. If it uses k colors in the PROCESS then it is called k coloring of graph.

13.

What is the condition for proper edge coloring of a graph?(a) Two vertices having a common edge should not have same color(b) Two vertices having a common edge should always have same color(c) No two incident edges should have the same color(d) No two incident edges should have different colorI have been asked this question during an internship interview.I want to ask this question from Graph Coloring topic in chapter Graph Coloring of Data Structures & Algorithms II

Answer»

Correct answer is (c) No two INCIDENT edges should have the same color

Easy explanation - The CONDITION for proper EDGE coloring of GRAPH is that no two incident edges should have the same color. If it uses k colors in the PROCESS then it is called k edge coloring of graph.

14.

In graph theory collection of dots and lines is called(a) vertex(b) edge(c) graph(d) mapI have been asked this question in class test.My question is taken from Graph Coloring in section Graph Coloring of Data Structures & Algorithms II

Answer» CORRECT choice is (C) graph

To explain: According to the graph THEORY a graph is the collection of dots and lines. Vertices are also CALLED dots and lines are also called edges.
15.

The chromatic number of star graph with 3 vertices is greater than that of a tree with same number of vertices.(a) True(b) FalseI have been asked this question in an online quiz.I need to ask this question from Graph Coloring in chapter Graph Coloring of Data Structures & Algorithms II

Answer»

Correct choice is (b) False

The explanation is: The chromatic number of a star graph and a TREE is ALWAYS 2 (for more than 1 vertex). So both have the same chromatic number.

16.

The chromatic number of star graph with 3 vertices is greater than that of a complete graph with 3 vertices.(a) True(b) FalseThe question was posed to me in an interview.This key question is from Graph Coloring topic in division Graph Coloring of Data Structures & Algorithms II

Answer»

Correct answer is (b) False

Easy explanation - The CHROMATIC NUMBER of a star GRAPH is always 2 (for more than 1 vertex) WHEREAS the chromatic number of complete graph with 3 vertices will be 3. So chromatic number of complete graph will be GREATER.

17.

What will be the chromatic number of the following graph?(a) 2(b) 3(c) 4(d) 5I got this question in class test.My question is from Graph Coloring topic in division Graph Coloring of Data Structures & Algorithms II

Answer»

The CORRECT answer is (b) 3

Easiest explanation - The given graph will require 3 UNIQUE colors so that no two vertices connected by a COMMON edge will have the same color. So its chromatic NUMBER will be 3.

18.

What will be the chromatic number of the following graph?(a) 2(b) 3(c) 4(d) 5I have been asked this question by my school principal while I was bunking the class.The doubt is from Graph Coloring topic in division Graph Coloring of Data Structures & Algorithms II

Answer» RIGHT answer is (b) 3

The best EXPLANATION: The given graph will require 3 unique colors so that no TWO vertices connected by a common edge will have the same COLOR. So its chromatic number will be 3.
19.

What will be the chromatic number of the following graph?(a) 1(b) 2(c) 3(d) 4This question was posed to me in my homework.The question is from Graph Coloring topic in portion Graph Coloring of Data Structures & Algorithms II

Answer»

The CORRECT choice is (B) 2

Explanation: The given graph will only REQUIRE 2 UNIQUE colors so that no TWO vertices connected by a common edge will have the same color. So its chromatic number will be 2.

20.

A graph with chromatic number less than or equal to k is called?(a) K chromatic(b) K colorable(c) K chromatic colorable(d) K colorable chromaticThe question was asked in examination.Origin of the question is Graph Coloring in chapter Graph Coloring of Data Structures & Algorithms II

Answer»

The correct CHOICE is (b) K COLORABLE

Easiest explanation - Any graph that has a chromatic number less than or EQUAL to k is called k colorable. WHEREAS a graph with chromatic number k is called k chromatic.

21.

What will be the chromatic number for a tree having more than 1 vertex?(a) 0(b) 1(c) 2(d) Varies with the structure and number of vertices of the treeThe question was posed to me in semester exam.The query is from Graph Coloring in chapter Graph Coloring of Data Structures & Algorithms II

Answer»

The correct option is (c) 2

Easy EXPLANATION - The minimum number of COLORS required for proper vertex COLORING of graph is CALLED chromatic number. So every tree having more than 1 vertex is 2 chromatic.

22.

What will be the chromatic number for a complete graph having n vertices?(a) 0(b) 1(c) n(d) n!I got this question in homework.I need to ask this question from Graph Coloring topic in chapter Graph Coloring of Data Structures & Algorithms II

Answer» CORRECT CHOICE is (C) n

To explain: A complete graph is the ONE in which each vertex is directly connected with all other VERTICES with an edge. So in such a case each vertex should have a unique color. Thus the chromatic number will be n.
23.

What will be the chromatic number for a line graph having n vertices?(a) 0(b) 1(c) 2(d) nI had been asked this question in a national level competition.Asked question is from Graph Coloring in section Graph Coloring of Data Structures & Algorithms II

Answer»

Right option is (d) n

For EXPLANATION: A LINE graph of a SIMPLE graph is OBTAINED by connecting two vertices with an edge. A line graph has a chromatic number of n.

24.

Calculating the chromatic number of a graph is a(a) P problem(b) NP hard problem(c) NP complete problem(d) cannot be identified as any of the given problem typesThis question was addressed to me in an online quiz.Question is from Graph Coloring in section Graph Coloring of Data Structures & Algorithms II

Answer»

The correct answer is (c) NP complete problem

The EXPLANATION is: CHROMATIC NUMBER of an arbitrary graph cannot be DETERMINED by using any convenient method. So calculating the chromatic number of a graph is an NP complete problem.

25.

What will be the chromatic number for an bipartite graph having n vertices?(a) 0(b) 1(c) 2(d) nThis question was posed to me by my school principal while I was bunking the class.This key question is from Graph Coloring in section Graph Coloring of Data Structures & Algorithms II

Answer» CORRECT option is (c) 2

Easy EXPLANATION - A bipartite GRAPH is graph such that no two VERTICES of the same set are adjacent to each other. So the CHROMATIC number for such a graph will be 2.
26.

What will be the chromatic number for an empty graph having n vertices?(a) 0(b) 1(c) 2(d) nThe question was asked in an interview for job.My question is taken from Graph Coloring in chapter Graph Coloring of Data Structures & Algorithms II

Answer»

The correct OPTION is (B) 1

To EXPLAIN: An empty graph is a graph without any edges. So the chromatic number for such a graph will be 1.

27.

What is a chromatic number?(a) The maximum number of colors required for proper edge coloring of graph(b) The maximum number of colors required for proper vertex coloring of graph(c) The minimum number of colors required for proper vertex coloring of graph(d) The minimum number of colors required for proper edge coloring of graphThis question was posed to me in final exam.Question is taken from Graph Coloring in chapter Graph Coloring of Data Structures & Algorithms II

Answer»

Correct ANSWER is (C) The minimum number of COLORS REQUIRED for PROPER vertex coloring of graph

Explanation: The minimum number of colors required for proper vertex coloring of graph is called chromatic number whereas the minimum number of colors required for proper edge coloring of graph is called chromatic index of a graph.

28.

The number of colors used by a proper coloring graph is called?(a) k coloring graph(b) x coloring graph(c) m coloring graph(d) n coloring graphThe question was posed to me at a job interview.My question comes from Graph Coloring in chapter Graph Coloring of Data Structures & Algorithms II

Answer»

Correct answer is (a) k coloring graph

To EXPLAIN: A PROPER graph ensures that two vertices which share a common edge should not have the same COLOR. If it uses k colors in the process then it is CALLED k coloring of graph.

29.

What is the condition for proper coloring of a graph?(a) two vertices having a common edge should not have same color(b) two vertices having a common edge should always have same color(c) all vertices should have a different color(d) all vertices should have same colorThe question was asked during an online interview.I would like to ask this question from Graph Coloring in portion Graph Coloring of Data Structures & Algorithms II

Answer»

Right answer is (a) two vertices having a common EDGE should not have same COLOR

Best explanation: The condition for proper COLORING of graph is that two vertices which SHARE a common edge should not have the same color. If it uses k colors in the process then it is CALLED k coloring of graph.

30.

What is the definition of graph according to graph theory?(a) visual representation of data(b) collection of dots and lines(c) collection of edges(d) collection of verticesThis question was posed to me in an interview.The origin of the question is Graph Coloring in division Graph Coloring of Data Structures & Algorithms II

Answer» CORRECT choice is (b) collection of dots and LINES

The BEST explanation: According to the GRAPH theory a graph is the collection of dots and lines. Vertices are ALSO called dots and lines are also called edges.
31.

Vertex coloring and chromatic number are one and the same.(a) True(b) FalseThis question was posed to me in exam.This question is from Graph Coloring in chapter Graph Coloring of Data Structures & Algorithms II

Answer»

The correct option is (b) False

To explain: VERTEX coloring of a graph is an assignment of colors to the vertices of a graph such that no TWO ADJACENT vertices have the same color. Whereas chromatic number refers to the minimum number of UNIQUE colors REQUIRED for vertex coloring of the graph.

32.

How many unique colors will be required for vertex coloring of the following graph?(a) 2(b) 3(c) 4(d) 5I got this question during an interview.This key question is from Graph Coloring topic in section Graph Coloring of Data Structures & Algorithms II

Answer»

Correct OPTION is (b) 3

The EXPLANATION is: The given graph will REQUIRE 3 unique colors because two diagonal VERTEX are connected to each other directly. So its chromatic NUMBER will be 3.

33.

How many unique colors will be required for vertex coloring of the following graph?(a) 2(b) 3(c) 4(d) 5The question was posed to me by my college director while I was bunking the class.The origin of the question is Graph Coloring in chapter Graph Coloring of Data Structures & Algorithms II

Answer» CORRECT choice is (c) 4

Explanation: The given graph will REQUIRE 4 unique COLORS so that no two VERTICES connected by a common edge will have the same color. So its chromatic number will be 4.
34.

What will be the chromatic number of the following graph?(a) 1(b) 2(c) 3(d) 4I had been asked this question by my college director while I was bunking the class.My question is from Graph Coloring topic in division Graph Coloring of Data Structures & Algorithms II

Answer»

Right CHOICE is (b) 2

Easy explanation - The GIVEN graph will only require 2 unique colors so that no TWO vertices connected by a COMMON EDGE will have the same color. All nodes will have the same color except the central node.

35.

Minimum number of colors required for proper edge coloring of a graph is called?(a) Chromatic color(b) Chromatic index(c) Edge matching(d) Color numberThe question was asked by my college professor while I was bunking the class.Question is taken from Graph Coloring in chapter Graph Coloring of Data Structures & Algorithms II

Answer»

Correct option is (B) Chromatic index

The explanation is: The MINIMUM number of colors REQUIRED for PROPER edge coloring of graph is called chromatic index. It is also KNOWN as edge chromatic number.

36.

How many unique colors will be required for proper vertex coloring of a complete graph having n vertices?(a) 0(b) 1(c) n(d) n!I had been asked this question in class test.This intriguing question comes from Graph Coloring topic in division Graph Coloring of Data Structures & Algorithms II

Answer»

The correct answer is (C) n

The BEST explanation: A complete GRAPH is the one in which each vertex is directly connected with all other vertices with an edge. So the number of UNIQUE colors required for proper coloring of the graph will be n.

37.

How many unique colors will be required for proper vertex coloring of a line graph having n vertices?(a) 0(b) 1(c) 2(d) nThe question was asked in an interview for internship.My doubt stems from Graph Coloring topic in section Graph Coloring of Data Structures & Algorithms II

Answer» RIGHT choice is (d) n

Easiest explanation - A line graph of a SIMPLE graph is OBTAINED by CONNECTING two vertices with an edge. So the number of unique colors REQUIRED for proper coloring of the graph will be n.
38.

Which of the following is an NP complete problem?(a) Hamiltonian cycle(b) Travelling salesman problem(c) Calculating chromatic number of graph(d) Finding maximum element in an arrayI have been asked this question in an international level competition.My doubt is from Graph Coloring topic in portion Graph Coloring of Data Structures & Algorithms II

Answer» CORRECT option is (c) Calculating chromatic NUMBER of graph

The explanation is: Calculating the chromatic number of a graph is an NP complete problem as a chromatic number of an arbitrary graph cannot be determined by USING any convenient METHOD.
39.

How many unique colors will be required for proper vertex coloring of a bipartite graph having n vertices?(a) 0(b) 1(c) 2(d) nI got this question by my college professor while I was bunking the class.I want to ask this question from Graph Coloring in portion Graph Coloring of Data Structures & Algorithms II

Answer»

Right ANSWER is (C) 2

Easiest explanation - A bipartite graph is a graph such that no two vertices of the same set are ADJACENT to each other. So the number of unique colors REQUIRED for PROPER coloring of the graph will be 2.

40.

How many unique colors will be required for proper vertex coloring of an empty graph having n vertices?(a) 0(b) 1(c) 2(d) nThe question was asked at a job interview.The above asked question is from Graph Coloring topic in section Graph Coloring of Data Structures & Algorithms II

Answer»

The correct choice is (b) 1

The best I can explain: An empty GRAPH is a graph WITHOUT any edges. So the NUMBER of unique colors required for proper COLORING of the graph will be 1.

41.

Minimum number of unique colors required for vertex coloring of a graph is called?(a) vertex matching(b) chromatic index(c) chromatic number(d) color numberThe question was posed to me in final exam.This is a very interesting question from Graph Coloring topic in division Graph Coloring of Data Structures & Algorithms II

Answer»

The correct ANSWER is (c) chromatic number

To explain: The minimum number of colors REQUIRED for PROPER vertex coloring of graph is CALLED chromatic number whereas the minimum number of colors required for proper edge coloring of graph is called chromatic index of a graph.

42.

How many edges will a tree consisting of N nodes have?(a) Log(N)(b) N(c) N – 1(d) N + 1I got this question in unit test.This is a very interesting question from Graph Coloring in portion Graph Coloring of Data Structures & Algorithms II

Answer»

The CORRECT answer is (c) N – 1

Easy explanation - In ORDER to have a fully CONNECTED tree it MUST have N-1 edges. So the correct answer will be N-1.

43.

What is vertex coloring of a graph?(a) A condition where any two vertices having a common edge should not have same color(b) A condition where any two vertices having a common edge should always have same color(c) A condition where all vertices should have a different color(d) A condition where all vertices should have same colorThis question was posed to me in an international level competition.Question is taken from Graph Coloring in portion Graph Coloring of Data Structures & Algorithms II

Answer»

The correct answer is (a) A CONDITION where any two vertices having a common EDGE should not have same color

Easiest explanation - The condition for vertex coloring of a graph is that two vertices which share a common edge should not have the same color. If it USES K colors in the process then it is called k coloring of graph.

44.

Which of the following is not a type of graph in computer science?(a) undirected graph(b) bar graph(c) directed graph(d) weighted graphI got this question during an interview.Origin of the question is Graph Coloring topic in section Graph Coloring of Data Structures & Algorithms II

Answer»

The correct option is (b) bar graph

Easy explanation - ACCORDING to the graph theory a graph is the COLLECTION of DOTS and LINES. A bar graph is not a TYPE of graph in computer science.