About Me - The Short Story

I am a lonely Python/C++ coder with a background in financial markets and an interest in modern art. I am an application-driven guy, not a computer scientist. Sure I have many gaps in my knowledge, but I strive to do my best to fill them. I keep learning new things, listening to smart guys, correcting my mistakes, and pushing myself to the limits. I enjoy it.

I will use this website both as a blog and as a hub to some of my projects. It is written from scratch in Python's Flask, my favourite web-framework.


Find the value of the n-th element in the Fibonacci sequence

One thing I happen to see many times in interviews, coding challenges, or tutorials on recursion is the Fibonacci sequence. It is a coding evergreen. Fibo is a famous series of numbers where each element is the sum of the two previous. The...

c++ 
algorithms 
recursion 


Find N largest or lowest values with heapq

You have a collection of items and you need to keep the N highest or lowest of them. Instead of writing your own algorithm, use build-in heapq module.

This module has two handy functions, nlargest(), and nsmallest().

This is...

python 
data-structures 
algorithms 


Append an element to a C-style array

C-style arrays might be tricky. Even such a trivial task like appending an element might surprise you. It actually surprised me a few times. I do not use raw array in day-to-day programming, I always prefer vector or std::array if I need a...

c++ 
array 
algorithms 


Normalize strings in a container effectively

Having a container of string (vector of emails) and you need to make all the letters uppercase or lowercase or perform whatever else. 

You want to do it as effectively as possible, no copying, no raw loops. Quite a typical use...

c++ 
stl 
algorithms 


Convert decimal to a different numerical system

Humans use decimal numbers, computers use binary numbers. A common testing task is to write a function that converts a decimal number to a binary. There is no stl algorithm for that.

But why to stop here, why not to write a function...

c++ 
algorithms 
recursion