Coding

How would you code a function to determine the longest path in a Directed Acyclic Graph (DAG)?

Did you come across this question in an interview?

Interview question asked to Machine Learning Engineers and Data Scientists interviewing at Stitch Fix, Coinbase, Bloomberg and others: How would you code a function to determine the longest path in a Directed Acyclic Graph (DAG)?.