PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCareers

Quick Overview

This question evaluates competency in relational data manipulation and graph-style relationship reasoning, including use of joins, aggregation and distinct counting, and is categorized under Data Manipulation (SQL/Python).

  • Medium
  • Databricks
  • Data Manipulation (SQL/Python)
  • Data Scientist

Calculate Second-Degree Followers for Each YouTuber

Company: Databricks

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Take-home Project

following +----------+----------+ | YouTuber | follower | +----------+----------+ | A | B | | A | C | | B | D | | C | E | | D | F | +----------+----------+ ##### Scenario Analyzing a social-network-style following table to compute second-degree followers for each YouTuber. ##### Question Write an SQL query that returns, for every YouTuber, the count of distinct second-degree followers (followers of followers) excluding direct followers and the YouTuber themselves. ##### Hints Self-join the table: T1.YouTuber→T1.follower→T2.follower; exclude duplicates and direct connections, then group count distinct second-degree followers.

Quick Answer: This question evaluates competency in relational data manipulation and graph-style relationship reasoning, including use of joins, aggregation and distinct counting, and is categorized under Data Manipulation (SQL/Python).

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • Careers
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Find Top-5 Similar Rows - Databricks (hard)
  • Count weekly customers with YTD spend ≥ $1000 - Databricks (hard)
  • Find top-5 most similar rows across datasets - Databricks (easy)
  • Count weekly customers with ≥$1000 YTD spend - Databricks (easy)