Level: Junior-Level
Round: Phone Screen · Type: Coding · Difficulty: 7/10 · Duration: 60 min · Interviewer: Unfriendly
Topics: Graph Algorithms, Eulerian Path
Location: San Francisco Bay Area
Interview date: 2026-02-20
Got offer: False
I had a phone screen that involved reconstructing a DNA sequence. I completed the first part successfully, but I was short on time for the second part, which involved finding an Eulerian path. I received a rejection a few days later.
I was given a problem involving DNA fragments represented by a Sequence object with startId, endId, and payload fields. The goal was to implement a function String shotgunSequence(List<Sequence> sequences) that concatenates the payloads in the correct order to reconstruct the original DNA string, given that the endId of one fragment equals the startId of the next, all tags are unique, and a legal order using all fragments is guaranteed to exist. An example was:
` Input fragments: ("AAA", "AAC", "AAAA") ("AGG", "ACC", "GGGG") ("AAC", "ACT", "TTTT") ("ACT", "AGG", "CCCC")
Legal order: AAA → AAC → ACT → AGG → ACC
Output: AAAATTTTCCCCGGGG `
The follow-up question changed the Sequence object to include tag1, tag2, and payload fields, without distinguishing between startId and endId. Fragments could be connected in either direction as long as they shared a tag. The goal was to implement the same function to reconstruct the DNA string, given that a legal order is guaranteed, all fragments must be used, and fragments can be connected by sharing a tag. An example was:
` (A, B, AAAA) (B, C, TTTT) (C, D, CCCC) (D, B, GGGG)
A legal path: A → B → C → D → B
Output: AAAATTTTCCCCGGGG `