014.Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings.

Read More

013.Roman to Integer

Given a roman numeral, convert it to an integer.

Read More

Container With Most Water

Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the container contains the most water.

Read More

010.Regular Expression Matching

Implement regular expression matching with support for ‘.’ and ‘*’.

Read More

ZigZag Conversion

The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)

Read More

How to Design the Backend of WeChat

Notes from Tiger’s Lecture

Read More

026.Remove Duplicates From Sorted Array II

Follow up for “Remove Duplicates”:
What if duplicates are allowed at most twice?

Read More

Remove Duplicates From Sorted Array

Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.

Do not allocate extra space for another array, you must do this in place with constant memory.

Read More

Java Interview Questions

未整理

Read More

System Design Reading List

Why do we need system design

Read More

Dice Game Probability

You are playing a game of dice with a friend. Your friend will roll one die, and you must pay the hunber of dollars for the number they roll. What should you charge you friend to play this game, if you want to break even in the long run? This value is the “fair value” of the game. It’s easy to see that for a one roll game, the fair value is 3.5

Read More

3D Array Size

Given a number, return true if this number is the total number of elements in a 3D array or false if it’s not. For each dimension, the number of elements should be at least 2, i.e., the smallest number that is the size of a 3D array is 8.

Read More

Notes for Harvard CS75 Web Development Lecture 9 Scalability by David Malan

Lecture 9 video

Read More

326.Power of Three

Given an integer, write a function to determine if it is a power of three.

Follow up:
Could you do it without using any loop / recursion?

Read More

219.Contains Duplicate II

Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and j is at most k.

Read More