Skip to content
GK24
GK NotesComputer AwarenessAlgorithms, Flowcharts and the Software Development Life Cycle

Algorithms, Flowcharts and SDLC: Symbols, Models and PYQs

Exam notes on algorithms, pseudocode, flowchart symbols, time complexity, the phases of the software development life cycle and its waterfall, spiral and agile models.

By · Published · 4 min read

Algorithms, Flowcharts and SDLC: Symbols, Models and PYQs — GK24 title card
Algorithms, Flowcharts and SDLC: Symbols, Models and PYQs — GK24 title card

Before a single line of code is written, a programmer settles two questions: what the sequence of steps is, and how the project as a whole will be built and handed over. The first belongs to algorithms and flowcharts, the second to the software development life cycle. Computer awareness papers for banking, SSC and state recruitment ask from both halves, usually as definitions, flowchart symbols, the order of the SDLC phases and the name of a model. This note covers all of it in the form examiners use.

What an algorithm is

An algorithm is a finite, ordered set of unambiguous instructions that takes an input and produces the required output in a limited number of steps. The word comes from the name of the ninth-century Persian mathematician Al-Khwarizmi, whose book on calculation entered Europe in Latin translation. An algorithm must satisfy five properties: it must have zero or more well-defined inputs; it must produce at least one output; every step must be definite, that is, free of ambiguity; it must be finite and terminate after a bounded number of steps; and it must be effective, meaning each step can actually be carried out. An algorithm written in plain structured English, with the keywords of programming but none of the syntax, is called pseudocode. The same logic drawn as a picture is a flowchart.

Flowchart symbols

Flowcharts use a standard set of shapes, and a question on them appears in almost every computer awareness paper.

SymbolShapeMeaning
TerminalOval or rounded rectangleStart and Stop of the flowchart
ProcessRectangleA calculation or an assignment such as sum = a + b
Input or OutputParallelogramReading a value or printing a result
DecisionDiamond or rhombusA condition with Yes and No branches
Flow lineArrowThe order in which the steps are performed
ConnectorSmall circleJoins parts of a chart broken across pages
Predefined processRectangle with double side linesA call to a subroutine or module

A flowchart is read from top to bottom and from left to right; every decision box has exactly one entry and two exits. A chart that cannot reach a Stop symbol describes an infinite loop and therefore fails the finiteness test of an algorithm.

Efficiency and complexity

Two algorithms can solve the same problem at very different cost, so efficiency is measured as time complexity, the number of basic operations, and space complexity, the extra memory required. Both are written in asymptotic or Big-O notation, which describes growth for large inputs. Linear search examines items one by one and is O(n). Binary search, which repeatedly halves a sorted list, is O(log n), which is why it is far faster but needs the data sorted first. Bubble sort, selection sort and insertion sort are O(n squared) in the worst case, while merge sort and heap sort are O(n log n). Big-O ignores constants and keeps only the dominant term.

The software development life cycle

The SDLC is the sequence of stages through which a software product passes from idea to retirement. The classical order is requirement gathering and analysis, in which the Software Requirements Specification or SRS is prepared; feasibility study; design, split into high-level design of modules and low-level design of logic; coding or implementation; testing; deployment or installation; and finally maintenance, which is usually the longest and costliest phase. Two design qualities are asked repeatedly. Coupling is the degree of interdependence between two modules and should be kept low. Cohesion is the degree to which the elements inside one module belong together and should be kept high. The rule to remember is low coupling and high cohesion.

SDLC models

The Waterfall model, also called the linear sequential model, moves strictly from one phase to the next with no overlap, and is suited only to projects whose requirements are frozen early. The prototype model builds a working mock-up so the user can react to it before the real system is built. The iterative and incremental models deliver the product in parts. The spiral model, proposed by Barry Boehm, is risk-driven: each loop of the spiral carries out planning, risk analysis, engineering and evaluation, which makes it the model of choice for large, uncertain projects. The V-model places a verification activity on one arm and the matching validation activity on the other. Agile development, set out in the Agile Manifesto of 2001, works in short iterations called sprints, with Scrum and Kanban as its common frameworks, and DevOps extends the idea into continuous integration and delivery.

Testing and reviews

Verification asks whether the product is being built right, validation whether the right product is being built. Testing moves from unit testing of a single module, through integration testing of modules together, to system testing and finally acceptance testing by the user; alpha testing happens at the developer's site and beta testing with real users outside. Black-box testing checks only inputs against expected outputs, while white-box or glass-box testing examines the internal code paths. Boundary value analysis picks test values just inside and just outside the valid range. A code walk-through is an informal review in which the team reads a finished module to find defects, as against a formal inspection with checklists and recorded findings.

Exam Point of View

Papers ask three things from this chapter. First, definitions: the properties of an algorithm, the meaning of pseudocode, coupling and cohesion, verification against validation. Second, flowchart symbols, where the diamond, the oval and the parallelogram are the favourites and the rectangle is the usual trap. Third, the SDLC: the order of the phases, which phase produces the SRS, which phase is the costliest, and the alternative name or the author of a model - linear sequential for waterfall, Barry Boehm for spiral. Complexity questions stay at the level of matching an algorithm with its Big-O value. Previous-year papers of DSSSB and the RRB technical cadres also ask testing terms such as black-box, alpha and beta testing, boundary value analysis and the difference between a walk-through and an inspection.

Important Facts

Origin of the word algorithmAl-Khwarizmi, ninth-century Persian mathematician
Properties of an algorithmInput, output, definiteness, finiteness, effectiveness
Start and Stop symbolOval or rounded rectangle (terminal)
Process symbolRectangle
Input or output symbolParallelogram
Decision symbolDiamond or rhombus, with Yes and No exits
Binary searchO(log n), works only on sorted data
Merge sort and heap sortO(n log n)
First SDLC phaseRequirement gathering and analysis, which produces the SRS
Longest and costliest SDLC phaseMaintenance
Coupling and cohesionKeep coupling low between modules, cohesion high within a module
Waterfall modelAlso called the linear sequential model
Spiral modelProposed by Barry Boehm; risk-driven loops
Agile Manifesto2001; iterations called sprints; Scrum and Kanban frameworks
Code walk-throughInformal review after coding; an inspection is formal

Practice MCQs on this topic

Q1.Computer AwarenessEasy

Which symbol is used to represent a decision in a flowchart?

  1. A.Oval
  2. B.Rectangle
  3. C.Diamond
  4. D.Parallelogram
Show answer
Correct answer: C. Diamond

Explanation

The correct answer is C, diamond. The diamond or rhombus is the decision symbol: it holds a condition and has one entry with two exits, marked Yes and No, so the flow branches according to the test. Option A is wrong because the oval, also drawn as a rounded rectangle, is the terminal symbol used only for Start and Stop. Option B is wrong because the rectangle is the process symbol, used for a calculation or an assignment such as adding two numbers and storing the sum. Option D is wrong because the parallelogram is the input or output symbol, used when a value is read from the user or a result is printed. Candidates most often swap the rectangle and the parallelogram, so fix the pair in memory: rectangle does the work, parallelogram talks to the outside world, and the diamond decides.

Q2.Computer AwarenessEasy

In a flowchart, the oval or rounded shape is used to show:

  1. A.Start and Stop
  2. B.A subroutine call
  3. C.A decision
  4. D.The direction of flow
Show answer
Correct answer: A. Start and Stop

Explanation

The correct answer is A, Start and Stop. The oval is the terminal symbol, and a well-formed flowchart has exactly one Start terminal and at least one Stop terminal; a chart that can never reach a Stop describes an infinite loop and so breaks the finiteness property of an algorithm. Option B is wrong because a subroutine or module call is shown by the predefined process symbol, a rectangle with double lines along its sides. Option C is wrong because a decision is shown by the diamond, which branches into Yes and No. Option D is wrong because the direction of flow is shown by the arrow or flow line, which carries the eye from one symbol to the next; by convention the chart is read from top to bottom and from left to right. Learning the seven standard symbols covers almost every flowchart question.

Q3.Computer AwarenessEasy

The word algorithm is derived from the name of which mathematician?

  1. A.Euclid
  2. B.Al-Khwarizmi
  3. C.Charles Babbage
  4. D.Blaise Pascal
Show answer
Correct answer: B. Al-Khwarizmi

Explanation

The correct answer is B, Al-Khwarizmi. Muhammad ibn Musa al-Khwarizmi was a ninth-century Persian mathematician and astronomer whose treatise on calculation with Hindu-Arabic numerals reached Europe in Latin translation; his Latinised name produced the word algorithm, and another of his works gave the word algebra. Option A is wrong because Euclid is remembered for geometry and for the Euclidean algorithm for the greatest common divisor, but the word itself does not come from his name. Option C is wrong because Charles Babbage designed the Difference Engine and the Analytical Engine and is called the father of the computer, not the source of this word. Option D is wrong because Blaise Pascal built the Pascaline, an early mechanical adding machine, and has a programming language named after him. Expect this as a one-mark definition question.

Q4.Computer AwarenessMedium

The worst-case time complexity of binary search on a sorted array of n elements is:

  1. A.O(n)
  2. B.O(n log n)
  3. C.O(log n)
  4. D.O(n squared)
Show answer
Correct answer: C. O(log n)

Explanation

The correct answer is C, O(log n). Binary search compares the key with the middle element and throws away half the array at every step, so the number of comparisons grows with the logarithm of the array size; an array of a million sorted items needs about twenty comparisons. The method works only on data that is already sorted, which is the condition examiners like to test. Option A is wrong because O(n) is linear search, which looks at the elements one after another and does not need sorted data. Option B is wrong because O(n log n) is the complexity of the efficient sorting algorithms such as merge sort and heap sort, not of a search. Option D is wrong because O(n squared) describes the simple sorts, namely bubble sort, selection sort and insertion sort in their worst case. Remember that Big-O keeps only the dominant term.

Q5.Computer AwarenessAsked in: Delhi · 7 Aug 2021, Shift 1Medium

What is the other name of Linear Sequential model in software engineering?

  1. A.Spiral model
  2. B.Prototype model
  3. C.Waterfall model
  4. D.RAD model
Show answer
Correct answer: C. Waterfall model

Explanation

The correct answer is C, the Waterfall model. The Waterfall model is called the linear sequential model because the project flows in one direction through requirement analysis, design, coding, testing, deployment and maintenance, with each phase completed and signed off before the next begins and no overlap between them. It suits only projects whose requirements are frozen at the start. Option A is wrong because the spiral model, given by Barry Boehm, is risk-driven and repeats planning, risk analysis, engineering and evaluation in loops, so it is anything but linear. Option B is wrong because the prototype model builds a throwaway working mock-up to collect user feedback before the real build. Option D is wrong because RAD, or rapid application development, assembles the product quickly from reusable components with heavy user involvement, again not a single straight line of phases.

Q6.Computer AwarenessEasy

Which phase of the software development life cycle produces the Software Requirements Specification (SRS)?

  1. A.Requirement gathering and analysis
  2. B.Design
  3. C.Coding
  4. D.Maintenance
Show answer
Correct answer: A. Requirement gathering and analysis

Explanation

The correct answer is A, requirement gathering and analysis. This is the first phase of the SDLC: the team meets the users, records what the system must do and what constraints apply, and sets it all down in the Software Requirements Specification, which then becomes the agreed basis for everything that follows and the yardstick for acceptance testing. Option B is wrong because the design phase converts the already approved SRS into a high-level design of modules and a low-level design of their logic. Option C is wrong because coding writes the program from the design documents, and by then the requirements are supposed to be settled. Option D is wrong because maintenance is the last and usually the longest and costliest phase, covering corrective, adaptive and enhancement work after delivery. A defect caught in the requirement phase is the cheapest to repair.

Q7.Computer AwarenessAsked in: Delhi · 7 Aug 2021, Shift 2Medium

What is COUPLING in software design?

  1. A.Coupling is a measure of the degree of functional interdependence between two modules
  2. B.Coupling is a measure of the degree of functional non-dependence between two modules
  3. C.Coupling is a measure of the functional robustness of a software module
  4. D.Coupling is a measure of the degree of functionally connected dependence between two modules
Show answer
Correct answer: A. Coupling is a measure of the degree of functional interdependence between two modules

Explanation

The correct answer is A: coupling measures the degree of functional interdependence between two modules. If one module must know the internal data or logic of another to work, the two are tightly coupled, and a change in one forces a change in the other. Good design therefore aims at low coupling together with high cohesion, where cohesion measures how closely the parts inside a single module belong together. Option B is wrong because it states the opposite, non-dependence; that idea belongs to the goal of loose coupling, not to the definition of coupling itself. Option C is wrong because robustness is the ability of a module to behave sensibly on wrong or extreme input, which is a quality attribute tested during testing, not a measure of inter-module linkage. Option D is wrong because it is a loosely worded restatement that misses the word interdependence on which the standard definition rests.

Q8.Computer AwarenessMedium

The spiral model of software development, which is driven by risk analysis in every loop, was proposed by:

  1. A.Winston Royce
  2. B.Barry Boehm
  3. C.Edsger Dijkstra
  4. D.Grady Booch
Show answer
Correct answer: B. Barry Boehm

Explanation

The correct answer is B, Barry Boehm. Boehm described the spiral model, in which the project moves outward through repeated loops and each loop performs four activities: determining objectives, risk analysis and resolution, development and testing, and planning the next loop. Because risk is examined before every stage of build, the model suits large and uncertain projects. Option A is wrong because Winston Royce is associated with the paper that set out the stage-wise waterfall approach, the linear sequential model. Option C is wrong because Edsger Dijkstra is remembered for the shortest path algorithm, for structured programming and for his criticism of the goto statement, not for a life cycle model. Option D is wrong because Grady Booch is one of the three authors of the Unified Modeling Language and of the Rational Unified Process, which is related but distinct from the spiral model.

Q9.Computer AwarenessAsked in: Delhi · 7 Aug 2021, Shift 2Medium

Which of the following statements is/are correct regarding code walk-through in software development? I. It is an informal technique for analyzing code. II. It is performed just before coding the module.

  1. A.Neither I nor II
  2. B.Only I
  3. C.Both I and II
  4. D.Only II
Show answer
Correct answer: B. Only I

Explanation

The correct answer is B, only I. A code walk-through is an informal review technique: a few team members read a module line by line, mentally execute it on sample data and note the defects they find, without the checklists, metrics and formal records of an inspection. Statement I is therefore correct. Statement II is wrong on timing, because a walk-through can only be held after the module has been coded; there is no code to walk through before coding. That makes option D, only II, wrong, and option C, both, wrong as well. Option A is wrong because statement I is sound. The learning point is the pair: a walk-through is informal and conducted after coding, while a code inspection is formal, uses a checklist of common error types and produces a written report.

Q10.Computer AwarenessMedium

Testing a program only by giving inputs and checking the outputs, without looking at the internal code, is called:

  1. A.White-box testing
  2. B.Black-box testing
  3. C.Unit testing
  4. D.Regression testing
Show answer
Correct answer: B. Black-box testing

Explanation

The correct answer is B, black-box testing. In black-box testing the tester treats the program as a sealed box, supplies inputs drawn from the specification and compares the outputs with what the specification promises; equivalence partitioning and boundary value analysis are its standard techniques, and no knowledge of the source code is needed. Option A is wrong because white-box or glass-box testing is the opposite: the tester reads the code and designs cases to cover statements, branches and paths. Option C is wrong because unit testing names the level at which a single module is tested, not the method of designing the cases, and a unit test may itself be black-box or white-box. Option D is wrong because regression testing means re-running old tests after a change, to confirm that the change has not broken what already worked. Level and technique are different axes.

Frequently Asked Questions

What is the difference between an algorithm and a flowchart?

An algorithm is the solution written as a finite sequence of unambiguous steps, usually in pseudocode. A flowchart is the same solution drawn as a diagram with standard symbols joined by arrows. The algorithm is the text, the flowchart is the picture, and both must satisfy finiteness by reaching an end.

Which flowchart symbols are most often asked in exams?

The oval for Start and Stop, the rectangle for a process such as a calculation, the parallelogram for input or output, and the diamond for a decision with Yes and No branches. The arrow is the flow line and the small circle is the connector used when a chart spills over to another page.

What is the correct order of the phases of the SDLC?

Requirement gathering and analysis, feasibility study, design, coding or implementation, testing, deployment, and maintenance. The Software Requirements Specification is written in the first phase, and maintenance after delivery is normally the longest and most expensive phase.

Why is the Waterfall model called the linear sequential model?

Because the work flows in one direction only. Each phase is finished and approved before the next begins, with no overlap and no easy way back, like water falling from one step to the next. It therefore suits only projects whose requirements are fixed at the start.

What is the difference between coupling and cohesion?

Coupling measures how much two modules depend on each other, and good design keeps it low so that a change in one does not ripple into the other. Cohesion measures how closely the parts inside a single module belong together, and good design keeps it high. The rule is low coupling, high cohesion.

How does black-box testing differ from white-box testing?

Black-box testing uses only the specification: the tester supplies inputs and checks outputs without reading the code, using techniques such as boundary value analysis. White-box testing reads the source code and designs cases to cover its statements, branches and paths.

Sources

View all