Simple Logic IT interview question

Oop , basic coding, aptitude