Search quizzes/

Input–Output: Notes for IBPS PO & SBI PO

How to decode a machine's rule, write any step quickly, count steps correctly and avoid the usual traps in number, word and operation machines.

60-second revision

  • Compare the input with Step I element by element: what moved, where did it go, and what stayed in order?
  • Confirm the rule on Step II before using it on a new input.
  • Arranged elements collect at one end; the rest keep their original relative order.
  • A step that would change nothing is not counted as a step.
  • Operation machines change every element in every step; rewrite the whole line each time.
  • For 'which step', write every step in full — partial writing causes most errors.
  • Words ordered by dictionary: compare first letters, then second letters, and so on.

What an input–output question is

A 'machine' takes a line of words and/or numbers and rearranges or changes it step by step according to a fixed rule. You either get the rule in words or must find it from an example. Then you apply it to a new input and answer questions such as 'What is Step III?', 'How many steps are needed?' or 'Which element is 4th from the left in the last step?'.

Common machine types

TypeWhat happens in each stepClue in the example
Shifting (one end)One element moves to the front or back of the unarranged partElements pile up at one end in order
Shifting (both ends)One element moves to each endSmallest at the left, largest at the right, growing inwards
Word + number pairsA word and a number are placed togetherArranged part alternates word, number
OperationEvery number is changed by a ruleNo element moves; values change
SwappingTwo elements exchange placesPairs of positions swap each step

Decoding the rule from an example

  1. Write the input and Step I one above the other.
  2. Mark the elements that moved and where they went (left end, right end, after the arranged part).
  3. Ask why those elements: smallest, largest, first in the dictionary, shortest, longest?
  4. Check that the remaining elements kept their relative order.
  5. Verify the guess on Step II and the last step before trusting it.

Worked example: Input 'sun 47 map 12 ink 85 bat 30'. Step I: 'bat 12 sun 47 map ink 85 30'. bat is the first word in dictionary order and 12 the smallest number; both went to the front and the rest kept their order. Step II would place ink and 30 next: 'bat 12 ink 30 sun 47 map 85'. Step III: 'bat 12 ink 30 map 47 sun 85' — complete in three steps.

Counting steps

A step is counted only when it changes the line. If the next element is already in its correct place, the machine moves on without spending a step. So the number of steps can be smaller than the number of elements. Work through the steps fully; never assume 'n elements means n steps'.

Operation machines

Here each number changes by a rule, such as 'add 2 to odd numbers and halve even numbers'. Apply the rule to every number in every step; positions do not change. Example: 20 13 8 under that rule gives Step I 10 15 4, Step II 5 17 2, Step III 7 19 1.

Word ordering

Dictionary order compares the first letters; if they match, the second letters, and so on: 'cap' comes before 'car', and 'art' before 'ash'. When words are ordered by length, the rule must say how ties are broken — usually by dictionary order. Read that part of the rule carefully.

Test yourself: 10 questions, 75 s each

Every answer is explained. Free, no sign-up.

Start the quiz