Nissan Interview Question

basics of oops concept. logical question