Input–Outputइनपुट–आउटपुटquestions and answersप्रश्न और उत्तर
Input–output questions show a line of words or numbers and the first few steps of a machine that rearranges it. Mains papers often use five questions on one machine, so finding the rule quickly and correctly is worth a lot of marks.
Unlimitedअसीमितfresh questionsनए प्रश्न
Answersउत्तरalways one tap awayहमेशा एक टैप दूर
1subtopicउप-टॉपिक
IBPS PO ~5
TCS NQT ~1
Practice questions are in English for now.अभ्यास के प्रश्न अभी अंग्रेज़ी में हैं।
How input–output worksइनपुट–आउटपुट को समझिए
The rule is almost always the same action repeated: the largest (or smallest) number, or the first (or last) word in dictionary order, moves to one end of the line, next to the items already arranged. Compare the input with Step 1 to see which item moved and where, then confirm with Step 2.
Moving one item out of a line does not change the order of the others. So at any step, the arranged block sits at one end in final order and the rest of the line is just the input with those items removed. You can write Step 5 directly without writing Steps 3 and 4.
When the next item is already where it should be, the machine has nothing to move and does not use a step for it. This is why the number of steps can be less than the number of items, and why counting items instead of moves gives a wrong answer.
Each trick says when to use it, why it works and when it fails. Formula tricks are checked by code over their whole range.हर ट्रिक बताती है कि उसे कब इस्तेमाल करें, वह क्यों काम करती है और कब नहीं। सूत्र वाली ट्रिक्स को कोड से उनकी पूरी रेंज पर जाँचा गया है।
Mental mathsमानसिक गणितRarely taughtकम सिखाई जाने वाली✓ Checked on 1,085 cases✓ 1,085 मामलों पर जाँची गई
Write any step directly: sorted block + the rest in input order
Use it when:कब इस्तेमाल करें: A machine moves the largest/smallest item (or first/last word) to one end each step, and a question asks about a late step.
Work out which items are arranged after the asked step (the top k in the rule’s order).
Write them at their end in final order.
Copy every other item in its input order.
Exampleउदाहरण
Input 45 12 78 33 90 61, largest to the left end. Step 3?
Why it works, and when it failsयह क्यों काम करती है, और कब नहीं
Why:क्यों: Each step lifts one item out of the unarranged part and drops it next to the arranged block. Removing an item from a line never changes the order of the items left behind, so the unarranged part is always the input with the arranged items deleted.
Limits:सीमाएँ: Only for “one item moves to one end” machines. Machines that swap pairs, shift by positions or change the items themselves (for example add 1 to each number) need step-by-step working.
Exam strategyपरीक्षा रणनीति
Find the rule from Step 1, prove it on Step 2
Use it when:कब इस्तेमाल करें: The first question on a new input–output machine.
Find the one item whose position changed between the input and Step 1.
Ask: is it the largest, smallest, first or last of what was left, and which end did it go to?
Check the same rule on Step 2 before answering anything.
→ “chai” is first in dictionary order and went to the left end; Step 2 should bring “kite” next to it.
Why it works, and when it failsयह क्यों काम करती है, और कब नहीं
Why:क्यों: Most machines repeat one simple move, so a single changed item usually reveals it. Checking Step 2 guards against coincidences, such as an item that is both the largest number and the last in the line.
Limits:सीमाएँ: Mixed machines (words and numbers handled alternately) need Steps 1 and 2 to find two rules; check Step 3 if it is shown.
Solved examplesहल किए गए उदाहरण
Answers and full solutions are shown. Hide them to test yourself first.उत्तर और पूरे हल दिखाए गए हैं। पहले खुद को परखने के लिए इन्हें छिपाइए।
Example 1उदाहरण 1 · Input–output machine (one rule per step) · Easyआसान
A machine rearranges a line of words, one word per step, using the same rule every time. In each step, the word that comes last in dictionary order not yet arranged moves to the left end, next to the words already arranged there. If the next word is already in its place, it is skipped without using a step.
Input: cricket otter veena chai rangoli
Step 1: veena cricket otter chai rangoli
Step 2: veena rangoli cricket otter chai
How many steps are needed to complete the arrangement?
2
3
4
5
Answer:उत्तर:3
Rule: In each step, the word that comes last in dictionary order not yet arranged moves to the left end, next to the words already arranged there.
Step 1: veena cricket otter chai rangoli
Step 2: veena rangoli cricket otter chai
Step 3: veena rangoli otter cricket chai
How many steps are needed to complete the arrangement? → 3.
Example 2उदाहरण 2 · Input–output machine (one rule per step) · Mediumमध्यम
A machine rearranges a line of numbers, one number per step, using the same rule every time. If the next number is already in its place, it is skipped without using a step.
Input: 52 16 33 62 50 97
Step 1: 97 52 16 33 62 50
Step 2: 97 62 52 16 33 50
What is Step 4?
62 97 52 50 33 16
97 52 62 50 33 16
97 62 52 50 16 33
97 62 52 50 33 16
Answer:उत्तर:97 62 52 50 33 16
Rule: In each step, the largest number not yet arranged moves to the left end, next to the numbers already arranged there.
Step 1: 97 52 16 33 62 50
Step 2: 97 62 52 16 33 50
Step 3: 97 62 52 50 16 33
Step 4: 97 62 52 50 33 16
What is Step 4? → 97 62 52 50 33 16.
Example 3उदाहरण 3 · Input–output machine (one rule per step) · Hardकठिन
A machine rearranges a line of numbers, one number per step, using the same rule every time. If the next number is already in its place, it is skipped without using a step.
Input: 48 69 57 91 39 53 31
Step 1: 91 48 69 57 39 53 31
Step 2: 91 69 48 57 39 53 31
In Step 3, which number is first from the right end?
31
53
57
91
Answer:उत्तर:31
Rule: In each step, the largest number not yet arranged moves to the left end, next to the numbers already arranged there.
Step 1: 91 48 69 57 39 53 31
Step 2: 91 69 48 57 39 53 31
Step 3: 91 69 57 48 39 53 31
Step 4: 91 69 57 53 48 39 31
In Step 3, which number is first from the right end? → 31.
Example 4उदाहरण 4 · Input–output machine (one rule per step) · Mediumमध्यम
A machine rearranges a line of words, one word per step, using the same rule every time. If the next word is already in its place, it is skipped without using a step.
Input: cricket veena otter kite yak river
Step 1: cricket veena otter kite river yak
Step 2: cricket otter kite river veena yak
How many steps are needed to complete the arrangement?
2
3
4
5
Answer:उत्तर:3
Rule: In each step, the word that comes last in dictionary order not yet arranged moves to the right end, next to the words already arranged there.
Step 1: cricket veena otter kite river yak
Step 2: cricket otter kite river veena yak
Step 3: cricket kite otter river veena yak
How many steps are needed to complete the arrangement? → 3.
Example 5उदाहरण 5 · Input–output machine (one rule per step) · Mediumमध्यम
A machine rearranges a line of words, one word per step, using the same rule every time. If the next word is already in its place, it is skipped without using a step.
Input: river saree kite ladoo falooda henna
Step 1: saree river kite ladoo falooda henna
Step 2: saree river ladoo kite falooda henna
What is Step 3?
saree river ladoo kite falooda henna
kite falooda henna ladoo river saree
falooda henna kite river saree ladoo
saree river ladoo kite henna falooda
Answer:उत्तर:saree river ladoo kite henna falooda
Rule: In each step, the word that comes last in dictionary order not yet arranged moves to the left end, next to the words already arranged there.
Step 1: saree river kite ladoo falooda henna
Step 2: saree river ladoo kite falooda henna
Step 3: saree river ladoo kite henna falooda
What is Step 3? → saree river ladoo kite henna falooda.
Example 6उदाहरण 6 · Input–output machine (one rule per step) · Mediumमध्यम
A machine rearranges a line of numbers, one number per step, using the same rule every time. If the next number is already in its place, it is skipped without using a step.
Input: 73 18 94 57 88 90
Step 1: 94 73 18 57 88 90
Step 2: 94 90 73 18 57 88
What is Step 4?
18 57 73 88 90 94
90 94 88 73 57 18
94 90 88 73 18 57
94 90 88 73 57 18
Answer:उत्तर:94 90 88 73 57 18
Rule: In each step, the largest number not yet arranged moves to the left end, next to the numbers already arranged there.
Step 1: 94 73 18 57 88 90
Step 2: 94 90 73 18 57 88
Step 3: 94 90 88 73 18 57
Step 4: 94 90 88 73 57 18
What is Step 4? → 94 90 88 73 57 18.
Common mistakesआम गलतियाँ
Guessing the rule from Step 1 alone when Step 2 would have shown a different pattern.
Reordering the unarranged items instead of keeping their input order.
Counting one step per item even when some items were already in place.
Frequently asked questionsअक्सर पूछे जाने वाले प्रश्न
How do I find the rule quickly?
Look for the one item whose position changed between the input and Step 1, then check whether it is the largest, smallest, first or last of the remaining items and which end it went to.
Can I jump straight to a later step?
Yes. Put the first k arranged items at their end in order and copy the remaining items in their input order.
Why does the last step come early sometimes?
If the items still to be arranged are already in the correct order, the machine stops; no step is spent on them.