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.

Chan’s algorithm can be used to compute the lower envelope of a trapezoid.(a) true(b) falseI had been asked this question in my homework.Question is taken from Computational Geometry topic in chapter Computational Geometry of Data Structures & Algorithms II

Answer»

Right option is (a) true

The explanation is: An extension of Chan’s ALGORITHM can be used for proving solutions to complex problems like computing the LOWER ENVELOPE L(S) where S is a set of ‘N’ line segments in a TRAPEZOID.

2.

Which of the following factors account more to the cost of Chan’s algorithm?(a) computing a single convex hull(b) locating points that constitute a hull(c) computing convex hull in groups(d) merging convex hullsThis question was addressed to me during an interview for a job.My doubt is from Computational Geometry topic in chapter Computational Geometry of Data Structures & Algorithms II

Answer»

The correct answer is (C) COMPUTING CONVEX hull in groups

Easiest EXPLANATION - The majority of the cost of the algorithm lies in the pre-processing (i.e.) computing convex hull in groups. To reduce cost, we reuse convex hulls from previous ITERATIONS.

3.

Which of the following statements is not a part of Chan’s algorithm?(a) eliminate points not in the hull(b) recompute convex hull from scratch(c) merge previously calculated convex hull(d) reuse convex hull from the previous iterationI got this question in an online interview.I'm obligated to ask this question of Computational Geometry topic in chapter Computational Geometry of Data Structures & Algorithms II

Answer»

The correct choice is (b) recompute CONVEX hull from scratch

The best I can explain: Chan’s algorithm implies that the convex hulls of LARGER points can be arrived at by merging previously CALCULATED convex hulls. It makes the algorithm simpler instead of recomputing every TIME from scratch.

4.

What is the running time of Hershberger algorithm?(a) O(log n)(b) O(n log n)(c) O(n log h)(d) O(log h)This question was addressed to me in homework.My enquiry is from Computational Geometry topic in section Computational Geometry of Data Structures & Algorithms II

Answer»

The correct ANSWER is (b) O(n log n)

Easy EXPLANATION - Hershberger’s algorithm is an output sensitive algorithm whose RUNNING time was ORIGINALLY O(n log n). He USED Chan’s algorithm to speed up to O(n log h) where h is the number of edges.

5.

Which of the following algorithms is the simplest?(a) Chan’s algorithm(b) Kirkpatrick-Seidel algorithm(c) Gift wrapping algorithm(d) Jarvis algorithmI have been asked this question during an internship interview.The origin of the question is Computational Geometry topic in chapter Computational Geometry of Data Structures & Algorithms II

Answer»

Correct choice is (a) CHAN’s algorithm

Easiest explanation - Chan’s algorithm is very practical for moderate SIZED problems WHEREAS Kirkpatrick-Seidel algorithm is not. Although, they both have the same running time. Gift wrapping algorithm is a non-output sensitive algorithm and has a longer running time.

6.

Which of the following is called the “ultimate planar convex hull algorithm”?(a) Chan’s algorithm(b) Kirkpatrick-Seidel algorithm(c) Gift wrapping algorithm(d) Jarvis algorithmI had been asked this question in an interview for job.This is a very interesting question from Computational Geometry in chapter Computational Geometry of Data Structures & Algorithms II

Answer»

Correct choice is (b) Kirkpatrick-Seidel algorithm

Easy explanation - Kirkpatrick-Seidel algorithm is called as the ultimate PLANAR CONVEX hull algorithm. Its RUNNING time is the same as that of Chan’s algorithm (i.e.) O(n LOG h).

7.

The running time of Chan’s algorithm is obtained from combining two algorithms.(a) True(b) FalseI had been asked this question during an interview.The query is from Computational Geometry in division Computational Geometry of Data Structures & Algorithms II

Answer»

The correct CHOICE is (a) True

Best explanation: The O(N log h) running time of Chan’s ALGORITHM is obtained by combining the running time of Graham’s scan [O(n log n)] and JARVIS MATCH [O(nh)].

8.

Who formulated Chan’s algorithm?(a) Timothy(b) Kirkpatrick(c) Frank Nielsen(d) SeidelI have been asked this question by my school teacher while I was bunking the class.I would like to ask this question from Computational Geometry in chapter Computational Geometry of Data Structures & Algorithms II

Answer»

The correct answer is (a) Timothy

Best explanation: CHAN’s ALGORITHM was formulated by Timothy Chan. Kirkpatrick and Seidel formulated the Kirkpatrick-Seidel algorithm. FRANK Nielsen developed a paradigm RELATING to Chan’s algorithm.

9.

What is the running time of Chan’s algorithm?(a) O(log n)(b) O(n log n)(c) O(n log h)(d) O(log h)I got this question in exam.My enquiry is from Computational Geometry topic in division Computational Geometry of Data Structures & Algorithms II

Answer»

Right choice is (c) O(n LOG h)

For explanation: The RUNNING TIME of Chan’s algorithm is calculated to be O(n log h) where h is the number of VERTICES of the convex hull.

10.

Chan’s algorithm is used for computing _________(a) Closest distance between two points(b) Convex hull(c) Area of a polygon(d) Shortest path between two pointsI got this question during an interview.The question is from Computational Geometry topic in section Computational Geometry of Data Structures & Algorithms II

Answer»

Correct choice is (b) Convex hull

The best I can EXPLAIN: Chan’s algorithm is an output-sensitive algorithm USED to compute the convex hull set of n POINTS in a 2D or 3D space. CLOSEST pair algorithm is used to compute the closest distance between two points.

11.

The time is taken to find the ‘n’ points that lie in a convex quadrilateral is?(a) O(N)(b) O(N log N)(c) O(N^2)(d) O(log N)I have been asked this question by my school teacher while I was bunking the class.Question is taken from Computational Geometry topic in division Computational Geometry of Data Structures & Algorithms II

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

The explanation is: The time taken to find the ‘n’ points that lie in a CONVEX quadrilateral is MATHEMATICALLY FOUND to be O(N).
12.

Who formulated quick hull algorithm?(a) Eddy(b) Andrew(c) Chan(d) GrahamI have been asked this question by my school principal while I was bunking the class.I would like to ask this question from Computational Geometry in portion Computational Geometry of Data Structures & Algorithms II

Answer»

Correct OPTION is (a) EDDY

The best I can explain: Eddy formulated quick HULL ALGORITHM. Graham invented graham SCAN. Andrew formulated Andrew’s algorithm and Chan invented Chan’s algorithm.

13.

Which of the following algorithms is similar to a quickhull algorithm?(a) merge sort(b) shell sort(c) selection sort(d) quick sortThe question was posed to me in a national level competition.My question is taken from Computational Geometry in chapter Computational Geometry of Data Structures & Algorithms II

Answer»

Right option is (d) quick sort

Explanation: Quickhull ALGORITHM is SIMILAR to a quick sort algorithm with respect to the run time AVERAGE case and WORST case efficiencies.

14.

To which type of problems does quick hull belong to?(a) numerical problems(b) computational geometry(c) graph problems(d) string problemsI had been asked this question by my college professor while I was bunking the class.This question is from Computational Geometry in section Computational Geometry of Data Structures & Algorithms II

Answer» CORRECT answer is (b) computational geometry

Explanation: QUICK hull problem and closest pair ALGORITHMS are some of the examples of computational problems.
15.

The quick hull algorithm runs faster if the input uses non- extreme points.(a) true(b) falseThis question was posed to me during an online exam.The question is from Computational Geometry topic in portion Computational Geometry of Data Structures & Algorithms II

Answer» CORRECT answer is (a) true

To explain: It is proved that the quick HULL algorithm RUNS FASTER if the input uses non-extreme POINTS and also, if it uses less memory.
16.

Which of the following statement is not related to quickhull algorithm?(a) finding points with minimum and maximum coordinates(b) dividing the subset of points by a line(c) eliminating points within a formed triangle(d) finding the shortest distance between two pointsThis question was posed to me in an online quiz.This interesting question is from Computational Geometry topic in division Computational Geometry of Data Structures & Algorithms II

Answer»

Correct option is (d) FINDING the shortest distance between two POINTS

Easy explanation - Finding the shortest distance between two points belongs to closest pair algorithm while the REST is quickhull.

17.

What does the following diagram depict?(a) closest pair(b) convex hull(c) concave hull(d) path compressionI got this question in my homework.The question is from Computational Geometry topic in chapter Computational Geometry of Data Structures & Algorithms II

Answer»

The correct answer is (b) CONVEX hull

Easiest EXPLANATION - The above diagram is a DEPICTION of convex hull, also KNOWN as quick hull, since it encloses n points into a convex POLYGON.

18.

What is the worst case complexity of quick hull?(a) O(N)(b) O(N log N)(c) O(N^2)(d) O(log N)I have been asked this question in a job interview.The doubt is from Computational Geometry in section Computational Geometry of Data Structures & Algorithms II

Answer»

Right option is (c) O(N^2)

Best explanation: The WORST CASE complexity of quickhull algorithm using divide and conquer approach is MATHEMATICALLY FOUND to be O(N^2).

19.

What is the average case complexity of a quick hull algorithm?(a) O(N)(b) O(N log N)(c) O(N^2)(d) O(log N)This question was posed to me in unit test.The doubt is from Computational Geometry in portion Computational Geometry of Data Structures & Algorithms II

Answer»

Correct choice is (b) O(N log N)

For EXPLANATION: The average case complexity of quickhull ALGORITHM USING DIVIDE and conquer approach is mathematically FOUND to be O(N log N).

20.

How many approaches can be applied to solve quick hull problem?(a) 1(b) 2(c) 3(d) 4This question was posed to me in semester exam.I would like to ask this question from Computational Geometry in portion Computational Geometry of Data Structures & Algorithms II

Answer»

The correct option is (b) 2

To explain: Most commonly, TWO approaches are adopted to solve quick HULL problem- brute force APPROACH and divide and CONQUER approach.

21.

What is the other name for quick hull problem?(a) convex hull(b) concave hull(c) closest pair(d) path compressionThe question was asked in an interview for job.This interesting question is from Computational Geometry topic in division Computational Geometry of Data Structures & Algorithms II

Answer»

Correct option is (a) CONVEX hull

Best EXPLANATION: The other NAME for quick hull problem is convex hull problem WHEREAS the closest pair problem is the problem of finding the closest distance between TWO points.

22.

___________ is a method of constructing a smallest polygon out of n given points.(a) closest pair problem(b) quick hull problem(c) path compression(d) union-by-rankThe question was posed to me in an international level competition.My doubt stems from Computational Geometry in chapter Computational Geometry of Data Structures & Algorithms II

Answer»

The correct option is (b) quick HULL problem

Easy EXPLANATION - Quick hull is a METHOD of constructing a smallest CONVEX polygon out of n given POINTS in a plane.

23.

Which of the following operation will give a vector that is perpendicular to both vectors a and b?(a) a x b(b) a.b(c) b x a(d) both a x b and b x aI have been asked this question in an international level competition.My query is from Computational Geometry in portion Computational Geometry of Data Structures & Algorithms II

Answer»

Right choice is (d) both a X b and b x a

Best EXPLANATION: The resultant VECTOR from the CROSS product of two VECTORS is perpendicular to the plane containing both vectors. So both a x b and b x a will give a vector that is perpendicular to both vectors a and b.

24.

What will be the cross product of the vectors 2i + 3j + k and 6i + 9j + 3k?(a) i + 2j + k(b) i – j – 5k(c) 0(d) 2i – j – 5kThis question was posed to me in a national level competition.My doubt stems from Computational Geometry in section Computational Geometry of Data Structures & Algorithms II

Answer» RIGHT ANSWER is (c) 0

Easy EXPLANATION - The GIVEN vectors are parallel to each other. The cross PRODUCT of parallel vectors is 0 because sin(0) is 0.
25.

What will be the cross product of the vectors 2i + 3j + k and 3i + 2j + k?(a) i + 2j + k(b) 2i + 3j + k(c) i + j – 5k(d) 2i – j – 5kI got this question at a job interview.Origin of the question is Computational Geometry in portion Computational Geometry of Data Structures & Algorithms II

Answer»

The correct answer is (c) i + J – 5k

The best EXPLANATION: We can FIND the cross PRODUCT of the GIVEN vectors by solving the determinant.

26.

The resultant vector from the cross product of two vectors is _____________(a) perpendicular to any one of the two vectors involved in cross product(b) perpendicular to the plane containing both vectors(c) parallel to to any one of the two vectors involved in cross product(d) parallel to the plane containing both vectorsI got this question in my homework.This question is from Computational Geometry topic in division Computational Geometry of Data Structures & Algorithms II

Answer»

Right answer is (b) PERPENDICULAR to the plane containing both VECTORS

The BEST EXPLANATION: The RESULTANT vector from the cross product of two vectors is perpendicular to the plane containing both vectors. In other words, it should be perpendicular to both the vectors involved in the cross product.

27.

Cross product of two vectors can be used to find?(a) area of rectangle(b) area of square(c) area of parallelogram(d) perimeter of rectangleThe question was posed to me in unit test.This intriguing question comes from Computational Geometry topic in chapter Computational Geometry of Data Structures & Algorithms II

Answer»

The CORRECT answer is (c) AREA of parallelogram

Best explanation: CROSS product of TWO vectors can be used to find the area of parallelogram. For this, we NEED to consider the vectors as the adjacent sides of the parallelogram.

28.

Which of the following equals the a x b ( a and b are two vectors)?(a) – (a x b)(b) a.b(c) b x a(d) – (b x a)This question was posed to me in exam.This key question is from Computational Geometry topic in portion Computational Geometry of Data Structures & Algorithms II

Answer»

The correct ANSWER is (d) – (b x a)

Easiest EXPLANATION - The vector PRODUCT a x b is equal to – (b x a). The MINUS sign shows that these vectors have opposite DIRECTIONS.

29.

The concept of cross product is applied in the field of computer graphics.(a) true(b) falseI got this question by my school principal while I was bunking the class.My doubt is from Computational Geometry topic in division Computational Geometry of Data Structures & Algorithms II

Answer»

Correct ANSWER is (a) true

The best I can explain: The concept of CROSS PRODUCT FIND its APPLICATION in the field of computer graphics. It can be used to find the winding of polygon about a point.

30.

What is the general formula for finding the magnitude of the cross product of two vectors a and b with angle θ between them?(a) |a|.|b|(b) |a|.|b| cos(θ)(c) |a|.|b| sin(θ)(d) |a|.|b| tan(θ)This question was addressed to me in exam.I want to ask this question from Computational Geometry topic in portion Computational Geometry of Data Structures & Algorithms II

Answer»

The correct answer is (c) |a|.|B| sin(θ)

Best explanation: The GENERAL formula for finding the MAGNITUDE of cross product of TWO vectors is |a|.|b| sin(θ). Its DIRECTION is perpendicular to the plane containing a and b.

31.

What is the magnitude of resultant of cross product of two parallel vectors a and b?(a) |a|.|b|(b) |a|.|b| cos(180)(c) |a|.|b| sin(180)(d) 1The question was posed to me in quiz.This question is from Computational Geometry topic in chapter Computational Geometry of Data Structures & Algorithms II

Answer»

The correct CHOICE is (c) |a|.|b| sin(180)

To explain: The resultant of CROSS product of 2 parallel VECTORS is always 0 as the angle between them is 0 or 180 degrees. So the answer is |a|.|b| sin(180).

32.

Cross product is also known as?(a) scalar product(b) vector product(c) dot product(d) multiplicationThis question was posed to me in semester exam.This is a very interesting question from Computational Geometry in portion Computational Geometry of Data Structures & Algorithms II

Answer»

Right option is (b) vector product

The best EXPLANATION: CROSS product is ALSO known as a vector product. It is a MATHEMATICAL operation that is PERFORMED on 2 vectors in 3D plane.

33.

Cross product is a mathematical operation performed between ________________(a) 2 scalar numbers(b) a scalar and a vector(c) 2 vectors(d) any 2 numbersI had been asked this question in semester exam.The query is from Computational Geometry topic in chapter Computational Geometry of Data Structures & Algorithms II

Answer»

Correct OPTION is (C) 2 vectors

Easiest EXPLANATION - CROSS product is a mathematical OPERATION that is performed on 2 vectors in a 3D plane. It has many applications in computer programming and physics.

34.

Which of the following strategies does the following diagram depict?(a) Brute force(b) Divide and conquer(c) Exhaustive search(d) Branch and boundThe question was asked by my school principal while I was bunking the class.The query is from Computational Geometry topic in portion Computational Geometry of Data Structures & Algorithms II

Answer»

The correct choice is (b) Divide and CONQUER

The best I can explain: The above diagram depicts the IMPLEMENTATION of divide and conquer. The problem is divided into SUB PROBLEMS and are separated by a line.

35.

Which of the points are closer to each other?(a) p1 and p11(b) p3 and p8(c) p2 and p3(d) p9 and p10I had been asked this question in quiz.This intriguing question comes from Computational Geometry topic in section Computational Geometry of Data Structures & Algorithms II

Answer»

The CORRECT answer is (c) p2 and p3

The explanation is: From symmetry, we determine that the CLOSEST pair is p2 and p3. But the exact calculations have to be done USING Euclid’s algorithm.

36.

The optimal time obtained through divide and conquer approach using merge sort is the best case efficiency.(a) true(b) falseI have been asked this question during an interview for a job.This intriguing question originated from Computational Geometry topic in section Computational Geometry of Data Structures & Algorithms II

Answer» CORRECT choice is (a) true

The best I can EXPLAIN: The optimal time obtained through divide and CONQUER approach is the best CLASS efficiency and it is given by Ω(N log N).
37.

In divide and conquer, the time is taken for merging the subproblems is?(a) O(N)(b) O(N log N)(c) O(N^2)(d) O(log N)I got this question in quiz.My doubt stems from Computational Geometry topic in division Computational Geometry of Data Structures & Algorithms II

Answer» RIGHT answer is (b) O(N LOG N)

Easiest explanation - The time taken for merging the smaller SUBPROBLEMS in a divide and conquer approach is mathematically FOUND to be O(N log N).
38.

What is the optimal time required for solving the closest pair problem using divide and conquer approach?(a) O(N)(b) O(log N)(c) O(N log N)(d) O(N^2)The question was asked in class test.This intriguing question comes from Computational Geometry in portion Computational Geometry of Data Structures & Algorithms II

Answer»

Correct ANSWER is (c) O(N LOG N)

The BEST EXPLANATION: The optimal TIME for solving using a divide and conquer approach is mathematically found to be O(N log N).

39.

Manhattan distance is an alternative way to define a distance between two points.(a) true(b) falseThe question was posed to me during an online interview.Query is from Computational Geometry topic in chapter Computational Geometry of Data Structures & Algorithms II

Answer» CORRECT answer is (a) true

The best EXPLANATION: Manhattan distance is an alternative way to CALCULATE distance. It is the distance between two points measured ALONG axes at right ANGLES.
40.

Which of the following strategies does the following diagram depict?(a) Divide and conquer strategy(b) Brute force(c) Exhaustive search(d) BacktrackingThis question was addressed to me in examination.My doubt is from Computational Geometry topic in chapter Computational Geometry of Data Structures & Algorithms II

Answer»

Right option is (b) Brute force

The EXPLANATION is: Brute force is a STRAIGHT forward approach to solve CRITICAL problems. Here, we use brute force technique to find the CLOSEST distance between p1 and P2.

41.

Which of the following is similar to Euclidean distance?(a) Manhattan distance(b) Pythagoras metric(c) Chebyshev distance(d) Heuristic distanceI had been asked this question in semester exam.This interesting question is from Computational Geometry topic in portion Computational Geometry of Data Structures & Algorithms II

Answer» CORRECT option is (B) Pythagoras METRIC

Easiest explanation - In older TIMES, Euclidean distance metric is also called a Pythagoras metric which is the length of the LINE segment connecting two points.
42.

What is the basic operation of closest pair algorithm using brute force technique?(a) Euclidean distance(b) Radius(c) Area(d) Manhattan distanceThis question was addressed to me in semester exam.Enquiry is from Computational Geometry topic in chapter Computational Geometry of Data Structures & Algorithms II

Answer»

Right answer is (a) EUCLIDEAN distance

Easy explanation - The basic operation of CLOSEST pair ALGORITHM is Euclidean distance and its formula is given by d=√(xi-xj)^2+(yi-yj)^2.

43.

The most important condition for which closest pair is calculated for the points (pi, pj) is?(a) i>j(b) i!=j(c) i=j(d) i

Answer»

The correct choice is (d) i
Easiest explanation - To avoid COMPUTING the DISTANCE between the same pair of POINTS TWICE, we consider only the pair of points (pi, pj) for which i

44.

What is the runtime efficiency of using brute force technique for the closest pair problem?(a) O(N)(b) O(N log N)(c) O(N^2)(d) O(N^3log N)I got this question in class test.The origin of the question is Computational Geometry in portion Computational Geometry of Data Structures & Algorithms II

Answer»

Right answer is (c) O(N^2)

Easy EXPLANATION - The efficiency of closest pair algorithm by BRUTE force TECHNIQUE is MATHEMATICALLY found to be O(N^2).

45.

Which approach is based on computing the distance between each pair of distinct points and finding a pair with the smallest distance?(a) Brute force(b) Exhaustive search(c) Divide and conquer(d) Branch and boundThe question was asked in an online interview.My query is from Computational Geometry topic in portion Computational Geometry of Data Structures & Algorithms II

Answer»

The CORRECT answer is (a) Brute force

For explanation: Brute force is a STRAIGHT forward approach that SOLVES CLOSEST pair problem USING that algorithm.

46.

Which of the following areas do closest pair problem arise?(a) computational geometry(b) graph colouring problems(c) numerical problems(d) string matchingI have been asked this question during an online exam.This intriguing question comes from Computational Geometry in section Computational Geometry of Data Structures & Algorithms II

Answer»

The CORRECT answer is (a) computational geometry

For EXPLANATION: Closest pair PROBLEM ARISES in two most important AREAS- computational geometry and operational research.

47.

What will be the slope of the line perpendicular to the line 6x-3y-16=0?(a) 1/2(b) -1/2(c) 2(d) -2I got this question in quiz.My question is based upon Computational Geometry in section Computational Geometry of Data Structures & Algorithms II

Answer»

The correct choice is (B) -1/2

The BEST explanation: For two lines to be perpendicular the PRODUCT of their slopes should be EQUAL to -1. So as the slope of given line is 2 so the slope of line perpendicular to it will be -1/2.

48.

Which of the following is used to find the absolute value of the argument in C++?(a) abs()(b) fabs()(c) mod()(d) ab()I got this question during an interview.Question is taken from Computational Geometry topic in portion Computational Geometry of Data Structures & Algorithms II

Answer»

Correct CHOICE is (b) fabs()

EASIEST explanation - In C++ the ABSOLUTE value of an argument can be found by using the FUNCTION fabs(). It is available under the header file math.h.

49.

What will be the co-ordinates of foot of perpendicular line drawn from the point (-1,3) to the line 3x-4y-16=0?(a) (1/5,2/5)(b) (2/25,5/25)(c) (68/25,-49/25)(d) (-49/25,68/25)I have been asked this question in final exam.I would like to ask this question from Computational Geometry in portion Computational Geometry of Data Structures & Algorithms II

Answer»

Right ANSWER is (c) (68/25,-49/25)

The EXPLANATION is: The foot of PERPENDICULAR can be found by equating the DISTANCE between the two points and the distance between point and line. This is found to be (68/25,-49/25).

50.

What will be the slope of the line given by 10x + 5y + 8=0?(a) -5(b) -2(c) -1.25(d) 5This question was addressed to me in semester exam.My question is based upon Computational Geometry in section Computational Geometry of Data Structures & Algorithms II

Answer»

The CORRECT OPTION is (b) -2

Easy EXPLANATION - The slope of a line given by the equation AX + by + c=0 has the slope of -a/b. So the slope of the given line will be -2.