Solved both the codes error free. Phone wasn't clear, so I asked interviewer to type every question on the collabedit. Don't know what went wrong. I thought I did well. I didn't speak much as the phone wasn't clear. Maybe that did some harm. Speak as much as you can, don't make any code typos. Practice before on collabedit to get used to UI.