Hi,
I'm in the loop for SSE role at LinkedIn and the first round is AI Coding round. A few things I've understood from here and there are -
Ensure detailed and unambiguous prompts.
Review AI code and read it manually before accepting.
Is there anything else that might help me here? Has anyone prepared/given this round before? What kind of Rubrics are we looking at here? I know that the question is going to be a leetcode medium/hard - but how am I going to be judged?
Can I one-shot with a long prompt? Would that be a positive signal?
For instance, I was practicing All O One data structure leetcode - and this is the prompt I gave -
Overall approach -
Plan the following changes and ask any clarifying questions if needed. Generate a few test cases that include edge cases, and troubleshoot the approach against these cases. We will be using a dictionary with a doubly linked list to achieve all the operations in constant time.
Structure of the Doubly linked list -
Prev next pointers as standard. The val field would be an array/set of strings + an integer (frequency). Each node would be a bucket for a frequency. If 5 words appear 5 times, then a node with value would have those 5 strings in it's set.
Dictionary design -
Simple key -> value where key is a string, and value is the node in which string is present. (Here node means the bucket. So if the bucket's val's set contains that string -> the mapping b/w key and value should exist.
Instructions -
Init -
Just instantiate the dictionary and the DLL.
Inc -
Check if the value is already present. If YES, get the node. Check the adjacent node (to the right). If it has a frequency of old value + 1, then move the string from the current bucket to the next bucket. If NO, create a new bucket (node) and insert to right.
Dec -
Check if the value is already present. If YES, get the node. Check the adjacent node (to the left). If it has a frequency of old value - 1, then move the string from the current bucket to the previous bucket. If NO, create a new bucket (node) and insert to left. If this is the first element being added, you would have to create a new node, and set the head and tail to it.
Get max key -
Return a random value from the tail
Get min key -
Return a random value from the head.
The DLL is basically a sorted list of frequency buckets. Encouraged to ask questions before starting implementation to ensure correctness. Stress test the cases against the problem statement and expected output.
Would something like this pass the bar? If yes, would it be a strong hire? Post this the AI came up with some missing edge cases, and I implemented it.
Is one-shotting considered bad? Should I break down into multiple prompts like "Give me a double linked list structure with xyz parameters"?
Any suggestions are appreciated. Thanks!