Hallo nieuwe en oude jaren, Leo hier. Today we will talk about how to study algorithms for iOS Developers, without paying a penny.
This year was fantastic. We learned a lot about various topics.
I started to write about SwiftUI because I started to work with SwiftUI. I’m really enjoying this new UI framework and thinking with SwiftUI is utterly different than thinking with UIKit. Once I read something that Paul Hudson tweeted, was something among these words: The main problem I have with SwiftUI is because I’m still thinking like UIKit.
And that is absolutely true. Throughout this year I had the opportunity to work on some screens, not as much as I wanted but hey it’s a start, and most of the time my troubles were thinking: How I put this label on the trailing? Or: Why this view is not updating?
This year I also started to play with the famous async/await and the new structured concurrency features of Swift language. Two of the pain points about asynchronous operations are easily done with the new async/await framework: point of synchronization (old way, I’ll do a new post updating this) and managing multiple async operations. Both topics were kinda hard in the past but with async/await they are simple and straightforward.
Lastly, this year I wrote almost a small ebook, around 15k words, about how to start an iOS career. I receive this question a lot and I wanted to answer the way I started and described the steps I took to become an iOS developer. My approach with everything about learning is: first consume a lot of free content, then if necessary buy a course. Nowadays, especially with tech-related subjects, there’s a LOT and I mean A LOOOOT of amazing free content out there. There’s no reason to start out with paid content if you want to bootstrap your iOS career. You don’t even know if you will like to develop Apple systems, right?
Let’s see how I always recommend studying algorithms as an iOS developer. But first…
Painting of The Day
Today I chose a 1960 painting called So Long Till Next Year by Grandma Moses.
Anna Mary Robertson Moses (September 7, 1860 – December 13, 1961), known by her nickname Grandma Moses, was an American folk artist.
She started painting seriously at the age of 78 and is frequently used as an example of someone who successfully started a career in the arts at a later age. Her artwork has been displayed, purchased, and sold both nationally and internationally. It has also been advertised on greeting cards and other products. Many museums have collections that include Moses’ paintings. For US $1.2 million, The Sugaring Off was sold in 2006.
I chose this painting because it is Christmas and New Year’s eve!
The Problem
You want to pass your next interview that will have an algorithm live coding.
This article I’ll be a mix of advice. Some will be interviews related others will be algorithm study related.
We will start with the algorithm part and in the end, I’ll give some general advice for interviews.
Algorithm Learning Path
Solving algorithms problems is in essence a pattern recognition skill. But what is that? This is the skill to recognize ways to solve different versions of the same problem. Once you mastered that skill, you are good to go to any live coding interview.
It is no joke that hacker rank and Leetcode have “Topics” that you classify the types of problems. Because most of the problems, including the ones that will be asked in your interview setup, will fall into one of the famous algorithms patterns.
To give a glance at what a high pattern recognition skill is, check the view below where the YouTuber Nick White tries to compete with the world champion competitive programmer William Lin, see what happens:
Yes. That is pattern recognition at its finest.
Of course, you don’t need to be a master-level competitive programmer to ace your next live coding interview, but you sure need to have at least average pattern recognition skills.
How do you achieve that?
Coding Tips to Ace Algorithms Interviews
I would say three main ways:
- Practice, practice, practice: One of the best ways to become proficient in algorithms is to practice solving problems. There are many online resources, such as coding websites and apps, that offer a variety of algorithm problems for you to solve.
- Understand the underlying concepts: It’s important to understand the underlying concepts of different algorithms in order to be able to apply them effectively. This may involve learning about data structures, such as arrays, linked lists, and trees, as well as concepts like time complexity and space complexity.
- Review common algorithm questions: Familiarize yourself with the types of algorithm questions that are commonly asked in interviews. This will help you identify areas of weakness and focus your studies accordingly.
Let’s check what resources I use to study pattern recognition.
Neetcode.io
I found two great resources for that. One is neetcode.io, it has a paid version but the free is more than enough for you to start. There you will go to the new roadmap session where you can find the common patterns. The roadmap is interesting because it already gives you all the steps that you could follow. I strongly recommend following those and studying one pattern each time.
If you prefer to study instead of pattern, data structure-related questions, you can go to the tab practice in Neetcode. All in all, is a 10/10 resource to study algorithms. None of the solutions are in Swift yet, but you should be able to understand the concepts in the videos and apply them to Swift.
Don’t forget to check his channel on youtube. Really great resource for algorithm studying.
Sean Prashad
When I found this I thought that I found a gold mine. Because it goes straight to the point on what to use in what situation if you go to the tab Tips. Of course, you shouldn’t rely only on this but it is very accurate for most situations.
The algorithm he wrote to solve is really neat, I’ll transcribe in the lines below:
- If the input array is sorted then: use Binary search or Two pointers patterns/technique.
- If asked for all permutations or subsets then use the Backtracking technique.
- If given a tree then use DFS or BFS.
- If given a graph then use DFS or BFS.
- If given a linked list then use the Two Pointers technique with probably the Fast/Slot Pointers technique.
- If recursion is banned then use a Stack.
- If must solve in-place then you can Swap corresponding values or Store one or more different values in the same pointer.
- If asked for maximum/minimum subarray/subset/options then Dynamic programming.
- If asked for top/least K items then Heap or QuickSelect algorithms.
- If asked for common strings then Dictionaries and Trie data structures.
And if none of the above helps you… Always remember Dictionary or Set for O(1) time & O(n) space and Sort the input for O(nlogn) time O(1) space.
Those are the tips of Sean Prashad and I think they are really good to start solving algorithms.
Also on the Sean Prashad site, he has separated questions by company and difficulty. Also, a good resource to study.
Paid Resources
For now, if I wanted to pay for something I would go with the Leetcode premium (no affiliate link). I would choose that because if you know the patterns that you are looking for, the rest is just crawling into problems and more problems until you solidify the patterns in your head.
Wrap-Up – Final Interview Preparation Tips
A quick list to pay attention to:
- Learn one topic/data structure/ pattern at a time. Don’t keep moving between various topics, spend a week or 4 days in one, then go to another, and so on. Changing contexts in algorithms is the worst thing that you can do while preparing.
- Rome wasn’t built in one day. Give time to yourself, don’t rush things, and remember all the basic stuff they are your foundation to more intricate algorithms. A graph is a fancy tree, a tree is a fancy linked list, and so on. Do not expect to easily solve graph algorithms without all the base knowledge. It can take months or years to develop a good pattern recognition skill and one thing for sure is that it WILL be HARD.
- Interviews are two-way communication. When you are in the middle of the interview FOR THE LOVE OF GOD please communicate with the other person what you are thinking. Practice interview set up with friends and ask for feedback. Do NOT underestimate communication skills.
And that’s it!
For Big Tech Candidates
It is ok to fail. It is not because you didn’t pass a Big Tech process that you are worth more or less than other developers. It is expected to not pass, the odds are against you in this case.
If this is your goal, and you really should think if this is what you want, keep trying and never stop learning.
Summary – Algorithms for iOS Developers
Algorithms can help you write more efficient code, as they allow you to optimize your solutions for time and space complexity. This can be particularly important for iOS developers, as mobile devices often have limited resources.
Today we checked how to learn the most common algorithm pattern to ace your next live coding interview with two great free resources. Don’t waste your money studying algorithms before have studied all the free resources available.
Merry Christmas and happy new year all!
Fellow Apple Lovers, that’s all. I hope you liked reading this article as much as I enjoyed writing it. If you want to support this blog you can Buy Me a Coffee or say hello on Twitter. I’m available on LinkedIn or send me an e-mail through the contact page.
You can likewise sponsor this blog so I can get my blog free of ad networks.
Thanks for the reading and… That’s all folks.
Image credit: Featured Image