In learning how to solve algorithms to get ready for technical interviews, loops are used quite a bit in the solutions. I thought it would be a good idea to write out the basic concepts here to help me with these algorithmic challenges.

A loop typically has one or more of the following:

Counter — this is the starting point of the loop. It’s initialized with a value.

Condition — this is a true or false that stops running when the counter value has been met.

Iterator — this part of the loop typically increases the value of the counter by a little bit on each iteration. It will keep doing this until the the condition is false.