Build a Ranking and Scoring Workflow
Last updated: September 4, 2025
Quick Overview
Given documents with multiple feature scores, implement a weighted scoring function, sort results, and handle ties deterministically.
Perplexity
Coding & Algorithms
Software Engineer
Perplexity
September 4, 2025Software Engineer
Coding Round
Coding & Algorithms
Medium
5
7
1,544 solved
Given documents with multiple feature scores, implement a weighted scoring function, sort results, and handle ties deterministically.
Practical search engineering problem directly relevant to Perplexity's document ranking pipeline.
What the Interviewer Expects
- Implement configurable weighted scoring
- Sort results stably with deterministic tie-breaking
- Handle missing feature scores gracefully
- Support dynamic weight adjustment
- Discuss normalization strategies for heterogeneous features
Key Topics to Cover
Weighted scoring
Stable sorting
Feature engineering
Tie-breaking
Score normalization
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you add feature normalization?
- What if some features are on different scales?
- How would you A/B test different weight configurations?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Problem Analysis
The problem requires us to implement a weighted scoring function for documents based on multiple feature scores, sort the results, and handle ties deterministically. This suggests using a combination ...
Approach
- Input Parsing: We will receive a list of documents, each containing a dictionary of feature scores and an associated weight for each feature.
- Weighted Scoring Calculation: For each docu...
Submit Your Answer
Markdown supported