Swift Memory Management

When an object references another object in memory a reference counting is initiated for memory management. This is handled for you by ARC, automatic reference counting. Increasing and decreasing on the count of references when one object is referred or the relation is nil and this makes ARC release it from memory (deinit). By doing this references, there are known cases where a reference cycle might occur never calling deinit on both objects, therefore never being released from memory.

Observer Pattern

The observer pattern let’s an object observe the changes notified by another object.

Memento Pattern

Memento Pattern captures the current state of an object and store it in such a way that you can retrieve it at a later time when you would like to return to the previous state.

Strategy Pattern

Strategy Pattern consists of defining different objects that conform to a strategy protocol and can be set or be interchangeable at runtime while being used by an object.

Delegation Pattern

The delegation pattern allows an object to use a helper object to perform a task, instead of doing the task itself.

Two Pointers

1. Pair with Target Sum

Intro to System Design Architecture

Motivation: While designing a scalable architecture we have to keep so many things in mind. To make this learning process easier (and in a incremental manner) I’ll be summarizing books/courses I start reading and writing from personal experience.

Sliding Window Pattern II

Welcome to the next part of solving ‘Sliding Window’ problems part II! I’ll continue at the same level as the previous post and gradually increase complexity.

Sliding Window Pattern I

The following pattern evaluates slidding windows within an array/string/linked-list. We keep a sub-window of evaluation and when a condition is met, it ‘slides’ to the right.

Hello World

Hello stranger, welcome to my blog.