Input Output
Key Concepts & Formulas
| # | Concept | Quick Explanation |
|---|---|---|
| 1 | Machine Flow | Always work from Input → Step-I → Step-II … → Final Step; never reverse. |
| 2 | Rule Tracking | Write the operation (alphabetical, numerical, positional) once you crack it; apply to all lines. |
| 3 | Position Counting | Count left-to-right starting at 1; for right-side operations count right-to-left. |
| 4 | Swap vs Shift | Swap exchanges two elements; Shift pushes whole line left/right. |
| 5 | Priority Order | Words → Numbers → Symbols; within numbers: ascending/descending. |
| 6 | Middle Element | For odd-length lists, middle element stays untouched in many patterns—use as anchor. |
| 7 | Backward Check | If final step is given, reverse the rule to find input in 5-10 s. |
10 Practice MCQs
-
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 -
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 -
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 -
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 -
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 -
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 -
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 -
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 -
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 -
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
-
[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 -
[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 -
[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 -
[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 -
[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
| Situation | Shortcut | Example |
|---|---|---|
| Already sorted segment | Freeze it; skip in next steps | Words in order → mark “OK” → focus on numbers only |
| Cycle 4/5 steps | Use mod arithmetic | 97 steps → 97 mod 5 = 2 → same as Step-II |
| Dual rule (word+num) | Draw two mini-lists | Words: A-Z, Numbers: 9-0 → merge at end |
| Reverse Qs | Work backwards with opposite rule | If rule = +9, reverse = −9 |
| Middle anchor | Odd-length → middle element never moves → use as fixed reference | 7 elements → 4th fixed → check others against it |
Common Mistakes to Avoid
| Mistake | Why Students Make It | Correct Approach |
|---|---|---|
| Counting from 0 | Computer habit → off-by-one | Always start position at 1 (leftmost) |
| Ignoring word order | Focus only on numbers → miss word shift | Split paper into two columns: word & num |
| Reversing rule wrongly | Subtract instead of swap | Write rule in arrow form: “swap(pos1,pos3)” → reverse same |
| Forgetting cycle | Solve till 100 steps manually | Spot repeat → find cycle length → use mod |
Quick Revision Flashcards
| Front | Back |
|---|---|
| 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 |