Compare heap and stack memory | LinkedIn Interview Question