A Sample code for interview questions