Algorithm interview questions

1. What is Insertion sort ?
Insertion sort takes elements of the array sequentially and maintains a sorted subarray to the left of the current point.
It does this by taking an element, then find its correct position in the sorted array, and shifting all following elements by 1, leaving a space for the element to be inserted.

2. What is an algorithm ?
An algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output. An algorithm is thus a sequence of computational steps that transform the input into the output.In mathematics and computer science, an algorithm is a finite sequence of well-defined, computer-implementable instructions, typically to solve a class of problems or to perform a computation. Algorithms are always unambiguous and are used as specifications for performing calculations, data processing, automated reasoning, and other tasks.

3. What is the need for Algorithm ?
The algorithm can
a. improves the efficiency of an existing technique.
b. be used to compare the performance of the algorithm with respect to other techniques.
c. gives a strong description of requirements and goal of the problems to the designer.
d. provides a reasonable understanding of the flow of the program.
e. measures the performance of the methods in different cases.
f. identifies the resources cycles required by the algorithm.

4. What is Big_O_notation ?
Big O notation is a mathematical notation that describes the limiting behavior of a function when the argument tends towards a particular value or infinity. Big O notation characterizes functions according to their growth rates: different functions with the same growth rate may be represented using the same O notation.

5. What is Asymptotic Notations ?
Asymptotic Notations are languages that allow us to analyze an algorithm’s running time by identifying its behavior as the input size for the algorithm increases. This is also known as an algorithm’s growth rate. Does the algorithm suddenly become incredibly slow when the input size grows.

Author: user

Leave a Reply