Simpler than it sounds on paper but I still managed to fumble the inclusive boundary check the first time.
Start by clarifying the input format and edge cases (e.g., null values, whitespace, data types). Then outline a straightforward validation function that checks each field for presence and non-emptiness, and specifically validates the full_statement_descriptor length. Finally, discuss how to apply this function to each record and return the appropriate status.
Pro tip: Mention that you would trim whitespace before checking emptiness to avoid false negatives, and consider using a constant for the descriptor length bounds to make the code more maintainable.
Ask about the input data structure, possible null values, and whether fields can contain only whitespace. Confirm the exact length bounds for full_statement_descriptor.
For each record, iterate over the 6 KYC fields and check that each is present and non-empty (after trimming). Separately, check that full_statement_descriptor length is between 5 and 31 characters inclusive.
Write a function that takes a list of records and returns a list of 'VERIFIED' or 'NOT_VERIFIED' strings. Use early returns or a flag to short-circuit on first failure.
Include tests for all fields present and valid, missing fields, empty strings, whitespace-only strings, and descriptor lengths at boundaries (4, 5, 31, 32).
Talk about time complexity (O(n) where n is number of records), potential for parallelization, and whether to validate all fields or fail fast. Mention error handling and logging for production.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.