Skip to content
Search lessons, topics, tests…
Esc

    ↑ ↓ moveEnter openEsc close
    Lesson20 / 20

    Module 5 · Build your Study Planner and practise independently · Lesson 20 of 20

    Return tomorrow: solve fresh problems and choose your next step

    What can you still solve after closing the earlier examples? Ideally return in a later sitting. Predict all six answers on paper before checking any of them.

    This is a check of the skills in this course. It has no countdown, automatic reminder or stored confidence score. Mark each prediction sure or guess. A correct choice with a clear explanation is more informative than a lucky choice.

    1. Trace values and arithmetic

    C#
    using System;
    int minutes = 7;
    int copy = minutes;
    minutes += 2;
    Console.WriteLine(copy / 2);
    Console.WriteLine(minutes);

    What are the two output lines?

    A 4, then 9
    B 3, then 7
    C 3, then 9
    D 4.5, then 9
    Show answer

    Correct answer: C

    copy retains 7; integer division 7 / 2 produces 3. minutes becomes 9.

    Option A: Integer division does not round 3.5 up to 4.

    Option B: minutes was increased by 2.

    Option D: Both operands of copy / 2 are ints, so no fractional result is produced.

    2. Trace a loop

    C#
    using System;
    int total = 0;
    for (int day = 1; day <= 3; day++)
    {
        total += day * 5;
    }
    Console.WriteLine(total);

    What prints?

    A 15
    B 30
    C 10
    D The loop never stops
    Show answer

    Correct answer: B

    The loop adds 5, 10 and 15, for a total of 30.

    Option A: 15 is only the final addition, not the accumulated total.

    Option C: The condition includes day 3.

    Option D: day increases and eventually becomes 4, making the condition false.

    3. Follow a copied object reference

    C#
    using System;
    StudyTask original = new StudyTask { Title = "Read" };
    StudyTask other = original;
    other.IsDone = true;
    other = new StudyTask { Title = "Practise" };
    Console.WriteLine(original.Title);
    Console.WriteLine(original.IsDone);
    
    class StudyTask
    {
        public string Title { get; set; } = "";
        public bool IsDone { get; set; }
    }

    What are the two output lines?

    A Practise, then False
    B Read, then False
    C Practise, then True
    D Read, then True
    Show answer

    Correct answer: D

    The first mutation affects the shared object. Reassigning other later does not redirect original.

    Option A: The new object is assigned only to other.

    Option B: The earlier IsDone mutation did affect the original object.

    Option C: original still reaches the object titled Read.

    4. Choose a validation check

    A task number must be between 1 and tasks.Count before indexing tasks[number - 1]. Which input is especially useful when checking the lower boundary?

    A Only 1000000
    B 0 and 1
    C Only the word hello
    D Only tasks.Count + 100
    Show answer

    Correct answer: B

    0 should be rejected; 1 should be accepted when at least one task exists. Together they test the boundary.

    Option A: A huge number tests only the upper rejection path.

    Option C: Text tests parsing, not the numeric lower boundary.

    Option D: This is another upper-bound rejection case.

    5. Distinguish text parsing from a data rule

    int.TryParse reads -5 successfully. The application requires nonnegative study minutes. What should happen next?

    A Accept -5 because parsing succeeded
    B Reject it with a range check
    C Change the text to 5 silently
    D Catch a parsing exception
    Show answer

    Correct answer: B

    Parsing establishes that the text is an int. A separate rule rejects negative minutes.

    Option A: Representable numbers can still be outside the application’s allowed range.

    Option C: Silently changing the user’s meaning is not validation.

    Option D: TryParse reports success or failure without a parsing exception for ordinary invalid text.

    6. Keep a save failure visible

    Saving the planner fails. Which behaviour helps the learner act correctly?

    A Print Saved anyway
    B Clear the in-memory list
    C Report failure and keep the current tasks available in memory
    D Ignore all exceptions without a message
    Show answer

    Correct answer: C

    An honest failure message avoids implying persistence succeeded, and retaining the list lets the user try again.

    Option A: That would claim something the program did not achieve.

    Option B: Losing the in-memory data makes recovery harder.

    Option D: Silent failure leaves the learner believing work may have been saved.

    Find the next useful practice

    If you missed…RevisitThen do this
    1Variables and calculationsChange the starting values and predict again.
    2LoopsTrace day and total after each iteration.
    3Objects and copyingDraw two variables and count the new objects.
    4 or 5Input and validationCheck parse failure, zero and both bounds.
    6Files and savingReproduce a handled save failure in a practice folder.

    A practical finish line

    From a blank project, rebuild a small version of the Study Planner with add, list and quit. Add completion, then save/load. Use the checklist from the project lessons to check it. Explain one bug you found and the check that exposed it. Completion of these pages is useful progress; independent building is the stronger signal that the foundations are taking hold.

    When you can rebuild and explain that planner, continue to C# Intermediate. It assumes these syntax and collection skills. You will protect state with object contracts, replace the report loop with deliberate LINQ queries, then introduce Task/await and cancellation. You do not need LINQ or async to finish Beginner. Advanced follows Intermediate and adds concurrent ownership, memory views and controlled failure checks.

    If rebuilding still needs the completed answer beside you, revisit the relevant row above before adding those new concepts.

    References: Microsoft — C# learning path and testing in .NET.

    Quick reference

    • Predict before running or revealing answers.
    • Trace the state after each important line.
    • Explain why an answer follows from the code.
    • Revisit the specific missing skill, then try a changed example.
    • Build a small application independently before moving to more advanced topics.
    Sign in to mark lessons done and keep your place in the course.Sign in

    TechInterviewNotes Editorial Team · Updated 27 Oct 2026 ·