# Zero to Hero — Master Kafka Tutorial 2 (Kafka CLI Cheat Sheet)

Below is a summery of the most frequently used Kafka CLI commands that will be used.

# Zero to Hero — Master Kafka Tutorial 1 (Basic Theory)

This is the first tutorial of this series, which covers the basic concepts of Kafka

# Basic Concept — Data Topics

1. Partition: Topic splits into partitions; Each partition is a queue of messages.
2. Offset: The incremental id assigned to the message in the partition.

## Note

1. Offset guarantees the order of messages in the partition.
2. Offset (the incremental Id) is only meaningful within the partition (i.e. message with id 2 in partition 1 is not guaranteed to be older than message with id 0 in partition 2).
3. Message is kept in the partition for a limited time (default 1 week). …

# Google Interview Question— LeetCode 1055

In this blog, we will discuss an interview question asked by Google.

In this post, we are going to discuss the leetcode problem no. 1055 — Shortest Way to Form String, which is recently asked in Google interviews.

Firstly, we will try to solve the problem with brute force method in O(n²) running time; then we will improve our algorithm to O(n log n) running time; finally we will further improve the algorithm to O(n).

# Problem Analysis

The input of the problem is two strings: `source` and `target`. …

# Ace the Coding Interview — LeetCode 253

In this post, we are going to discuss the leetcode problem no. 253 — Meeting Rooms II. This problem is recently asked in Google and Amazon interviews.

# Problem Analysis

The input of the problem is a list of meeting schedules. Each meeting schedule is represented by a list of two items, with the first item as the starting time of a meeting, and the second item as the ending time of the meeting.

The expected output of the problem is an integer, which is the minimum number of meeting rooms required to fulfill the meeting schedules. …

# Data Structure and Algorithms — Implement Dynamic Array in Python

This is an introduction to dynamic array and its implementation

An array is a contiguous area of memory of equal-size elements. Array length is usually fixed, which means you need to specify the number of elements your array can hold ahead of time.

A dynamic array is an array which has an important feature: auto-resizing. With this feature, you can easily expand your array by adding more elements in it, so that you do not need to determine the size ahead of time.

In this tutorial, we will discuss about the implementation of dynamic array by using regular fixed length array. …

# Numpy Cheat Sheet

Cheat sheet on numpy

## Why use Numpy

By using built-in numpy functions such as `np.dot` will eliminate the need of a `for loop`. It enables Phyton Pi to take much better advantage of parallelism to do computations on arrays much faster.

# Python Cheat Sheet

An introduction to Python and OOP

# Understand the Math for Neural Networks

## Detailed explanation for Gradient Descent and Back-propagation in math

In this post, I will discuss details about Gradient Descent and Back-propagation in neural networks, and will help you to understand why there is Vanishing Gradient Problem. In my earlier post (How to implement Gradient Descent in Python), I discussed python implementation of Gradient Descent. In this post, I will show you step-by-step to understand the math behind the Neural Networks.

# Assumptions

For the Neural Networks discussed in the post, we will make the following assumptions:

# How to implement Gradient Descent in Python

## This is a tutorial to implement Gradient Descent Algorithm for a single neuron

Gradient Descent is the most important concept in Neural Networks. In this tutorial, I am going to show you how to implement it in Python. I hope this tutorial can help you to build a better understanding about how gradient descent works, and how it helps to improve model accuracy.

# Data Pre-Processing

We will try to build a single neuron network, which can predict the admissions of a graduate school. The data we will use is shared above in google drive. Let us first take a peek at the raw data:

# Reinforcement Learning Introduction

## An introduction to reinforcement learning problems and solutions

This post will be an introductory level on reinforcement learning. Throughout this post, the problem definitions and some most popular solutions will be discussed. After this article, you should be able to understand what is reinforcement learning, and how to find the optimal policy for the problem.

# The Problem Description

## The Setting

• The reinforcement learning (RL) framework is characterized by an agent learning to interact with its environment.
• At each time step, the agent receives the environment’s state (the environment presents a situation to the agent), and the agent must choose an appropriate action in response. … 