Apple SSE Screening Round
Summary
I experienced a screening round at Apple where I was given a string manipulation problem involving generating all possible pretty odd statements from a nested list of words.
Full Experience
I was given a string manipulation problem during my Apple SSE screening round. The problem involved generating all possible "pretty odd statements" from a given input structure.
The input structure was:
{
{"The", "A"},
{"dog","cat"},
{"runs","walks"},
{"quickly","slowly"},
{".","!"}
}Expected Output:
The dog runs quickly.
The dog runs slowly.
The dog walks quickly.
The dog walks slowly.
The cat runs quickly.
The cat runs slowly.
The cat walks quickly.
The cat walks slowly.
I then provided a Java solution to this problem.
Interview Questions (1)
Generate Pretty Odd Statements
Given a nested list of strings, generate all possible "pretty odd statements" by taking one word from each inner list and concatenating them. The order of inner lists must be maintained.
Input Example:
{
{"The", "A"},
{"dog","cat"},
{"runs","walks"},
{"quickly","slowly"},
{".","!"}
}Expected Output:
The dog runs quickly.
The dog runs slowly.
The dog walks quickly.
The dog walks slowly.
The cat runs quickly.
The cat runs slowly.
The cat walks quickly.
The cat walks slowly.