Questions › Execution › Top-Interview
Modify this PyTorch pseudo-code to perform negative sampling if the pos_ids are known: label #shape=[batch_s, pos_ids] hidden #shape=[batch_s, ch] logits #shape=[ch, C] out=np.dot(logits, hidden(X)) #shape=[batch_s, C] loss=cross_entropy(out, label)
- Execution
- Top-Interview
- Hard
- 45 min
Modify this PyTorch pseudo-code to perform negative sampling if the pos_ids are known: label #shape=[batch_s, pos_ids] hidden #shape=[batch_s, ch] logits #shape=[ch, C] out=np.dot(logits, hidden(X)) #shape=[batch_s, C] loss=cross_entropy(out, label)
What this question tests
- Execution
- Structured problem solving
- Communication
- Trade-off reasoning
Practise this question under interview conditions. Answer it out loud against a timer with an AI interviewer that asks follow-ups, then review the scored report.
Related Execution questions
- Determine if we should launch a feature of Instagram Store that allows purchases without logging in.Top-Interview · Execution · Easy
- What is the most important metric for Instagram's verified badges?Top-Interview · Execution · Easy
- Estimate how much bandwidth is needed for launching YouTube TV.Top-Interview · Execution · Easy
- Tell me about your program execution style.Top-Interview · Execution · Easy
- At Facebook, noticing a sudden spike in DAUs in Indonesia, how would you investigate the cause?Top-Interview · Execution · Easy
- Describe an experiment you conducted.Top-Interview · Execution · Easy
All Execution questions · Product manager interview questions by skill area