Photo by 贝莉儿 DANIST on Unsplash

After working in Amazon for one and half years, I have been promoted to SDE II, which level I was told “You almost meet” during the interview.

I am writing this article to summarize what I have done to get promoted and share it with you all. Hope you enjoy it.

Background

I joined Amazon in July 2019. Before that, I had worked as a full-stack developer in China for 3 years. My major responsibility was Android development, I also had rich experience in React/React Native/PHP/Java Backend, etc.

Firstly I was interviewing for a job as an Android Developer SDE II…


AWS Lambda/NodeJS (TypeScript) Series

  1. How to Use TypeScript for AWS Lambda in 3 Steps
  2. Unit Test and Integration Test for AWS Lambda/NodeJS in TypeScript

Preparation

We are going to use jest to manage all the tests. In order to use jest with TypeScript, we will have to install some babel dependencies. Please check the installation commands below:

// install jest and types
$ npm i -D jest @types/jest
// install babel support to use jest with typescript
$ npm i -D babel-jest @babel/core @babel/preset-env @babel/preset-typescript

We install them in dev-dependencies because they are only used during testing, not in the final built package. After installation…


AWS Lambda/NodeJS (TypeScript) Series

  1. How to Use TypeScript for AWS Lambda in 3 Steps
  2. Unit Test and Integration Test for AWS Lambda/NodeJS in TypeScript

Situation

When we are using NodeJS as the runtime for AWS Lambdas, JavaScript is the default language. However, due to the lack of typing checking in JavaScript, from time to time, buggy code is deployed to Lambda inadvertently. Such as a small typo like this:

exports.lambdaHandler = async (event, context) => {

const queries = event.queytStringParameters;

// ...
}

We mean to get queryStringParameters, but the queries ends up undefined as a result of carelessness.

Goal

We want to utilize TypeScript to…


Background

Recently I have been using Redux/Saga to handle massive state changes across React components, and found something interesting about Saga. Given the code below:

function* baum() {
yield delay(300).then(() => console.log(1))
yield console.log(2)
yield delay(200).then(() => console.log(3))
yield console.log(4)
}

const b = baum()
b.next()
b.next()
b.next()
b.next()

The output in Saga is:

1
2
3
4

However, if I run it directly in local Node, the output is:

2
4
3
1

You could try it on your self at: https://repl.it/repls/DefiantWhirlwindNotifications

Why is that? And how does Saga execute the asynchronous calls in a synchronous manner? Please read on.

Understand YIELD in Javascript


Architecture Graph of APIGateway-Lambda-DDB

Recently, I have been working on setting up WebSocket connection service with AWS ApiGateway/Lambda/CloudFormation, and found it hard to accomplish only with http://docs.aws.amazon.com/.

Although AWS has given some nicely written blogs (links here, here and here) about how to set up a WebSocket API, but it is done with AWS Console UI and mouse clicking. Since it is not based on CloudFormation, we could not pipeline it or maintain it in a professional developer way.

This article will introduce how to create a WebSocket ApiGateway Chat service, and explain the CloudFormation template files so that you can create your own…


Days ago, out PM asked me to draw an animated strike through line over the TextView. While I found nothing available after some search, I decided to make one on my own: ExTextView.

Let’s take a look at the final effect:

My code is here.

I will list some difficulties during the programming and my solutions to them below. By solving these problems, I got myself a better understanding of how Android TextView measures and draws itself.

How to determine the middle position of a line of text?

At the beginning, I took it for granted that the position of strike through should ideally be at the 0.5 of the line…

Zijing Zhao

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store