Bloomberg L.P.

  www.bloomberg.com
Work in HR? Unlock Free Profile

Bloomberg L.P. Financial Software Developer Intern Interview Question

I interviewed in Pittsburgh, PA and was asked:
"Linked list memory management: deleting a node from the middle of a list was easy. Next question - how to delete a node from the end of a list. Was too tired to think and realize this was a trick question."
Tags: technical
Add Tags [?]
Answer

Part of a Financial Software Developer Intern Interview Review - one of 1,731 Bloomberg L.P. Interview Reviews

Answers & Comments

0
of 0
votes
You can't, since the pointer already points to null. No way around it.
- Interview Candidate on Mar 13, 2013
1
of 1
vote
Disagree,

Instead of 1 use 2 pointers, having pointer 1 one step ahead of pointer 2, once pointer 1 points to NULL, use pointer 2 to remove the last node.
- Tinus on Mar 30, 2013
0
of 0
votes
It depends. on how the link-list is implemented.
- Xiaoge Su on Jul 15, 2013
0
of 0
votes
check node->next->next equals to null or not, then can just update node->next = null
- Sashi on Oct 15, 2013
0
of 0
votes
I guess this question makes sense only when we don't know the Head node !
- Sachin on Dec 2, 2013

To comment on this question, Sign In with Facebook or Sign Up

Tags are like keywords that help categorize interview questions that have something in common.