Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Interview Question


Some software programming languages allow compilers to perform "short cut" or "short circuit" optimizations on AND and OR operations. In a short-cut AND or OR, the second argument is not evaluated if the first argument evaluates to a controlling value. For example, in evaluating f(x) AND g(y), if f(x) is false, then g(y) will not be evaluted.
  1. Answer whether this optimization is feasible and beneficial in hardware.