View All num of num See all Photos Amazon.com www.amazon.com Engaged Employer Overview Reviews Salaries Interviews Jobs Photos Benefits 4.6k Reviews 11k Salaries 6.0k Interviews 10k Jobs Follow Add Interview Follow Add Interview Interview Question Software Development Engineer I Interview Seattle, WA Amazon.com Remove the nth from last element in a singularly linked list in linear time. Tags: See more , See less 8 Answer Add Tags Answer Interview Answer 3 Answers ▲ 0 ▼ The general idea is to keep a pointer n elements back from the current element as you're traversing the linked list looking for the last node. There are some edge cases when coding it. O(n) time, O(1) space. Interview Candidate on Jan 13, 2012 ▲ 0 ▼ How about? Traverse once find length. Then find n-kth element. Still linear complexity in time and 0 addl space kvr on Feb 20, 2012 ▲ 0 ▼ That works too. The first way you only traverse once though. Jordan on Feb 20, 2012 Interviews > Software Development Engineer I > Amazon.com Add Answers or Comments To comment on this, Sign In or Sign Up.