Skip to content

Repository files navigation

Interview exercise: PerfScope investigation

PerfScope is a small performance-measurement tool this team inherited. Users have reported that some of the numbers it prints cannot be true. Your job is to investigate.

What you need

  • Python 3.9 or newer, on Windows, macOS, or Linux. No other requirements.
  • Any editor, IDE, or debugger you like. Use whatever you are fastest with.
  • Any AI agent you prefer

Getting started

  1. Run the tool:

    python main.py          # macOS / Linux (or: python3 main.py)
    py -3 main.py           # Windows
    
  2. Useful flags while exploring: python main.py --list shows the available workloads, python main.py --help shows everything else. --verbose prints extra detail that may or may not be useful to you.

Your tasks

Three oddities have been reported against this tool. For each one: reproduce it, find the root cause, explain it out loud, and fix it.

  1. Watch the [data] lines on a first run (delete the data/ folder to force a fresh download). Compare the reported download time and speed -- and the remote freshness check time on every later run -- with what your network can plausibly do. Something is not right here.

  2. Run the full suite, then run python main.py --only scan_first_luxury. Compare both results with the reference outputs in docs/USAGE.md. Something is not right here.

  3. Compare the mean ms column of the report with the [total] suite finished in ... s line and with how long the run actually felt. Something is not right here.

Each oddity has a single, small root cause. None of them require performance tuning, new dependencies, or large rewrites.

Ground rules

  • Think out loud. We care about how you investigate at least as much as whether you finish.
  • Expected effort: 10-15 minutes for each of the oddities. You may pick only 1 oddity to work on. It is fine to finish fewer than three -- depth beats speed.
  • You need to understand and be able to explain your findings in your own words, no matter what AI agents you use to assist.

Good luck.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages