August 23, 2020

Go Interview Question #3 - Write a function that checks if brackets are balanced

Another very common interview question, is to check if brackets are balanced in a string. If you have never done any stack questions before, this can be tricky. But, once you see how a stack can be used, it becomes very straightforward. Let’s look at what balanced brackets look like: “(())()”, “((()))”, “()”… Unbalanced brackets: “(((”, “())”, “(()”… A stack is like a can of Pringles, the last chip that was put into it, is the first to come out. Read more

May 16, 2020

Go Interview Question #2 - Write a function to check if a string is a palindrome

This question is very common on interviews, and while fairly straightforward, plenty developers mess it up on the interview. What is a palindrome? Webster dictionary defines it as a word, sentence or number that reads the same forwards and backwards. Some examples are: dad, 1881, abba. There are a few approaches to solving this problem, we can reverse the array of characters and compare the resulting string for example. The more efficient way of doing this is to compare the characters from the beginning and from the end one-by-one. Read more

May 6, 2020

Go Interview Question #1 - Find all the prime numbers less than or equal to 'n'

As a means of keeping my logic sharp and helping others prepare for Go interviews I decided to release a solved interview question every week or so. In this post, let’s write a function in Go that generates us all the primes at or below a specific integer. To even attempt this question, we need to know the exact definition of a prime number. According to Wolfram, A prime number is a positive integer p>1 that has no positive integer divisors other than 1 and p itself. Read more

April 15, 2020

Chunked File Upload using TypeScript, React, and Go

Why you may want to chunk files? The biggest reason for me to upload files in chunks, is because I want to upload very large files; pictures, videos, whatever… This means, I want to know the status of the upload as it progresses and if I can’t finish the upload now, I want to be able to pause, go to my favourite coffee shop and continue on there. Let’s build a simple app using no additional javascript libraries! Read more

December 29, 2019

Golang Microservices Part 2 - PostgreSQL with gorm

Setting up GORM Continuing from the app we created in Part 1 PostgreSQL is one of the most popular database choices today because it is free and has most of the features that the big guns like Microsoft SQL Server and Oracle offer. To connect our microservice to PostgreSQL, we can simplify our life by using an ORM for GO called GORM… GO-ORM get it? via GIPHY Let's upgrade the gRPC microservice we created in Part 1 to use an actual database instead of just cache. Read more

November 29, 2019

Golang Microservices Part 1 - gRPC Communication

Summary - Setting up gRPC communication gRPC is a modern, highly-efficient method of communication between systems built by Google. gRPC uses the new and efficient HTTP/2 network protocol as well Google’s Protocol Buffers (Protobuf) method of serialization which allows for more light-weight and predictable communication. Protocol Buffers can be used with any technology stack out there; code can be generated from the .proto file for nearly every programming language available. Read more

October 19, 2019

KrakenD: Writing Plugins using Golang

Summary KrakenD has caught my attention as a Gateway solution because of its claim at incredible performance and extensibility. It is Open Source and can be tailored to your needs or can be extended in a convenient way with its support for Golang Plugins. Plugin, what? Go plugins are a fairly new addition to Golang (support starting with Go 1.8), but they provide a very innovative way to add functionality to a Go application. Read more

August 4, 2019

Use Golang to Upload Files to Azure Blob Storage

If you are enjoying Go and its community as much as myself but have been using the Azure Cloud Platform for some time already, you will probably want to use Azure Blob Storage at some point. In that case, this blog post is for you. You will need: The first thing you need to do is make sure you set up your blob storage account in Azure Portal and create a blob container. Read more

June 3, 2019

Make Multiple Api Calls At The Same Time With GoRoutines

Golang is efficient, very efficient. Much of this efficiency is attributed to its unique abstractions when dealing with concurrency. Java for example, maps its threads to OS threads, while Go uses its own goroutines scheduler to further abstract its lightweight goroutines from OS threads. In short, Golang is very frugal with how it uses OS threads; if a goroutine becomes blocked, Go’s scheduler will switch in another goroutine in its place to keep the thread busy as much as possible. Read more

© Ilya Nemtsev 2019

Powered by Hugo.