Deloitte interview question

2 coding questions , pattern printing and question related to stacks