DataDriven
LearnPracticeInterviewDiscussDailyJobs

Full Circle

A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
medium
Seniority
L3

Problem

A linked list is stored compactly as an array where `next_pointers[i]` holds the index of node `i`'s successor, or `-1` when node `i` is the tail. Starting at index 0 and following these pointers, return whether the walk ever returns to a node it already visited instead of terminating. A pointer that lands outside the array counts as a terminating tail, the same as `-1`.

Summary

Follow the chain long enough and you might end up where you started.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.

Related

  • All Practice Problems
  • Mock Interview Mode
  • Python Interview Questions
  • Data Engineering Interview Prep Guide
  • Daily Challenge
  • Data Engineering Lessons