Interview Question

Interview(Student Candidate)

-Asked to write a function to find the start point of

  "$" and ";" in a string -Asked to write a regular expression to find text between "$" and ";" unless there was a space after "$". -How do you know if a linked-list is circular (even a middle item could point to one of the previous items) if you know its size?

Interview Answer

1 Answer


For the linked-list, use a counter every time you move to the next item. If the counter increases beyond the size of the linked list, it's circular.

Interview Candidate on Mar 14, 2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.