Given a singly linked list of size N , how do u delete an element which is M th from the end?
This is a favorite question of the interviewers , try to explain your solution on a sheet of paper and then write a piece of code for the same.
Keep two variable's , say var1 and var2.
let the var1 run for m times into the list. then start the var2 from the beginning ,now run var1 and var2 simultaneously in a loop till the var1 becomes null (end of list).