Google Interview Question
Software Engineer / DevelopersCountry: Israel
Interview Type: In-Person
I am assuming that it would be expecting expressions say:
P+30 (exceed pressure by 30 P)
S-10 (reduce speed by 10) and so on...
Ya @amitpetkar ji, for that we need to put some constant value for s and p right? so that we can exceed or reduce the speed n pressure by giving the expression as u noted, p+30..but its not user friendly at any way..
Moreover there should be a global way of storing them, you may want to remember the earlier state of the system before actually executing the newer values. Perform sufficient checks to ensure that pressure and speed are always positive at any given time (real time scenario). If the state of the system changes to negative values after performing the operation we may simple raise error.
More details please..were you expected to solve an arithmetic equation of type 10A+20B = X etc?
- Roxanne December 30, 2013