C Rules Engine Javascript Interview Question