How I didn't become a SoundClouder

At the end of March 2017, I decided to leave Concur. I had been working there for a year and I had a lot of fun with great teammates around me. However, the project I was working on was canceled in the beginning of the year. The new assignment we got was completely different from the one I joined the company for in the first place. So I started to look around for new opportunities.

SoundCloud logo

I sent my CV to SoundCloud in April and got an immediate response from a recruiter. We had a 20-minute Skype call when she asked me basic questions about my history and motivation. I asked her specifically about the financial stability of the company, since in the beginning of the year, SoundCloud announced it might run out of money. She told me the situation was bad but it was solved. She said: “if I didn’t believe in the future of the company, I wouldn’t work here”. I believe she wasn’t lying. She had no idea what was about to come.

Continue reading ....

Organize your errors

There are two types or programmers: Those who handle errors properly, and those you don’t want to work with.

Windows BSOD

It’s happening over and over again. Something has stopped working and I need to fix it. After tens of minutes of debugging and diving deeper into the code base, I finally find it. Someone (including several-years-ago myself), ignored an error and left it unhandled.

Continue reading ....

CocoaHeadsCZ officially started 🎉

The CocoaHeadsCZ opening party happened on 6.4.2017 and we had a lot of fun!

Opening party

We met at a lovely place called Bistro Arte. We managed to discuss a lot of important things for the future of CocoaHeads in Prague, and also had a couple of beers.

Continue reading ....

Array Rotation - Programming Interview Problem (II.)

Today, we’re going to focus on another famous programming interview problem - Array rotation. We start with a simple “obvious” solution and move to more optimized and interesting one afterwards.

Why did programmer quit his job?

The problem: Rotate an array of n elements to the right by k steps. For example, with n = 6 and k = 3, the array [1,2,3,4,5,6] is rotated to [4,5,6,1,2,3].

Continue reading ....

Hamming Distance - Programming Interview Problem (I.)

This is the first post of a small series focused on common technical interview challenges. You can find a lot of articles and StackOverflow answers on the similar topic. However, I would like to focus on a Swift-first approach and detailed explanation. Fore the sake of curiosity, I will also show an Objective-C version of the final algorithm. I’m going to use problems from the awesome website LeetCode. So let’s start!

Hamming distance - 3 bits (Image source: Wikipedia)

The problem: Given two integers x and y, calculate the Hamming distance. The Hamming distance between two integers is the number of positions at which the corresponding bits are different.

Continue reading ....

Testing Gesture Recognizers

Testing code that interacts with UIKit is a pain. UIKit is full of hidden states and dependencies, so you soon end up fighting the framework and trying to bend it the least hackiest way possible. Because it’s always easier to blame someone else, the test-unfriendly environment that Apple has built for us could be one of the reasons why iOS developers are still not yet such passionate unit testers.

I find your lack of unit tests disturbing

I was recently searching for a way of how to easily test the interaction between UIViewController and UIPanGestureRecognizer. It was easier than I thought! In fact, I ended up very surprised by the readability and brevity of the final code.

Continue reading ....

Simple Custom Array Implementation -- vol.2

Two weeks ago, I wrote about my attempt to implement a very simple Array-like structure during a two hours flight without an Internet connection. I had to use NSData as the underlying storage, because I had no experience working with UnsafeMutablePointers in Swift, and I wasn’t able to figure it out without Google.

I will not accept that

Of course, I wasn’t happy with the result! So I tried to implement it again. This time with an Internet connection and proper manual memory management.

Continue reading ....

Offline coding challenge - Array-like struct

I visited Moscow last weekend with my girlfriend. This was my first trip to Russia, and it was a really interesting experience. Especially our visit to the Museum of Cosmonautics, which I’m a big fan of. Anyway, I decided to spend the time on the plane back to Prague by learning and relearning some basics in computer science – data structures and algorithms.

While reading about arrays, I remembered one article I read a while back about Swift Array implementation (this one). I was offline on the plane, and I couldn’t read the article. I had two hours left of the flight and no Internet connection, so I decided to try to implement it by myself.

Challenge accepted!

Continue reading ....

Another world of Notifications - Darwin Notifications

As an iOS developer, you are probably familiar with the concept of notifications and the way it’s represented by NSNotification and NSNotificationCenter in CocoaTouch. These objects are part of the Foundation framework. Because Foundation is built on top of the CoreFoundation framework, it’s not surprising that there is a CF “version” of NSNotificationCenter called CFNotificationCenter. It can be super fun to use it, because it offers you some cool additional functionality.

Darvin approved!

Continue reading ....

Playing with properties - 3 facts I didn't know

I experienced a very interesting bug in our code last week. Our unit tests from time to time froze. It only happened when we ran some of our test groups separately. When we ran the full test set, everything was OK. We have a lot of untestable legacy code in the project – singletons, missing dependency injections, weird code coupling.

Help me StackOverflow ...

Continue reading ....