In addition to data structures, algorithms are also quite common topics in interviews. There are many interview questions about search and sort algorithms. Backtracking, dynamic programming, and greedy algorithms are useful tools to solve many problems posed in coding interviews. Additionally, bit operations can be viewed as special algorithms to manipulate binary integers. All of these algorithms will be discussed in this chapter.

Recursion and Iteration

Repeated operations are handled either by recursion or iteration with loops. Recursion is a function (method) that invokes itself, directly or indirectly. One of the fundamental ...

Get Coding Interviews: Questions, Analysis & Solutions now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.