Exam · Rust: ownership, safety and a small command-line tool

Take the exam and earn your certificate.

A real, server-scored exam for this course. Score strictly above 80% to pass and get a genuine, verifiable certificate.

Before you start

We ask for your name and email first, the same as a PDF download, so we know you are here and your certificate can carry the right name.

We privately record your name, email and request IP for this exam request. Read the privacy notice and retention policy.

Visit Mickai on LinkedIn

Complete the security check before submitting.

Cloudflare Turnstile helps prevent automated submissions. How this check uses data.

You can retake the exam any time. Each attempt draws a fresh set of questions.

Written practice, ungraded

Write your response in your own notes, then compare it with the sample answer. This practice is separate from the scored exam and does not affect your certificate.

Practice 1

Describe how to create and check the token-meter project with a recorded toolchain, and state what offline mode will not do for you.

Compare with a sample answer

Record rustc --version and cargo --version (the course tested 1.95.0 on Windows 11 x86_64 with edition 2024, which selects language conventions rather than pinning a compiler). Create Cargo.toml, src/lib.rs, src/main.rs, tests/contract.rs and examples/borrow.rs, joining multi-block files in order with one blank line between blocks. Run cargo test --offline, keep Cargo.lock, ignore target, and add --locked to later offline checks. Offline mode will not install a missing toolchain, linker or component.

The sample follows the course's setup order and keeps the edition, lockfile and offline-mode limits accurate.

Practice 2

Using examples/borrow.rs and its recorded output, identify the move, the copy and the temporary borrow, and explain why owner can be mutated after borrowed is printed.

Compare with a sample answer

let mut owner = first; moves the String, so first can no longer be used. &owner lends a string slice to byte_length and creates the shared reference borrowed, whose last use is the first println, so the later push_str is allowed. let copy = before; duplicates a usize, which implements Copy, so the output is before=4 copy=4 after=8: 12 3 is four bytes, and appending a newline and 8 2 makes eight.

The sample names each operation in the executed example and derives the printed numbers by hand.

Practice 3

Trace the library's limits: explain the extra byte, calculate the largest combined total, and describe what parse returns when line three is invalid after two accepted records.

Compare with a sample answer

analyse reads at most 65,537 bytes so that oversized input is detected rather than a truncated prefix being accepted as complete. The combined maximum is 1,000 x (1,000,000 + 1,000,000) = 2,000,000,000, which fits u64; changing the limits means redoing that arithmetic. An invalid third line returns Err, and the local running total is dropped instead of being returned as a partial success.

The sample reproduces the course's boundary reasoning and its no-partial-success rule.

Practice 4

Describe the command's exit contract for the valid two-record example and for the records 12 3 and 8 nope, covering stdout, stderr and exit status, and say what a downstream step should rely on.

Compare with a sample answer

Valid input prints calls=2 input=20 output=5 total=25 on stdout and exits zero. With 8 nope, stdout stays empty, stderr shows error: line 2: counts must be ASCII integers from 0 to 1000000, and the status is two, this command's documented failure convention. A downstream step should treat the whole input as failed and check the exit status, because delaying output does not make stdout atomic if a write fails.

The sample separates the two output streams from the exit status, as the course's exercise does.

Practice 5

Explain why the course pairs compiler rejection probes with runtime tests, using one compiler probe and one compiled logic fault as examples.

Compare with a sample answer

move.rs is rejected by the compiler with E0382 because first is used after its String has moved, so that ownership mistake never becomes an executable. The copy that adds input into the output column still passes cargo check because its types and ownership are valid, yet the sums test fails because output becomes 20 instead of 5. Compiler evidence and behavioural tests catch different faults, so a handover records both.

The sample contrasts a compile-time rejection with a compiled logic fault that only tests catch.

Practice 6

Write a short handover note for the token-meter that separates tested behaviour from resource limits and unverified environments.

Compare with a sample answer

token-meter uses only the standard library, with Rust and Cargo 1.95.0, edition 2024, tested on Windows 11 x86_64. Input is UTF-8 with two ASCII integer fields per record, at most 1,000 records, 65,536 bytes and 1,000,000 per count. 12 3 and 8 2 give calls=2 input=20 output=5 total=25; a malformed record gives no summary and exit two. Twelve tests, ten process cases, rustfmt, Clippy, two rejected compiler probes and three caught logic faults passed. Stalled stdin, broken pipes, allocator failure and other operating systems were not verified.

The sample keeps passed evidence, limits and unverified behaviour side by side, as the course recommends.

About this exam

Is this exam graded?

Yes. Every question is scored on our server, never in your browser, and you need a score strictly above 80% to pass. The questions are a real, reviewed bank for this course, drawn fresh for each attempt.

Is it only multiple choice?

Yes. This is a multiple-choice knowledge assessment, with at least one question from each chapter in every attempt. Written exercises are separate practice and are not automatically scored. Passing does not establish practical professional competence or independently verify identity.

Is there a time limit?

Yes, 45 minutes, shown as a countdown once you start. If time runs out, whatever you have answered is submitted automatically.

Do I need to download the PDF first?

No. This course's full text is on its own page, so you can read it online and come straight here when you feel ready.

What do you do with my name and email?

We privately record your name, email, request IP, course and privacy acknowledgement for this request. Newsletter consent is separate and optional. See /privacy.html for storage and retention. A passed exam creates a server-stored named certificate. An email confirmation is not identity assurance.

Can I retake it if I fail?

Yes, straight away. Each attempt draws a fresh set of questions and shuffles the answer order, so it will not be identical to your last attempt, and an attempt can only be submitted once.

Is the certificate real?

It is a genuine, server-issued certificate with its own verification page and a unique ID, not a self-declared one. It records that you passed this course's exam on this date. It is not an accredited qualification, a professional licence or proof of employment.