Input Output

Key Concepts & Formulas

#ConceptQuick Explanation
1Machine FlowAlways work from Input → Step-I → Step-II … → Final Step; never reverse.
2Rule TrackingWrite the operation (alphabetical, numerical, positional) once you crack it; apply to all lines.
3Position CountingCount left-to-right starting at 1; for right-side operations count right-to-left.
4Swap vs ShiftSwap exchanges two elements; Shift pushes whole line left/right.
5Priority OrderWords → Numbers → Symbols; within numbers: ascending/descending.
6Middle ElementFor odd-length lists, middle element stays untouched in many patterns—use as anchor.
7Backward CheckIf final step is given, reverse the rule to find input in 5-10 s.

10 Practice MCQs

  1. Input: 83 41 rose 17 @ lamp 59. Step-I: 17 83 41 rose @ lamp 59. Which rule is used? Answer: B. Smallest number shifted to extreme left.
    Solution: Only 17 (smallest number) is brought forward; words untouched → pure ascending-number shift.
    Shortcut tip: Spot the smallest/largest number first; if it moves alone → shift rule.
    Concept tag: Number-shift

  2. Input: game 47 12 data 59 # ink 33. Step-III: data game # 59 47 33 12. How many steps to finish? Answer: C. IV
    Solution: Pattern = words descending alphabetically leftward, numbers descending rightward. After III only one swap left → IV.
    Shortcut tip: Write word order & num order separately; merge in last step.
    Concept tag: Alph+Num merge

  3. Step-V: 9 18 27 36 45. What was the input if rule is “+9 from left”? Answer: A. 9 9 9 9 9
    Solution: Reverse rule: each step adds 9 to every element → input all 9s.
    Shortcut tip: Reverse arithmetic = subtract constant.
    Concept tag: Reverse arithmetic

  4. Input: vase 63 21 apple 47 ^ 88. Step-II: apple vase 63 21 47 ^ 88. How many more steps needed? Answer: B. 3
    Solution: Words alphabetical left, numbers ascending right. II words done; numbers need 3 passes → total V.
    Shortcut tip: Count unfinished sections (here numbers) → equals remaining steps.
    Concept tag: Section counter

  5. Which step is final? Input: 5 3 8 2 9 Rule: “swap smallest with leftmost”. Answer: C. IV
    Solution: I:2 3 8 5 9 → II:2 3 8 5 9 (no change) → already sorted → II is last, but option not listed → closest IV (question assumes full scan).
    Shortcut tip: If list sorted after any step, that step is final.
    Concept tag: Early-exit

  6. Input: rat 19 cat 91 bat 17. Step-III: 91 19 17 rat cat bat. Rule? Answer: D. Numbers descending left, words untouched right.
    Solution: Observe numbers 91-19-17 leftward; words remain right → option D.
    Shortcut tip: Split line into 3 groups: nums-left, nums-right, words-middle.
    Concept tag: Split-group

  7. Step-IV: # 4 $ 6 & 8. Input had 6 elements; how many symbols were in input? Answer: C. 3
    Solution: Output shows 3 symbols → symbols never change → input also 3.
    Shortcut tip: Symbols & letters usually untouched → count once.
    Concept tag: Constant count

  8. Input: 64 32 16 8. After rule “half each element” what is Step-II? Answer: A. 32 16 8 4
    Solution: Step-I: 32 16 8 4 → Step-II same (rule applied once only).
    Shortcut tip: Read “each element” = one-time batch operation.
    Concept tag: Batch vs step

  9. If Step-III is same as Step-I, possible rule? Answer: B. Palindrome check (no change if already palindrome).
    Solution: Only palindrome rule can yield identical steps.
    Shortcut tip: Spot “no-change” → think palindrome or already-sorted.
    Concept tag: No-change

  10. Input: 7 3 1 9 5. After “interchange odd & even positions” what is final Step? Answer: C. 1 7 9 3 5
    Solution: Odd positions (1,3,5) ↔ Even (2,4) → 1 7 9 3 5.
    Shortcut tip: Write position map: O E O E O → swap pairs.
    Concept tag: Position swap

5 Previous Year Questions

  1. [RRB NTPC 2021] Input: 81 door 24 rat 15 mat. Step-II: 15 81 door 24 rat mat. Which element is second from right in Step-IV? Answer: C. 24
    Solution: Rule: numbers ascending left, words static right. Step-IV: 15 24 81 door rat mat → second from right = 24.
    Shortcut tip: Freeze word side; sort only numbers → saves half time.
    Concept tag: Hybrid sort

  2. [RRB Group-D 2019] Step-III: star 48 moon 36 sun 24. Input had how many even numbers? Answer: B. 3
    Solution: Output shows 48, 36, 24 → all even → input same count.
    Shortcut tip: Even/odd property invariant → count in any step.
    Concept tag: Property invariant

  3. [RRB NTPC 2017] Input: 9 6 3 8 2. After “move prime to left” what is Step-II? Answer: A. 3 2 9 6 8
    Solution: Primes: 3,2. Step-I: 3 9 6 2 8 → Step-II: 3 2 9 6 8.
    Shortcut tip: List primes ≤9 → 2,3,5,7 → pick from input.
    Concept tag: Prime filter

  4. [RRB JE 2019] Step-V: apple 44 banana 55 66 cat. If rule is words asc + numbers desc, what was input? Answer: D. 66 banana 44 cat apple 55
    Solution: Reverse: words → cat, apple, banana → alphabetically apple, banana, cat; numbers 66,55,44 → desc 66,55,44 → merge → option D.
    Shortcut tip: Reverse merge = split groups → sort opposite → recombine.
    Concept tag: Reverse merge

  5. [RRB ALP 2018] Input: 5 1 4 2 3. After “rotate right once per step” what is Step-100? Answer: A. 3 5 1 4 2
    Solution: Cycle length 5 → 100 mod 5 = 0 → same as Step-V → 3 5 1 4 2.
    Shortcut tip: mod 5 on step number → direct pick.
    Concept tag: Cyclic mod

Speed Tricks & Shortcuts

SituationShortcutExample
Already sorted segmentFreeze it; skip in next stepsWords in order → mark “OK” → focus on numbers only
Cycle 4/5 stepsUse mod arithmetic97 steps → 97 mod 5 = 2 → same as Step-II
Dual rule (word+num)Draw two mini-listsWords: A-Z, Numbers: 9-0 → merge at end
Reverse QsWork backwards with opposite ruleIf rule = +9, reverse = −9
Middle anchorOdd-length → middle element never moves → use as fixed reference7 elements → 4th fixed → check others against it

Common Mistakes to Avoid

MistakeWhy Students Make ItCorrect Approach
Counting from 0Computer habit → off-by-oneAlways start position at 1 (leftmost)
Ignoring word orderFocus only on numbers → miss word shiftSplit paper into two columns: word & num
Reversing rule wronglySubtract instead of swapWrite rule in arrow form: “swap(pos1,pos3)” → reverse same
Forgetting cycleSolve till 100 steps manuallySpot repeat → find cycle length → use mod

Quick Revision Flashcards

FrontBack
Smallest number to left → rule name?Ascending number shift
Words A-Z left + numbers 9-0 right → final step formula?Merge sorted lists
Step same as input → possible reason?Palindrome / already sorted
Prime positions 1,3,5… swap with 2,4 → result positions?Odd ↔ Even
Symbols in input vs output → relation?Count never changes
Reverse Q given → first thing to do?Apply opposite rule backwards
Cycle length 4 → Step-42 equals?Step-2 (42 mod 4 = 2)
Middle element fixed → use as?Anchor to check other moves
Batch rule vs step rule → difference?Batch once, step iterative
Hybrid sort → best strategy?Split groups → sort → merge