Knowledge / Placement essentials (aptitude, reasoning, verbal, communication, interviews, Excel, workplace) / Input-output

Input-output

Placement essentials (aptitude, reasoning, verbal, communication, interviews, Excel, workplace) (All) · Logical reasoning · free study notes for exams, placements and interviews

In short

An input-output question gives a "machine" that takes one row of words, numbers or letters (the input) and rearranges or operates on it in a fixed, unstated way, producing Step I, Step II, Step III… until the arrangement is complete (the output). The student is shown one solved example and must deduce the hidden rule, then apply it to a fresh input. It is a high-weight set in Indian bank and insurance recruitment — IBPS PO/Clerk Mains, SBI PO/Clerk Mains, RBI Grade B and Assistant, NABARD, LIC AAO and IBPS SO — where one set normally carries 5 questions, and it also appears in the logical sections of campus aptitude tests and in coaching-style placement screens. There is no official syllabus text that codifies the patterns; the formats are set by examiners and change from year to year, so the skill examined is pattern inference under time pressure, not memorised rules. The same thinking (trace a sorting algorithm, read a pipeline stage by stage) is what interviewers probe when they ask you to dry-run code on paper.

Explained

How a set is framed, and what you are really being asked

Type 1 — shifting and arrangement machines (one element per step)

The commonest type. One element is picked each step and inserted next to an already-arranged block; the remaining elements keep their relative order.

Type 2 — operation machines (every element changes each step)

Type 3 — box, column, rotation and shuffle machines

The solving method, step by step

  1. Number the positions of the input (1, 2, 3…) and of the last step. Mark which elements are already arranged at either end.
  2. Compare the last step with the input to read off the final target (ascending/descending, words/numbers, which end).
  3. Compare Step I with the input: how many elements changed position? One → Type 1. All → Type 2.
  4. Identify the selected element in each step and list the selection order: 14, 27, 36, 52 means "smallest number first"; brave, flake, guard means "alphabetically first".
  5. Check the ends. If Step I changed the left and Step II changed the right, it is an alternate-end machine — then odd steps and even steps must be handled separately.
  6. Apply to the new input and write out every step; do not try to jump to "Step IV" mentally, because one slip in Step II corrupts everything after it.
  7. Answer all five questions from your written steps. Writing the steps once costs 2 minutes; answering five questions off them costs seconds each.

Question formats, including the backward trap

Scoring and timing in Indian exams

Key points

Formulas and examples

Maximum steps (one element arranged per step, n elements) = n − 1
Actual steps = n − 1 − t, where t = number of final-position elements already standing in order at the far end of the input (the end away from where the machine places)
Elements arranged after Step k = k; elements still unarranged = n − k
Cyclic machine: Step m ≡ Step (m mod p), where p = period of the cycle; m mod p = 0 means the arrangement equals the input
Adjacent-sum (pyramid) machine with n numbers a₀…a(n−1): steps = n − 1, final value = Σ C(n−1, i) × aᵢ
Position from the right = n + 1 − (position from the left), for a row of n elements

(Symbols: n = count of elements in the row, k = step number, p = cycle period, C(n, r) = binomial coefficient. These are counting relations, so they are pure numbers with no units.)

Example 1 — alphabetical shifting machine (Type 1, left end). Input: pencil guard flake ozone brave melon (n = 6) Rule deduced: in each step the word that comes earliest in dictionary order among the not-yet-arranged words moves to the immediate right of the arranged block; the others keep their order.

Answers: steps needed = 5 (= n − 1 = 6 − 1, since the input's last word *melon* is not the largest, so t = 0). Which step is brave flake guard pencil ozone melon? → Step III. Third from the left in Step IV → guard. Second from the right in Step II → ozone (position 6 + 1 − 2 = 5). If only Step II were shown, the input cannot be determined, because *brave* and *flake* could have come from any position.

Example 2 — alternate-end machine with words and numbers (Type 1). Input: 48 prize 15 mango 32 cobra (n = 6) Rule deduced: odd steps send the smallest unarranged number to the extreme left; even steps send the last-in-dictionary unarranged word to the right end of the unarranged portion.

Answers: steps = 5. Element third from the left in Step III → 48. Number of elements between 48 and prize in Step II → 3 (*mango*, *32*, *cobra*). Which step first has all three words together? → Step III (mango cobra prize occupy positions 4-6; they are only in dictionary order from Step IV).

Example 3 — operation machine, every element changes (Type 2). Input: 42 17 63 28 55 Rule deduced: each number is halved if even, and replaced by 3n + 1 if odd.

Answers: sum of Step II = 64 + 26 + 95 + 7 + 83 = 275. Largest in Step III = 286. Difference between the largest and smallest of Step II = 95 − 7 = 88. Going forward is always safe, but this input cannot be recovered from Step I: the 52 could have come from 17 (3n + 1) or from 104 (halving), so the rule is many-to-one. Only a one-to-one operation — "add 2", "interchange the first and last digits" — can be run backwards.

Example 4 — adjacent-sum pyramid machine, with the binomial shortcut. Input: 8 15 6 21 4 (n = 5) Rule: each step writes the sums of adjacent pairs, so the row shortens by one element each time.

Check with the formula: C(4, 0…4) = 1, 4, 6, 4, 1 → (1×8) + (4×15) + (6×6) + (4×21) + (1×4) = 8 + 60 + 36 + 84 + 4 = 192 ✓. Steps = n − 1 = 4. The shortcut answers "what is the last step?" in one line, without writing the pyramid.

Example 5 — cyclic shuffle machine and modulo. Input: P Q R S T U Rule: odd steps swap adjacent pairs (1↔2, 3↔4, 5↔6); even steps reverse the whole row.

Answers: Step 23 → 23 mod 4 = 3, so it equals Step III = U T S R Q P. Step 40 → 40 mod 4 = 0, so it equals the input. First step at which the row is exactly reversed → Step III.

FeatureType 1 shifting/arrangingType 2 operation/digitType 3 box, rotation, shuffle
What changes per stepOne element's positionAll elements' valuesPositions of several elements
Element count per rowConstantConstant (shrinks in pyramid machines)Constant
Steps to finishn − 1 at mostFixed by the question (usually 3-4)Repeats with period p
Can the input be found from a middle step?Usually no — "cannot be determined"Only if every operation is one-to-oneYes, by applying the inverse shuffle
Typical selection keyAlphabet, value, length, digit sumEven/odd, digit sum, digit orderRow/column position, parity of step
Algorithm analogueSelection / insertion sortMap function over a listPermutation, modular arithmetic

Where it is used

Interview questions

Common mistakes

Related topics

Number and letter series · Coding-decoding · Seating arrangement and puzzles · Non-verbal reasoning: figures and patterns · Data sufficiency · Inequalities

Open in the Knowledge reader →Find jobs →