Rotate an Array in place

The interesting things that you would face during Interviews are mostly in the form of puzzles and challenges. These are meant to not tickle your brain but instead it can stump you. On top of that, if you really give it a thought, some of these questions or scenarios are based off bad architecture and […]

Rules Based Fizz Buzz

If you have interviewed at any point recently, then you might have come across the FizzBuzz problem. No, it is not to do with long term storage of your open cola bottle. It is based on a childhood game (I knew of a variant, not FizzBuzz) the idea is simple, you stand in a circle […]

Solving Spotify puzzles using Swift

You must have at some stage attempted to learn about algorithms and searched for puzzles to write algorithms for to solve. There are three interesting puzzles laid out by Spotify at https://labs.spotify.com/puzzles/. We shall have a look at solving those using Swift

Validating Strings for Numbers

Swift is gaining popularity with Developers and as companies are considering Swift for their projects. Over a period since the publication of my Swift book (at Swift v1.2) there are many that keep up to date with the new features in Swift and there are those that are now considering the move to Swift or […]

Convert Binary String to Integer

How do you convert Binary String to it’s Integer Value? There are many approaches to convert Binary strings to Integers. One approach could be to iterate through all of the characters in the string and add the value of 2 raised to the power of the index.

Chaining cout in swift like C++

In an earlier article, we discussed the possibility of adding a cout like functionality in Swift as seen in C++ (http://swift.oz-apps.com/2015/04/using-a-cout/). There were a couple of impediments that prevented the full functionality of our cout function. Let us revisit that and add chaining

WIP: Use Swift Arrays like Lua Tables

This is work in progress and there are somethings that Swift cannot do where as Lua excels with them. Since everything in a Lua table is a reference or a pointer, you can recursively add table to refer to subtables. You could also store functions in the tables and invoke them based on the key. […]