theory of machines gate questions