Level: Junior-Level
Round: Online Assessment · Type: Coding · Difficulty: 6/10 · Duration: 60 min · Interviewer: Neutral
Topics: Arrays, Hash Table, String Manipulation, Trie
Location: Toronto, ON, CA
Interview date: 2025-06-29
I completed an online assessment with two questions.
I took an online assessment for a junior role in Canada. The assessment consisted of two coding questions.
One question, getMaxSum, involved partitioning an array into two non-empty subarrays. The goal was to maximize the sum of the number of distinct elements in each subarray. A naive O(n²) solution would timeout, so I needed to use an O(n) single pass with a hash map.
The other question, getUsernameStrength, was a string processing problem. I had to validate a username against several rules, including a rule that no substring of the username could be found in a given dictionary of forbidden words. I solved this using a Trie, similar to LeetCode 212. Word Search II, to efficiently search for the forbidden substrings. A brute-force approach would have timed out. There was a minor inconsistency between the examples and the written rules, so I relied on the written rules.
LeetCode similar: LeetCode 212