Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Fix Issues Across Security, Performance, Observability

HardPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Fix Issues Across Security, Performance, Observability. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Figure out and fix 5 issues spanning security, performance, and observability in a new codebase within 90 minutes using AI assistance.

Asked in the Technical Interview stage. 90-minute AI-assisted codebase debugging session.

Task

You are given a small Python codebase as a list of source files. Each file is a string. Return the corrected version of the codebase after fixing exactly 5 issues. The issues may involve unsafe input handling, inefficient logic, missing logging or metrics, or other correctness problems that affect production readiness.

Input

  • files: dict[str, str], mapping file names to Python source code.

Output

  • Return dict[str, str] with the same keys and corrected source code values.

Requirements

  1. Fix exactly 5 issues.
  2. Preserve the public function names and file names.
  3. Prefer minimal changes that improve safety, runtime behavior, and observability.
  4. The corrected code must remain valid Python.

Constraints

  • 1 <= len(files) <= 10
  • Total source length across all files is at most 20,000 characters
  • Each file contains valid Python syntax before and after fixes
  • Exactly 5 issues are present in the input codebase

Function Signature

def fix_codebase(files):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output