Skip to main content

How to Predict Trends?

· 3 min read

There are two ways to gain a strategic high ground that is easy to defend and hard to attack:

  1. Independent innovation
  2. Riding the wave of change

It's easy to be a hindsight expert. To make predictions, one needs to deeply understand the past and present, see beyond the surface to grasp the essence, and thus be able to extrapolate to the next steps. Unfortunately, most people can only see the present.

For example, after the television emerged in the 1950s, everyone could realize that the movie industry was struggling, but very few could predict that the next step would be the rise of independent films. Independent filmmakers could break free from traditional studio ties and focus on making good films, as only good films can attract audiences to theaters.

Cisco rode three waves:

  1. Software and microprocessors
  2. Corporate networks
  3. IP networks

Common trends include:

  1. Skyrocketing fixed costs. For instance, capital-intensive big-budget films gave rise to major film companies. The development costs of large software systems led to the emergence of big software companies.
  2. Deregulation. For example, China's reform and opening up.
  3. Prediction biases.
    1. The illusion of growth. For instance, very few can predict when a business or economy peaks and begins to decline. Growth always has an endpoint; a person who has bought one television is unlikely to buy a second immediately. ==The faster sales grow, the quicker the market saturates.==
    2. The winner-takes-all illusion. Yes, there are winner-takes-all scenarios, but not necessarily; large companies can suffer from internal issues, and external changes can occur.
    3. The winner-always-wins illusion. For example, Yahoo.
  4. Incumbent effects: reluctance to reform for short-term gains, similar to the innovator's dilemma.
  5. ==Attractor state, or "endgame thinking," is the state the market should ideally reach.==

The attractor state is an interesting new concept. Here’s a detailed explanation. It differs from a company's vision in that a vision is unique to a company, while an attractor is the equilibrium that the entire market should achieve. It has two related concepts: accelerants and impediments.

  • A typical accelerant is the "proof effect," such as Napster making people suddenly realize that 2.5MB of music could be downloaded and shared, or Bitcoin making people aware that investing in virtual currencies could lead to wealth.
  • A typical impediment example is the public's fear and opposition to nuclear power plants, despite the knowledge that nuclear energy is the trend of the future.

Let’s analyze the newspaper industry.

Take The New York Times as an example; the printing costs of newspapers are about two to three times the subscription revenue, with printing costs primarily covered by advertising. Since 2009, two problems have emerged: the rise of easily accessible new media leading to a decline in newspaper readership, and the loss of advertising to Google.

Differentiation in news media has three dimensions: space, frequency, and depth. The author of this book believes that the market's attractor leans towards specialization in these niches rather than being broad and comprehensive. In the era of internet + newspapers, from a cost-reduction perspective, The New York Times should leverage its brand to collaborate widely with various information sources rather than relying on a small number of professional journalists. The more precise the readership, the more advertising revenue can be generated.

How to Quickly Build Reputation?

· One min read

Solving the big problems that everyone wants to address but no one can is the true path of a master.

In Gu Long's novel "The Legend of the Moonlight Blade," Ding Peng quickly rises to prominence in the martial world with a single move, the Falling Star. He is highly skilled, and his fame spreads rapidly. There is a supporting character, Guo Yunlong, who is eager to restore his family's reputation and seeks advice from Ding Peng on how to become a top figure.

Ding Peng's response is not only different from traditional teachings but also insightful. He candidly states, "You can perform righteous deeds and gradually build your reputation, but that is too slow. The fastest way is to step up and solve a major crisis when it arises in the martial world, and everyone else is at a loss."

PWA for Mobile Web

· 2 min read

Why Progressive Web App?

  • can be put to home screen by Chrome and Safari
  • work offline with service workers
  • increase engagement with push notification
  • improve the conversion rate for new users across all browsers by 104% and on iOS by 82%

“Progressive” means the improvement is not binary and terminal but evolutionary.

What is it?

PWA = website optimized for mobile + manifest.json + service worker loading and registering

How to add it to your site?

manifest.json is the easy part. Put the following into the example.com/manifest.json

{
"short_name": "Short",
"name": "Longer Name",
"icons": [
{
"src": "favicon.png",
"sizes": "192x192 150x150 144x144 64x64 32x32 24x24 16x16",
"type": "image/png"
}
],
"start_url": "/",
"display": "standalone",
"theme_color": "#de4c4f",
"background_color": "#f3f3f3"
}

And add the following into html <head>

<link rel="manifest" href="/manifest.json"/>
<link rel="apple-touch-icon" href="/favicon.png"/>

Then on both iOS and Android, users can add the site to the home screen.

Then ... service worker loading and registering

The loading part I recommend create-react-app’s service worker loading script, which has good security practices and targets the cache first strategy. And it includes unregister as well.

The registering part is trickier - we added the following webpack plugin to prepare the service-worker.js.

// ...
plugins: [
// ...
new SWPrecacheWebpackPlugin(
{
mergeStaticsConfig: true,
dontCacheBustUrlsMatching: /\.\w{8}\./,
filename: 'service-worker.js',
minify: false,
navigateFallback: '/',
navigateFallbackWhitelist: [/^(?!\/__).*/],
staticFileGlobs: [
`${OUTPUT_DIR}/**`,
],
stripPrefix: OUTPUT_DIR,
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/],
dynamicUrlToDependencies: {
'/index.html': glob.sync(path.resolve(`${OUTPUT_DIR}/**/*.js`)),
},
}
),
],
// ...

The tricky part here is that if you have SSR as we do - be careful to specify the dynamicUrlToDependencies; otherwise, cache may fail to be updated.

MMRs, Neutralizers and Differentiators

· One min read

There are three types of product features

  • MMRs: minimum market requirements; basic features that every customer expects and demands
  • Neutralizers: mitigate competitive threat
  • Differentiators: competitive advantage

Customers often provide feedbacks on MMRs and neutralizers. ==The product management team must take responsibility for reinforcing the startup’s differentiator.== Once the market recognizes the startup’s advantage, every competitor will race to replicate it. The startup must invest in that differentiation to sustain their market lead.

ACID vs BASE

· One min read

ACID (Consistency over Availability)

  • Atomicity ensures transaction succeeds completely or fails completely.
  • Consistency: In ACID, the C means that a transaction pre-serves all the database rules, such as unique keys, triggers, cascades. In contrast, the C in CAP refers only to single copy consistency, a strict subset of ACID consistency.
  • Isolation ensures that concurrent execution of transactions leaves the database in the same state that would have been obtained if the transactions were executed sequentially.
  • Durability ensures that once a transaction has been committed, it will remain committed even in the case of a system failure (e.g. power outage or crash).

BASE (Availability over Consistency)

  • Basically available indicates that the system is guaranteed to be available
  • Soft state indicates that the state of the system may change over time, even without input. This is mainly due to the eventually consistent model.
  • Eventual consistency indicates that the system will become consistent over time, given that the system doesn't receive input during that time.

Although most NoSQL takes BASE priciples, they are learning from or moving toward ACID. e.g. Google Spanner provides strong consistency. MongoDB 4.0 adds support for multi-document ACID transactions.

Will Larson's Lessons from Digg v4 catastrophic launch

· One min read

Digg v3.5 to v4 catastrophic launch was actually pretty ambitious. Digg had been devastated by Google's Panda algorithm update. And Launching v4 was their chance to return to their rightful place among the giants of the Internet.

So there is no rollback plan and unnexpected scale problems occurred.

  1. there was Cassandra bottleneck -> implemented write-through-cache memcache
  2. however, MyNews page was still broken every four hours
  3. rewrote MyNews in Redis and keep deleting the excess data in secret to keep the site running
  4. it took a month to track down the bug in the Python tornado backend service, and there is some kind of API that uses mutable default value as an argument like
def get_user_by_names_or_ids(names=[], ids=[])

This causes memory leak - If you mutate those params, the mutations span across invocations. Accumulated data even blows up the memcache clusters.

Replica, Consistency, and CAP theorem

· 2 min read

Why replica and consistency?

large dataset ⟶ scale out ⟶ data shard / partition ⟶ 1) routing for data access 2) replica for availability ⟶ consistency challenge

Consistency trade-offs for CAP theorem

CAP Theorem

  • Consistency: all nodes see the same data at the same time
  • Availability: a guarantee that every request receives a response about whether it succeeded or failed
  • Partition tolerance: system continues to operate despite arbitrary message loss or failure of part of the system

Any networked shared-data system can have only two of three desirable properties.

  • rDBMS prefer CP ⟶ ACID
  • NoSQL prefer AP ⟶ BASE

"2 of 3" is mis-leading

12 years later, the author Eric Brewer said "2 of 3" is mis-leading, because

  1. partitions are rare, there is little reason to forfeit C or A when the system is not partitioned.
  2. choices can be actually applied to multiple places within the same system at very fine granularity.
  3. choices are not binary but with certain degrees.

Consequently, when there is no partition (nodes are connected correctly), which is often the case, we should have both AC. When there are partitions, deal them with 3 steps:

  1. detect the start of a partition,
  2. enter an explicit partition mode that may limit some operations, and
  3. initiate partition recovery (compensate for mistakes) when communication is restored.

Load Balancer Types

· One min read

Generally speaking, load balancers fall into three categories:

  • DNS Round Robin (rarely used): clients get a randomly-ordered list of IP addresses.
    • pros: easy to implement and free
    • cons: hard to control and not responsive, since DNS cache needs time to expire
  • Network (L3/L4) Load Balancer: traffic is routed by IP address and ports.L3 is network layer (IP). L4 is session layer (TCP).
    • pros: better granularity, simple, responsive
  • Application (L7) Load Balancer: traffic is routed by what is inside the HTTP protocol. L7 is application layer (HTTP).

B tree vs. B+ tree

· One min read

B tree vs. B+ tree

Pros of B tree

  • Data associated with each key ⟶ frequently accessed nodes can lie closer to the root, and therefore can be accessed more quickly.

Pros of B+ tree

  • No data associated in the interior nodes ⟶ more keys in memory ⟶ fewer cache misses
  • Leaf nodes of B+ trees are linked ⟶ easier to traverse ⟶ fewer cache misses

Experience Deep Dive

· 4 min read

Intended Audience

Moderate experience or less, or anyone who was not in a leadership or design position (either formal or informal) in their previous position

Question Description

Describe one of your previous projects that was particularly interesting or memorable to you. Followup questions:

What about it made it interesting? What was the most challenging part of the project, and how did you address those challenges? What did you learn from the project, and what do you wish you had known before you started? What other designs/implementation methods did you consider? Why did you choose the one that you did? If you were to do the same project over again, what would you do differently?

Interviewer tips

Since the goal here is to assess the technical communication skill and interest level of someone who has not necessarily ever been in a role that they could conduct a crash course in, you should be prepared to keep asking them questions (either for more details, or about other aspects of the project). If they are a recent grad and did a thesis, that's often a good choice to talk about. While this question is in many ways similar to the Resume Questions question from phone screen one, this question is intended to be approximately four times as long, and should get into proportionally more detail about what it is that they have done. As such, the scoring criteria are similar, but should be evaluated with both higher expectations and more data.

Scoring

A great candidate will

  • Be able to talk for the full time about the project, with interaction from the interviewer being conversational rather than directing

  • Be knowledgeable about the project as a whole, rather than only their area of focus, and be able to articulate the intent and design of the project

  • Be passionate about whatever the project was, and able to describe the elements of the project that inspired that passion clearly

  • Be able to clearly explain what alternatives were considered, and why they chose the implementation strategy that they did.

  • Have reflected on and learned from their experiences

A good candidate will

  • May have some trouble talking for the full time, but will be able to with some help and questions from the interviewer

  • May lack some knowledge about the larger scope of the project, but still have strong knowledge of their particular area and pieces that directly interacted with them

  • May seem passionate, but be unable to clearly explain what inspired that passion

  • May be able to discuss alternatives to what they did, but not have considered them in depth

  • Have reflected on and learned from their experiences

A bad candidate will

  • Have difficulty talking for the full time. The interviewer may feel as if they are interrogating rather than conversing with the candidate

  • May lack detailed knowledge of the project, even within the area that they were working. They may not understand why their piece was designed the way it was, or may not understand how it interacted with other systems

  • Does not seem very interested in the project - remember that you are asking them about the most interesting project that they have done, they should be very - interested in whatever it was

  • May not be familiar with potential alternatives to their implementation method

  • Does not seem to have learned from or reflected on their experiences with the project. A key sign of this is that the answer to 'what did you learn' and 'what would you do differently' are short and/or nearly identical.