- World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Our Services
Get 9,000 Interview Questions & Answers in an eBook.

Get it now !!
Send your Resume to 6000 Companies
Algorithm Interview Questions & Answers - Learning Mode

Algorithm Interview Questions & Answers - Learning Mode

An algorithm (pronounced AL-go-rith-um) is a procedure or formula for solving a problem. The word derives from the name of the mathematician, Mohammed ibn-Musa al-Khwarizmi, who was part of the royal court in Baghdad and who lived from about 780 to 850. An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate input in a finite amount of time. Algorithm can be defined as an outline of the essence of procedure represented in step by step instructional manner. When you implement this algorithm using any programming language, then it is said to be a program. A certain problem can be solved using many different algorithms.

Try Algorithm Interview Questions & Answers - Exam Mode

1 2 Next

Sort By : Latest First | Oldest First | By Rating

Algorithm Interview Questions & Answers - Learning Mode
Try Algorithm Interview Questions & Answers - Exam Mode
Question: Explain the depth of recursion?

Answer: This is another recursion procedure which is the number of times the procedure is called recursively in the process of enlarging a given argument or arguments. Usually this quantity is not obvious except in the case of extremely simple recursive functions, such as FACTORIAL (N), for which the depth is N. Source:
Question: Name any three skills which are very important in order to work with generating functions.

Answer: The three most important skills which are used extensively while working with generating functions are
1)Manipulate summation expressions and their indices.
2)Solve algebraic equations and manipulate algebraic expressions, including partial function decompositions.
3)Identify sequences with their generating functions Source:
Question: Define string in an algorithmic notation and an example to support it?

Answer: In the algorithmic notation, a string is expressed as any sequence of characters enclosed in single quote marks.
E.g. a single quote contained within a string is represented by two single quotes. Therefore, the string ?It is John`s program.? is represented as ?IT IS JOHN?S PROGRAM.?. Source:
Question: Define and describe an iterative process with general steps of flow chart?

Answer: There are four parts in the iterative process they are
Initialization: -The decision parameter is used to determine when to exit from the loop.
Decision: -The decision parameter is used to determine whether to remain in the loop or not.
Computation: - The required computation is performed in this part.
Update: - The decision parameter is updated and a transfer to the next iteration results. Source:
Question: Given a system of N equations whose coefficient matrix A is triangular and is stored in a vector R and the right hand side vector B, this algorithm obtains the solution vector X. Sum is a temporary variable. I am M are integer variables. How to follow the algorithm?

Answer: The algorithm is easy to follow. X1 is first computed from the first equation and then substituted in the second to obtain X2 and so on.
Another common application is one in which most of the elements of a large matrix are zeros. In such a case, only the non zero elements need to be stored along with their row and column sub scripts. Source:
Question: Explain the function of KWIC_Create?

Answer: This algorithm analyses the input phrases and creates the three arrays needed in procedure KWIC_GEN. Source:
Question: Give the difference of format between an algorithm and a sub algorithm?

Answer: The format used is the same as for algorithms except that a return statement replaces an exit statement and a list of parameters follows the sub algorithms name. Although sub algorithms may invoke each other and that a sub algorithm may also invoke itself recursively. Source:
Question: How can an inductive definition be realized?

Answer: An inductive definition of a set can be realized by using a given finite set of elements A and the following three clauses.
1) Basis Clause
2) Inductive clause
3) External clause Source:
Question: Explain the function SUB in algorithmic notation?

Answer: In the algorithmic notation rather than using special marker symbols, generally people use the cursor position plus a substring length to isolate a substring. The name of the function is SUB.
SUB returns a value the sub string of SUBJECT that is specified by the parameters i and j and an assumed value of j. Source:
Question: How do you apply Binary Search on 2D array supposed you have 2D array with integers sorted both horizontally and vertically. If you find any occurrence of the value you are looking for you return true else false. What is the complexity?

For example the 2D array could look like the following

1 4 5 6
2 5 7 9

Answer: search diagonally.

diag 1 = 1
diag2 = 2,4

for example
given the number 7 we take the bounds of each diagonal and check wether the number will fall in that range else move farward.
here diagonal selection is sequential but the number search is binary. Source:
Question: Define and state the importance of sub algorithm in computation and its relation ship with main algorithm?

Answer: A sub algorithm is an independent component of an algorithm and for this reason is defined separately from the main algorithm. The purpose of a sub algorithm is to perform some computation when required, under control of the main algorithm. This computation may be performed on zero or more parameters passed by the calling routine. Source:
Question: Explain about procedural body and computation boxes?

Answer: The procedural body contains two computation boxes namely, the partial and final computational boxes. The partial computation box is combined with the procedure call box. The test box determines whether the argument value is that for which explicit definition of the process is given. Source:
Question: What are the arguments present in pattern matching algorithms?

Answer: These are the following arguments which are present in pattern matching
1) Subject,
2) Pattern
3) Cursor
Question: The most basic tool used to express generating functions in closed form is the closed form expression for the geometric series, which is an expression of the form a+ar+ar2+-------+arn. It can either be terminated or extended indefinitely. What are the restrictions for this geometric series?

Answer: If a and r represents numbers, r must not equal1 in the finite case.In the infinite case the absolute value of r must be less than 1.These restrictions don?t come into play with Generating functions. Source:
Question: State recursion and its different types?

Answer: Recursion is the name given to the technique of defining a set or a process in terms of itself. There are essentially two types of recursion. The first type concerns recursively defined function and the second type of recursion is the recursive use of a procedure. Source:
Question: What are the two ways through which the Markov algorithm terminates?

Answer: A Markov algorithm terminates in one of the two ways.
1) The last production is not applicable
2) A terminal production is applicable
A terminal production is a statement of the form x map to y., where x and y represent the strings in V* and the symbol ?.? Immediately follows the consequences. Source:
Question: State the problems which differentiate between recursive procedure and non-recursive procedure?

Answer: A recursive procedure can be called from within or outside itself, and to ensure its proper functioning, it has to save in same order the return address so that it return to the proper location will result when the return to a calling statement is made. The procedure must also save the formal parameters, local variables etc. Source:
Question: Explain about the algorithm ORD_WORDS?

Answer: This algorithm constructs the vectors TITLE, KEYWORD and T_INDEX. Source:
Question: How to find median of a BST?

Answer: Find the no. of elements on the left side.
If it is n-1 the root is the median.
If it is more than n-1, then it has already been found in the left subtree.
Else it should be in the right subtree.

Question: Which of recent books on testing is rated highly?

Answer: No answer available currently.

1 2 Next

India News Network
Latest 20 Questions
Payment of time- barred debt is: (a) Valid (b) Void (c) Illegal (d) Voidable
Consideration is defined in the Indian Contract Act,1872 in: (a) Section 2(f) (b) Section 2(e) (c) Section 2(g) (d) Section 2(d)
Which of the following is not an exception to the rule, "No consideration, No contract": (a) Natural love and affection (b) Compensation for involuntary services (c) Completed gift (d) Agency
Consideration must move at the desire of: (a) The promisor (b) The promisee (c) The promisor or any other party (d) Both the promisor and the promisee
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal
Cache = 0.328125 Seconds