Interview Prep: The Anagram Check

Check if two strings are anagrams of each other

  • 8 Videos
  • 0 hours 23 minutes
  • 110 Happy Students

About the course

In this class I take a look at this classic interview question. You’ll learn how to solve the basic version, but I’ll go deeper and show you improvements for foreign languages and unicode.

I’ve provided source code, in annotated Python, for all of the algorithms I discuss. The latter half of the course walks through the code, explaining the decisions I’ve made.

Source Code: Github.com

Before you look at my examples, try to implement the algorithms I describe. In each case you’ll have a function that takes two strings as arguments and should return true if they are anagrams.

There are a few versions to implement, from easiest to hardest:

  • Basic english without accents and comparing all characters. Test Case: proteins and pointers
  • Ignore the case of the letters and drop all whitespace. Test Case: Big Bad Snake and Beanbag Kids
  • Non-English support with accents. Test Case: trêve and reve\u0302t (Encode appropriately for your programming language)
  • Dropping accents. Test Case: trêve and verte

  • 8 Videos
  • 0 hours 23 minutes
  • 110 Happy Students

Courses Outline

Lesson 1: Anagram Check
Free
Introduction
0:39
Algorithm Design
3:22
Unicode Version
5:47
Algorithm Code
3:44
Unicode Code
5:59
Language Base Code
1:57
Emoji Code
2:00
Conclusion
0:31
  • 8 Videos
  • 0 hours 23 minutes
  • 110 Happy Students