← Intuit Interview InsightsSoftware Engineer

Intuit·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Intuit coding screen, one question the whole time. Parsing shell output sounds boring until you realize filenames with spaces will absolutely wreck a naive split-by-whitespace approach.

Questions Asked (1)

Q1

You're given a multiline string that represents the output of 'ls -l'. Parse each line to extract the file size and filename, keeping in mind that filenames can contain spaces. Return the filename with the largest file size.

Algorithms & Data Structures
Author's notes

My first instinct was to split on whitespace and grab the last token as the filename.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the input format and edge cases, then propose a line-by-line parsing strategy that splits each line into at most 9 parts (using whitespace) so the filename (which may contain spaces) remains intact. Track the maximum size and corresponding filename, and discuss time/space complexity.

Pro tip: Mention that you would use a regex or split with a max limit to robustly handle filenames with spaces, and explicitly state assumptions about the ls -l format (e.g., no special characters, consistent columns).

1. Clarify requirements and assumptions

Ask about the exact format of ls -l output, whether filenames can contain leading/trailing spaces, and if there are any special cases like symlinks or device files.

2. Design parsing strategy

Split each line into at most 9 fields using whitespace as delimiter, so the 5th field is size and the 9th field (and beyond) is the filename. Alternatively, use a regex to capture size and filename.

3. Extract size and filename

For each line, parse the size as an integer and reconstruct the filename by joining the remaining parts after the 8th field. Handle potential errors like malformed lines.

4. Track maximum size

Maintain variables for max size and corresponding filename, updating them when a larger size is found. Consider tie-breaking (e.g., first occurrence or lexicographical).

5. Return result and analyze complexity

Return the filename with the largest size. Discuss time complexity O(n) where n is number of lines, and space complexity O(1) excluding input.

Key Points to Mention

  • Handling filenames with spaces by splitting with a max limit or using regex
  • Parsing the size field correctly (it's the 5th column in ls -l output)
  • Edge cases: empty input, lines with fewer than 9 fields, non-numeric size
  • Time and space complexity analysis
  • Tie-breaking strategy when multiple files have the same maximum size
  • Assumptions about the ls -l format (e.g., no special characters, consistent columns)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.