WeRide·Software Engineer·Technical Phone Screen
Apr 2026
WeRide software engineer interview with a pretty gnarly string/expression parsing problem. The main challenge was the O(1) space constraint on the base version, which is brutal, and then a follow-up that relaxed it to O(n) but added way more complexity to the input format.
- Given an expression with lowercase letters, '+', '*', and parentheses where '+' never appears outside any parentheses, return an equivalent expression using only '+' by fully expanding all products (e.g., (a+b)*(c+d) becomes ac+ad+bc+bd). The catch: achieve this with O(1) extra space.
- Follow-up: now '+' can appear outside parentheses too, like in 'a+b*c*(d+e+f)+k+m*(g+h)+i'. Output the fully expanded form. You can use O(n) extra space, such as a stack.
“The expansion logic itself isn't too bad once you think of it as distributing terms across parenthesized groups.” The rest of the author's notes on Software Engineer interview at WeRide, Technical Phone Screen round, covers how they worked through the question, what the panel pushed back on, and what they would do differently.
View Post