SitePoint
  • Premium
  • Library
  • Community
  • Jobs
  • Blog
LoginStart Free Trial

The home for developers

Track your course progress, manage projects, and find your dream job - all in one place.

Start Your Free Trial

7 Day Free Trial. Cancel Anytime.

SitePoint Premium

  • Access to 700+ courses
  • Publish articles on SitePoint
  • Daily curated jobs
  • Learning Paths
  • Discounts to dev tools
  • Library/
  • Video courses/
  • Interview Prep: Insertion Sort
Interview Prep: Insertion Sort

Interview Prep: Insertion Sort

Brush up on this algorithm that is sometimes asked about in interviews


Course details

4.0∙1 Rating0 reviews

Published
April 2020
Videos
8
Duration
23m
Happy students
63

Take this course

About the course

Description

Insertion sort is a commonly taught algorithm, and some interviewers like to ask about it. As you'll see in this class, it's an easy algorithm to understand and implement. You'll learn the algorithmic complexity and understand why the algorithm is rarely used.

I'll give a walkthrough of the source code, which I also provide in my repository: github.com

Also watch my course on Binary Search, insertion sort makes use of that algorithm.

Project

I want you to write an insertion sort function. Choose your favorite language, or the one for your interview, and implement a function that sorts a list of values. Use the algorithm I present in this class.

In the example Python implementation, the signature looks like this:

```py
def insertion_sort( items : List[ComparableT] ) -> List[ComparableT]:
```

Verify Sort Algorithm

As a bonus project, write the verify sort algorithm. This is an essential bit of code for unit tests. It also explores concepts that will help you during your interviews.

Verify sort takes an unsorted list and a sorted list. It verifies that the sorted list is indeed the sorted version of the unsorted one.

Course Instructor

Edaqa Mortoray

Edaqa Mortoray

Hi, I'm Edaqa, a programmer, writer and chef. For over 20 years, I've been following a diverse and exciting career path. My journey traces through several countries, filled with great people and culture. I've dedicated my time to numerous startups, and an abundance of side projects. There's so much I'd like to share with all with you -- from programming to cooking, to the unusual creative endeavours. I want my classes to give you the confidence you need to succeed, and the curiosity required to make the most of life. Join me in my continuing adventures.

Course Outline

Lesson 1: Insertion Sort: Design and Implementation
  • Free
    Introduction
    0:33
  • Locked
    Algorithm Design
    4:46
  • Locked
    Algorithm Complexity
    3:43
  • Locked
    Verify Sort Algorithm
    4:49
  • Locked
    Insert Sort Code
    3:31
  • Locked
    Stable Sort
    2:34
  • Locked
    Verify Sort Code
    2:54
  • Locked
    Conclusion
    0:17

Reviews
4.0

1 total

0
1
0
0
0

Course details

4.0∙1 Rating0 reviews

Published
April 2020
Videos
8
Duration
23m
Happy students
63

Take this course
SitePoint

Stuff we do

  • Premium
  • Newsletters
  • Learning paths
  • Library
  • Forums

Contact

  • Contact us
  • FAQ
  • Publish your book
  • Write an article
  • Advertise

About

  • Our Story
  • Corporate Memberships
  • Start free trial
  • Login

Connect

  • RSS
  • Facebook
  • Twitter (X)
  • Instagram

Subscribe to our newsletter

Get the freshest news and resources for developers, designers and digital creators in your inbox each week

© 2000 – 2025 SitePoint Pty. Ltd.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Terms of usePrivacy policy