W01 - Approaches to Solving Complex Problems
On Friday night I was talking with Yunfei about a rather tricky issue in e-commerce PC sites. I remembered I had written a blog post about this before, so I opened the blog I hadn’t touched in five years.
Many years gone, it felt both familiar and a little embarrassing. Back then my work was lighter and I was eager about the internet, so in my spare time I made a blog and liked to show off what I thought were deep but were actually just neat little technical tricks. Skimming through it, I joked to myself that these days it’s hard to settle down and write that kind of content — now I only think about whether something can make money.
If there’s anything now that still gives me a bit of pride, it’s the domain I registered back then. Few people know about the .wang top-level domain, and my surname happens to be Wang. So I own a domain that matches my English name exactly — globally unique, no need for numbers, and always HTTPS.
Back to the point: that tricky issue I mentioned earlier gave me some new insights today.
First, what is the problem like. JD’s PC homepage, the concave-convex layout, hasn’t seen major iterations for three or four years. It hides many timeless elements, such as the classic category selection area on the left side of the screen. When your mouse hovers over a primary menu item, the secondary menu displays in a linked panel beside it. So as the cursor moves across the primary menu list, the secondary menu updates in real time to follow. Interestingly, when you move the mouse toward a specific secondary menu, the primary items the cursor passed over do not trigger secondary switches — you reliably select the secondary category you want.
At first glance it seems almost AI — a fairly complex problem. If one frames it as analyzing the mouse movement path in real time to infer the user’s true intent, many people would pursue solutions along that line.
In fact, after analyzing and generalizing the requirement, it reduces to determining whether a point lies within a triangle. A picture is worth a thousand words: when you select “Primary Nav 1,” and the mouse moves through the illustrated triangle while heading to choose a specific secondary menu, you can suppress linked responses for the intermediate primary items or delay switching.
There are many ways to determine whether a point is inside a triangle; a classic solution uses vector cross products. Implementing basic vector operations in code is straightforward — just combinations of additions, subtractions, multiplications, and divisions.
That is the problem. Below are some new thoughts. I divide the process of implementing this requirement into four stages.
First is concretizing the requirement. The requirement must be clarified, decomposed, and made as concrete as possible.
Second, translate the decomposed requirements into a problem — this is a domain-specific, model-building process. For example, in software engineering you map requirements to a computable, programmable model. Looking back, this step is more critical than the later “how to do it.” The ability to translate a requirement into “determine whether a point is inside a triangle” is a higher-order skill for engineers.
Next comes the question of how to do it. The output of the previous step is a model — it could be a mathematical, physical, or statistical model. What we need to do is connect different disciplines and fields. For instance, if you don’t know how to test whether a point is inside a triangle, consult someone strong in math. A large, complex problem may span multiple domains, so this is a process of networking resources.
Finally, there is the implementation process. Most of our time is spent on implementation and engineering — modularization, standardization, and all engineering practices — which is the area we are relatively skilled at.
Last updated