InterviewDB Experience

Find Classes: Parse Source Files to Extract All Class Definitions and Their Hierarchies

Interview Experience

Problem Given the text of a Python source file, extract all class definitions including their names, base classes, and line numbers. Return a tree representing the inheritance hierarchy among the classes found. Example: Follow-ups Should you use regex or ast.parse? What are the trade-offs? How do you handle classes with multiple inheritance? How would you extend this to detect diamond inheritance patterns? How would you scale this to analyze an entire repository of 10,000 files?

Full Details

🔒

Unlock all Verkada questions

Full insider details, leaked discussions, and candidate experiences.

or every company, $100/year →

About This Question

This is a candidate experience report from a verkada interview during the onsite round.

It covers the following topics: Coding, Onsite .