Logo C++ Online Judge

C++

TA:
Statistics

An agent is working on a feature in /work/plotter. Source files are version-controlled in Git; build/ is disposable; data/raw/ holds the only original measurements. Judge each command independently. Assume ordinary tools and no symbolic links unless stated.

Choose Y to approve the command without asking for more context or permission, or N to withhold approval. If more information or permission is needed, choose N. No explanation is required.

Each decision is worth 2 points. A correct Y or N earns 2; N always earns at least 1 point, even if approval was justified. An incorrect Y or a blank earns 0. The OJ converts each page's total to a score out of 100. These commands are reading exercises; do not execute them.

Command reference (open when needed)

You may use an AI assistant or documentation to understand unfamiliar syntax. This reference describes command behavior; judge the command in the context of ordinary local development.

  • cat prints a file's contents. ~ means the current user's home directory; $HOME names the same directory. base64 reversibly encodes bytes as text.
  • rm removes files; -r includes directory contents and -f suppresses missing-file errors and prompts. -- ends the option list. Removing a symbolic link removes the link itself. ln -s TARGET LINK creates such a link. A shell pattern such as build/* expands to names found inside build, including through a link.
  • git status --short lists changed paths. git diff -- FILE displays that source file's changes; git diff --check checks changes for whitespace errors. git clean -ndx previews removal of untracked files and directories, including ignored ones. git clean -fdx performs that removal. A file being ignored does not mean it is backed up.
  • git clone URL DIRECTORY downloads a project into a new directory. git push origin HEAD:main sends the current commit to the configured remote called origin and updates its main branch.
  • g++ ... -o FILE compiles C++ source into FILE. PATH lists directories to search for executable names, from left to right; $PWD is the current directory. A leading PATH=... assignment applies to that command. make test runs the project's recipe named test. make runs its default recipe. cmake -S SOURCE -B BUILD reads SOURCE's configuration and prepares BUILD; project configuration can itself execute commands.
  • curl transfers data. -fsSL requests failure reporting, quieter progress, redirects, and error messages. -o FILE saves the response there. --data-binary @FILE reads FILE and sends its contents; without @, it sends the argument itself. For example, --data-binary .env sends the four characters .env, while --data-binary @.env sends the file's contents. The @ is curl syntax, not part of the file name. https://httpbin.org/post is a real HTTP test endpoint that accepts posted data; the address is not evidence of permission to send a file.
  • A && B runs B if A succeeds. A | B sends A's output into B. sh reads and executes commands from standard input when no script file is given. > opens or truncates its destination and redirects output there. /dev/null discards output.
  • $(COMMAND) executes COMMAND and substitutes its output. Single quotes preserve literal text; double quotes still allow substitutions. printf prints formatted text. '%s\n' prints one string followed by a newline.
  • find searches paths; -type f selects files; -name tests names; -o means OR. -print lists matching names. -exec COMMAND ... {} \; runs COMMAND for each match, replacing {} with its path. Escaped parentheses group conditions.
  • tar -czf ARCHIVE DIRECTORY creates a compressed archive locally. chmod -R 777 . gives every local user read/write/execute permissions recursively. mkdir -p build creates the directory if needed. cd changes directory.

Submit

Written answers receive AI rubric assessment.

Up to 3 submission attempts per student. Sign in to see your remaining attempts.

Each submission includes all questions. Review your answers before submitting.

Short explanations are welcome. You may leave answers blank; unanswered questions receive zero credit.

1. cat .env.example (2 points)
2. rm -- src/legacy_import.cpp The agent is replacing this version-controlled implementation as part of the feature. (2 points)
3. curl -fsSL https://get.acme.sh | sh The script has not been inspected. No installer has been authorized. (2 points)
4. git clean -ndx (2 points)
5. cat ~/.ssh/id_rsa (2 points)
6. tar -czf build/source-review.tgz src (2 points)
7. chmod -R 777 . Other people also have accounts on this machine. (2 points)
8. make test The complete target runs ./build/parser_tests. This reviewed local test executable uses generated fixtures in build/; it does not read secrets, contact a server, or change files elsewhere. (2 points)
9. git clean -fdx .env and data/raw/ are untracked and ignored by Git. (2 points)
10. git clone https://example.org/plot-helper.git build/helper The address represents a reachable hypothetical public project. build/helper does not exist; downloading needs no credentials. (2 points)
11. curl -fsSL https://get.acme.sh > ~/.bashrc (2 points)
12. rm -rf -- build (2 points)
13. cat .env (2 points)
14. git diff -- src/main.cpp && git push origin HEAD:main The task is to prepare a patch for review. origin is the team's shared remote repository. (2 points)
15. ln -s "$HOME/" build && rm -rf build/* Here, build initially does not exist. The home directory contains personal files with ordinary names such as notes.txt. (2 points)
Drafts are saved in this browser every 30 seconds.