OpenAI QA engineer interviews test automation frameworks, test strategy, CI integration, performance testing, and debugging complex multi-service systems.
class FlakyTestDetector:def __init__(self, threshold: int): initializes the detector with a failure threshold.def add_result(self, test_name: str, result: bool) -> None: saves a test result.def is_flaky(self, test_name: str) -> bool: checks if a test is flaky based on recorded results.Example 1:detector = FlakyTestDetector(threshold=2)detector.add_result('testA', True)detector.add_result('testA', False)detector.add_result('testA', False)detector.is_flaky('testA')True1 <= threshold <= 101 <= len(test_results) <= 1000class TestResultAggregator:def __init__(self): initializes the aggregator.def add_result(self, model_name: str, result: bool) -> None: adds a test result for a specified model.def get_success_rate(self, model_name: str) -> float: returns the success rate of tests for a specified model.def get_overall_success_rate(self) -> float: returns the overall success rate across all models.Example 1:aggregator = TestResultAggregator()aggregator.add_result('gpt-3', True)aggregator.add_result('gpt-3', False)aggregator.get_success_rate('gpt-3')0.51 <= len(results) <= 1000models are unique stringsSign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free