Bloomberg L.P.
3.2 of 5 1,025 reviews
www.bloomberg.com New York, NY 5000+ Employees

Bloomberg L.P. Financial Applications Developer Interview Question

I interviewed in New York, NY and was asked:
"Is there any algorithm to verify whether a linked list is circular or not?"
Add Tags [?]
Answer Flag Question

Part of a Financial Applications Developer Interview Review - one of 1,601 Bloomberg L.P. Interview Reviews

Answers & Comments

0
of 1
vote
Start from the head of the Linked List. Store this head in a reference (in Java) or pointer (in C, C++). At every node check if next is pointing to the same location as that of the temporary reference or pointer of the head. If yes, stop and declare "Circular". Else if the next is null, stop and declare "Not Circular". Else if next is not same as head and is not null, repeat the same process on that next node.
- Anonymous on Jan 15, 2014 Flag Response
0
of 0
votes
We maintain two pointers initialized to the head of the Linked list. Name the two pointers as slow and fast. Slow pointer is advanced once at each step and the faster pointer is advanced twice at each step. If the two pointers meets i.e. points to the same node in the list at some point of time, there is a loop in the list or else if the fast pointer reaches the end of list without overlapping with the slow pointer, then the Linked list is loop free.
- Anonymous on Jan 21, 2014 Flag Response

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


Bloomberg L.P. – Why Work for Us?

Bloomberg’s global mission is to help individuals, enterprises and governments make smarter, faster, more profitable decisions — first. In order to get there, we need constant ideas, energy, innovation— which is where… Full Overview

Provided by employer [?]

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

Glassdoor is your free inside look at Bloomberg L.P. interview questions and advice. All interview reviews posted anonymously by Bloomberg L.P. employees and interview candidates.