Algorithms Professional Standards & Competencies 2 ā Questions and Answers
Question 1: A software engineer discovers that a widely-used sorting library they maintain has an O(n²) worst-case instead of the documented O(n log n). What is the most professionally responsible action?
- Close the issue as won't-fix since average-case is still fast
- Document the discrepancy, open a public issue, and work on a fix (Correct answer)
- Quietly patch the code without informing users to avoid panic
- Remove the library from the registry until fully fixed
Correct answer: Document the discrepancy, open a public issue, and work on a fix
Professional responsibility requires transparent disclosure of defects so users can assess risk and apply mitigations while a fix is developed.
Question 2: Which principle best describes why an algorithm professional should prefer a well-known algorithm over a custom solution when both solve the problem equally well?
- Custom algorithms are always slower
- Known algorithms have documented complexity, edge cases, and community review (Correct answer)
- Standard algorithms require fewer lines of code
- Custom solutions violate most software licenses
Correct answer: Known algorithms have documented complexity, edge cases, and community review
Established algorithms come with proven correctness proofs, known edge cases, and peer-reviewed complexity guarantees that reduce professional risk.
Question 3: An engineer implements a graph algorithm that works correctly but consumes O(V²) space. A colleague suggests an O(V) alternative. What professional consideration should drive the decision?
- Always choose the solution the senior engineer prefers
- Evaluate trade-offs: space, time, readability, and deployment constraints (Correct answer)
- Always choose minimum memory regardless of other factors
- Defer entirely to benchmark results without context
Correct answer: Evaluate trade-offs: space, time, readability, and deployment constraints
Professional algorithm selection requires weighing multiple factors including complexity, maintainability, and real-world deployment environment constraints.
Question 4: When publishing benchmark results for a new algorithm, what professional standard must be maintained?
- Report only the best-case results to attract users
- Report methodology, hardware specs, dataset characteristics, and all cases tested (Correct answer)
- Use proprietary datasets that competitors cannot reproduce
- Only compare against the weakest competitor algorithms
Correct answer: Report methodology, hardware specs, dataset characteristics, and all cases tested
Scientific and professional integrity requires full reproducibility, including disclosure of hardware, datasets, and methodology so others can verify claims.
Question 5: A junior engineer on your team proposes an O(n log n) solution to a problem that you know requires Ī©(n log n) in the comparison model. What is the professionally appropriate response?
- Replace their solution with your own without explanation
- Explain the lower bound, praise the optimal solution, and document the proof for the team (Correct answer)
- Say the solution is wrong since it didn't reach O(n)
- Assign extra review work as a learning exercise
Correct answer: Explain the lower bound, praise the optimal solution, and document the proof for the team
Recognizing an optimal solution and explaining the theoretical lower bound is a professional teaching moment that builds team competency.
Question 6: What does it mean professionally for an algorithm to be 'production-ready' beyond just passing unit tests?
- It compiles without warnings
- It handles edge cases, adversarial inputs, has documented complexity, and is code-reviewed (Correct answer)
- It has been running for at least six months in staging
- It uses no third-party libraries
Correct answer: It handles edge cases, adversarial inputs, has documented complexity, and is code-reviewed
Production readiness encompasses correctness under adversarial conditions, documented behavior, complexity guarantees, and team review ā not just basic test coverage.
Question 7: An algorithm you implemented causes a performance regression in production. What is the professional first step?
- Roll back immediately without investigation
- Profile the production system to confirm the root cause before taking action (Correct answer)
- Blame the hardware team for insufficient capacity
- Patch the algorithm in production without code review
Correct answer: Profile the production system to confirm the root cause before taking action
Profiling to confirm the root cause prevents incorrect fixes and ensures the rollback or patch decision is data-driven rather than reactive.
A software engineer discovers that a widely-used sorting library they maintain has an O(n²) worst-case instead of the documented O(n log n).
What is the most professionally responsible action?