JVM Architecture
Reference from JVM Architecture – Understanding JVM Internals OverviewEvery Java developer knows that bytecode will be executed by JRE (Java Runtime Environment). But many doesn’t know the fact that Interpreter is the implementation of Java Virtual Machine (JVM), which analyzes the bytecode, interprets the code and executes it. It is very important as a developer we should know the Architecture ...
Read more
Twitter Design
Problem clarify No one expects you to design a real twitter in 50 minutes. You need to focus on several core features first then dive deep. Interviewer will guide you to specific field to get some property of you. Core features Tweeting Timeline User Home Following Naive solution (Synchronous DB queries)Two Tables - User Table ID Name ….. ID1 Name1 ….. ID2 Name2 ….. ID3 Name3 ….. ...
Read more
Shorten url system design
OverviewDesign a url shortening service. like bit.ly. Use case Shortening: given a url -> return a much shorten url. Redirection: take a shorten url -> redirect to the original url. Custom url. High availability of the system. Tasks break down New urls per month: 100M. 1 billion request per month. 10% from shortening and 90% from redirection Request per second: 400 (40: shortens; 360:redire ...
Read more
Http response status code
Reference from MDN Web docs OverviewHTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes: informational responses, successful responses, redirects, client errors, and servers errors. Status codes are defined by section 10 of RFC 2616. Information responses100 ContinueThis interim response indicates that everyth ...
Read more
Leetcode 1-10
1. Two Sum🍏🍏🍏 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. Example: 1234Given nums = [2, 7, 11, 15], target = 9,Because nums[0] + nums[1] = 2 + 7 = 9,return [0, 1]. Solution 1:123456789101112131415class Solution { public ...
Read more
Homebrew Instruction
Homebrew Cask Reference from Homebrew Cask Repository Homebrew Cask extends Homebrew and brings its elegance, simplicity, and speed to the installation and management of GUI macOS applications such as Atom and Google Chrome. Install Java8 shows as below(results may various based on your env property):12345678910111213141516171819202122232425262728293031323334~ brew cask install java8Updating Home ...
Read more
Java FAQ
Why would the ‘final’ keyword ever be useful?final expresses intent. It tells the user of a class, method or variable “This element is not supposed to change, and if you want to change it, you haven’t understood the existing design.” This is important because program architecture would be really, really hard if you had to anticipate that every class and every method you ever write might be changed ...
Read more
How to install Java 8 with Home Brew
Reference from How to install Java 8 with homwbrew Don’t rely on Oracle to install Java properly on your Mac. Use Homebrew. this will install the latest jdk: 1brew cask install java If you want to manage multiple versions of Java on your Mac, consider using jenv. UPDATE: Now that Java 8 is no longer the most current version, if you want java 8 install it this way: 12brew tap caskroom/versionsbre ...
Read more
Edit Application
OverviewThese are all the folders and files the Angular CLI created for you. This is your entire Angular project. Project dependenciesOne of the most important files is Package.json which is your dependency configuration file.Here you can see all the dependencies of your project like Angular 6 and these are third-party packages your project needs to run correctly.All devDependencies are only requi ...
Read more
First Application
Reference from Angular Quick Start Angular CLIOverviewhe Angular CLI is a tool to initialize, develop, scaffold and maintain Angular applications. Getting StartedTo install the Angular CLI:1npm install -g @angular/cli Generating and serving an Angular project via a development server Create and run a new project:123ng new my-projectcd my-projectng serve Navigate to http://localhost:4200/. The ap ...
Read more