The Molecule Report
A easy Python mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- Python
- Difficulty
- easy
- Seniority
- L4
Interview Prompt
Given a DNA sequence string, return a dict with exactly these keys: 'is_valid' (True iff the sequence contains only the characters A, C, G, T), 'gc_content' ((count_G + count_C) / len(sequence) * 100 as a float, or 0.0 for an empty sequence), 'nucleotide_counts' (a dict of the counts of A, C, G, and T), and 'most_common_dinucleotide' (the most frequent 2-character substring of consecutive characters; on a tie, return the alphabetically largest / last such pair, e.g. 'TG' over 'AT' and 'GC'; empty string '' if the sequence has fewer than 2 characters).
Summary
Four letters. A lot of math hidden in the sequence.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write your python solution with real code execution
- Get instant feedback and a hire/no-hire decision