Practice: test strategy drill
45 min · Beginner
Need help? Ask a tutor on WhatsApp (opens in a new tab)Test strategy only helps if the numbers come to you in seconds, under a clock. This drill puts the whole module to work: guess maths, time budgets, proctoring rules and a broken Python submission.
Guess value in one formula
Expected value is the average marks of a guess: p × m - (1 - p) × penalty, where p is your chance of being right and m is the marks for a right answer. The break-even chance is penalty / (m + penalty).
Guess only when your chance is above the break-even point. The example below prints the value of a blind guess for five marking schemes.
Example 1 · Guess value for five schemes
def show(name, options, marks, penalty): p = 1 / options value = round(p * marks - (1 - p) * penalty, 10) + 0.0 # round away tiny float errors break_even = penalty / (marks + penalty) print(f"{name:<26} value {value:.4f}, break-even {break_even * 100:.1f}%")
show("A: 4 options, +1/-0.25", 4, 1, 0.25)show("B: 4 options, +1/-1/3", 4, 1, 1 / 3)show("C: 4 options, +2/-0.5", 4, 2, 0.5)show("D: 5 options, +1/-0.25", 5, 1, 0.25)show("E: 4 options, +3/-1", 4, 3, 1)A: 4 options, +1/-0.25 value 0.0625, break-even 20.0% B: 4 options, +1/-1/3 value 0.0000, break-even 25.0% C: 4 options, +2/-0.5 value 0.1250, break-even 20.0% D: 5 options, +1/-0.25 value 0.0000, break-even 20.0% E: 4 options, +3/-1 value 0.0000, break-even 25.0%
What this code does
- Scheme C doubles both marks and penalty of a +1/-0.25 test, so the break-even stays at 20% and the value doubles. Schemes B, D and E make a blind guess worth exactly zero on average.
- Float arithmetic can leave a tiny error such as -0.00000000000000003 where the exact answer is 0. Printed as is, it would show -0.0000, so the code rounds first and zero prints as 0.0000.
With the usual m = 1 this becomes penalty / (1 + penalty). Some tests give 2 or 3 marks per question with larger penalties, so always use the real numbers from the instructions screen.
Revise: Negative marking, sectional cut-offs and time management (opens in a new tab)
Time budgets for different patterns
A test pattern is the list of sections, question counts and times of a test. For every MCQ section the budget is minutes × 60 / questions; for coding it is minutes / problems.
Keep about 10% of each MCQ section for review. The example below prints budgets for three sample patterns.
Example 2 · Budgets for three sample patterns
def mcq(name, questions, minutes): each = minutes * 60 / questions print(f" {name:<18} {each:5.1f} s each, {each * 0.9:5.1f} s with buffer")
def coding(problems, minutes): print(f" {'Coding':<18} {minutes / problems:5.1f} min per problem")
print("Pattern A")mcq("Section 1", 20, 20)mcq("Section 2", 20, 20)mcq("Section 3", 20, 15)print("Pattern B")mcq("Mixed MCQs", 60, 60)coding(2, 45)print("Pattern C")mcq("Technical MCQs", 30, 30)coding(3, 90)Pattern A Section 1 60.0 s each, 54.0 s with buffer Section 2 60.0 s each, 54.0 s with buffer Section 3 45.0 s each, 40.5 s with buffer Pattern B Mixed MCQs 60.0 s each, 54.0 s with buffer Coding 22.5 min per problem Pattern C Technical MCQs 60.0 s each, 54.0 s with buffer Coding 30.0 min per problem
What this code does
- Section 3 in pattern A is the tightest section at 45 seconds a question, so practise it with a timer.
- Pattern B gives 22.5 minutes per coding problem: enough for a brute force and one improvement, not for a long struggle with one problem.
Work out the budgets the night before, from the pattern in the drive notice, and write them on your rough sheet in the first minute of the test.
Rules of a proctored test, in one view
A violation is any action the test rules do not allow. Most come from three places: another person or device, leaving the test window, and anything not listed as allowed.
The table below pairs common violations with the correct action. When there is a technical problem, stay in frame, note the time, contact support and inform the TPO.
Violation Correct actionPhone on the desk Off and out of reach; use the on-screen timerSomeone talking in the room Take the test alone; tell family or roommates in advanceOpening another tab to search Stay in the test tab; skip and mark insteadSwitching device after a freeze Stay on the same device; contact support and the TPOIf you are unsure whether something is allowed, treat it as not allowed and ask the TPO or support before the test, not during it.
Fixing a coding submission
A submission is one version of your code sent to the judge. When it fails, the idea is often right: the cause is usually the output format, a type bug or slow input.
Fix a failing submission in this order: output format first, then types and division, then input and output speed. The example shows a broken submission and its fix.
Example 3 · A broken submission and its fix
# Task: read n, then n marks on one line. Print the number of marks >= 40,# then the average with two decimals.# Broken version printed "Enter n: Passed: 3" and "50": a prompt, a label and a whole-number average.import sys
data = sys.stdin.read().split()n = int(data[0])marks = list(map(int, data[1:1 + n]))print(sum(1 for m in marks if m >= 40))print(f"{sum(marks) / n:.2f}")3 50.80
What this code does
- For the sample input
5and35 72 40 88 19, the broken version printedEnter n: Passed: 3and50: a prompt, a label and a whole-number average from//. Each one alone makes the answer wrong. - The fix prints only the two required values: the count, and the average with
/and:.2f. It also reads everything withsys.stdin, which stays fast on large input.
Common causes: a prompt or label in the output, slow input() calls on huge data, // division where decimals are needed, numbers left as text, or a missing decimal format. A format error fails every test, while a speed problem fails only the large ones.
What's next
You finished the preview of Placement Process & Test Formats
Python Programming has 21 sections, 110 modules and 609 lessons. An account opens every lesson and saves your progress.
Next step
Check your understanding
12 quick questions