DSA Interview Question

What is an algorithm?

Updated 2026-07-10 · Beginner friendly
Quick answer

An algorithm is a clear, step by step set of instructions for solving a problem or completing a task. A good algorithm is correct, finishes in a finite number of steps, and is efficient in time and memory. Following a recipe to cook a dish is a everyday example of an algorithm.

What makes a good algorithm

In software, algorithms power everything from sorting a list and searching a database to routing a map and ranking search results. Data structures and algorithms go hand in hand, since the right structure often makes the algorithm simple and fast.

In the interview

If asked to describe your approach before coding, state your algorithm in plain steps first. Interviewers value a clear plan, and it helps you catch mistakes before you write a single line.

Want the full DSA guide?

Read every DSA concept with notes, diagrams, and code in one place. Track your progress as you go.

Open the DSA guide All DSA questions