MetaData Engineer · OnsiteCodemia practiceResolve Root Post and Depth for Nested Comments from Parent Pointers
A comments table has (comment_id, parent_id, post_id_hint) where parent_id is either another comment or null for top-level comments, and post_id_hint is only filled on top-level rows. Using pandas joins, compute each comment's depth and root post, flagging orphans whose ancestor chain hits a deleted comment and any cycles caused by bad data.
Hard
Data Manipulation (SQL/Python)