← Samsung questions
CodingReported in a candidate post, Sep 2018

Suggest friends of friends and detect cycle in directed graph

Filed under Samsung

Given a directed graph representing a social network, implement functions to detect cycles in the graph and suggest friends of friends of friends (3 degrees of separation) to a user.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Samsung questions

Collected from public candidate posts and coding forums. Updated Nov 2026.