Back to Search
Past Papers ↗
2024 SchemeBETASemester S1• Computer Science and Engineering

Algorithmic Thinking with Python

2024 Scheme Syllabus & PYQ Analysis • UCEST105

Beta: Curated from KTU syllabus & university papers. Spot an error or missing topic? Let us know!
15High Priority
4Modules
18+Papers Analyzed
60MTotal Marks
Module:
Priority:

Module 1Problem Solving Strategies & Decomposition

15 Marks
Exam Focus: Covers Problem Definition, Modeling, Top-Down Design, Modular Decomposition, Means-End Analysis, and Python syntax & data types.

Top-Down Design & Modular Program Decomposition

High Priority10x in Past Papers
Rate:
Exam Sessions:
2024 Model Paper Q9aKTU June 2024
Question Type:Part A (3M) & Part B (9M)
💡EXAM NOTE
Top-down stepwise refinement: Breaking a complex problem into sub-problems until each module is independently solvable. Draw structure charts illustrating modular decomposition of a Student Grade Calculation or ATM banking system.

Fundamental Python Syntax: Data Types, Type Casting & Operators

High Priority10x in Past Papers
Rate:
Exam Sessions:
2024 Model Paper Q9bKTU June 2024
Question Type:Part A (3M) & Part B (9M)
💡EXAM NOTE
Python core data types (int, float, complex, str, bool). Type casting: implicit vs explicit. Operators: Arithmetic, relational, logical (short-circuit evaluation), bitwise (&, |, ^, ~), and identity (is, is not) vs membership (in, not in).

Problem-Solving Phases: Definition, Modeling & Algorithm Validation

High Priority9x in Past Papers
Rate:
Exam Sessions:
2024 Model Paper Q1KTU S1 2023
Question Type:Part A (3M) & Part B (9M)
💡EXAM NOTE
Detail the 6 fundamental phases: Problem definition, mathematical/logical modeling, algorithm specification, verification, implementation, and empirical testing. Highlight difference between syntax and logical errors.

Heuristic Approaches & Means-End Analysis

Medium Priority8x in Past Papers
Rate:
Exam Sessions:
2024 Model Paper Q2KTU Dec 2023
Question Type:Part A (3M) & Part B (9M)
💡EXAM NOTE
Means-End Analysis: Identify the difference between the current state and goal state, then choose an operator that reduces this difference. Explain with Missionaries and Cannibals or Tower of Hanoi problem states.

Module 2Flowcharts, Selection & Iteration in Python

15 Marks
Exam Focus: Covers Flowcharts, Pseudocode, Conditional Branching, Loop structures (while/for), Loop Invariants, and Number-Theoretic algorithms.

Flowchart Design, Standard Symbols & Structured Pseudocode

High Priority10x in Past Papers
Rate:
Exam Sessions:
2024 Model Paper Q10aKTU Dec 2023
Question Type:Part A (3M) & Part B (9M)
💡EXAM NOTE
Draw correct ANSI standard flowchart shapes: Oval (Terminal), Parallelogram (Input/Output), Rectangle (Process), Diamond (Decision), Circle (Connector). Write clean pseudocode alongside flowchart for finding largest of three numbers or roots of quadratic equation.

Iteration Structures: while & for Loops, Loop Invariants & Termination

High Priority10x in Past Papers
Rate:
Exam Sessions:
2024 Model Paper Q3 & Q10bKTU Dec 2023
Question Type:Part A (3M) & Part B (9M)
💡EXAM NOTE
range(start, stop, step) semantics. Control jump statements: break, continue, pass. Explain for-else and while-else construct (else executes only if loop completes without hitting break). Loop invariant proof: Initialization, Maintenance, Termination.

Conditional Branching in Python: if, if-else, nested-if & elif Chains

High Priority9x in Past Papers
Rate:
Exam Sessions:
KTU June 2024KTU Dec 2022
Question Type:Part A (3M) & Part B (9M)
💡EXAM NOTE
Indentation semantics in Python. Multi-way branching with if-elif-else. Implement electricity bill calculation with tiered slab tariffs or student grading system.

Number-Theoretic Algorithms: Sieve of Eratosthenes & Prime Factorization

High Priority9x in Past Papers
Rate:
Exam Sessions:
2024 Model Paper Q11aKTU June 2024
Question Type:Part A (3M) & Part B (9M)
💡EXAM NOTE
Sieve of Eratosthenes algorithm: Boolean array of size n+1n+1; cross out multiples of primes starting from p2p^2 up to n\sqrt{n}. Time complexity O(nlog⁡log⁡n)O(n \log \log n). Compare with naive O(nn)O(n \sqrt{n}) trial division. Euclidean GCD algorithm: gcd⁡(a,b)=gcd⁡(b,a(modb))\gcd(a, b) = \gcd(b, a \pmod b).

Module 3Recursion & Divide-and-Conquer Algorithms

15 Marks
Exam Focus: Covers Recursion Principles, Call Stack execution, Divide-and-Conquer paradigm (Binary Search, Merge Sort), and Python Data Structures (Lists, Tuples, Dictionaries).

Recursion Principles: Base Cases, Recursive Steps & Call Stack Execution

High Priority10x in Past Papers
Rate:
Exam Sessions:
2024 Model Paper Q4 & Q12aKTU Dec 2023
Question Type:Part A (3M) & Part B (9M)
💡EXAM NOTE
Every recursive function requires: (1) At least one Base Case that terminates without recursive call, (2) Recursive case that moves closer to base case. Draw call stack frame diagrams showing activation records, parameter passing, return address, and unwinding.

Divide-and-Conquer Paradigm: Binary Search & Merge Sort Analysis

High Priority10x in Past Papers
Rate:
Exam Sessions:
2024 Model Paper Q12bKTU Dec 2023
Question Type:Part A (3M) & Part B (9M)
💡EXAM NOTE
Three steps: Divide problem into smaller sub-problems, Conquer sub-problems recursively, Combine solutions. Binary Search: T(n)=T(n/2)+O(1)  ⟹  O(log⁡n)T(n) = T(n/2) + O(1) \implies O(\log n). Merge Sort: T(n)=2T(n/2)+O(n)  ⟹  O(nlog⁡n)T(n) = 2 T(n/2) + O(n) \implies O(n \log n) in all cases.

Classic Recursive Algorithms: Fibonacci Sequence & Tower of Hanoi

High Priority9x in Past Papers
Rate:
Exam Sessions:
KTU June 2024KTU Dec 2022
Question Type:Part A (3M) & Part B (9M)
💡EXAM NOTE
Tower of Hanoi: T(n)=2T(n−1)+1  ⟹  O(2n)T(n) = 2 T(n-1) + 1 \implies O(2^n) moves. Algorithm: Move n−1n-1 discs from Source to Aux using Dest; move nn-th disc to Dest; move n−1n-1 discs from Aux to Dest using Source. Trace 3 discs step by step.

Python Collections: Lists, Tuples, Dictionaries & Slicing Operations

High Priority9x in Past Papers
Rate:
Exam Sessions:
2024 Model Paper Q5KTU June 2024
Question Type:Part A (3M) & Part B (9M)
💡EXAM NOTE
Mutable (List, Dict, Set) vs Immutable (Tuple, String). List slicing: list[start:stop:step] (e.g. list[::-1] for reversal). Dictionary methods: keys(), values(), items(), get(k, default). List comprehension syntax: [x**2 for x in nums if x%2==0].

Module 4Greedy Algorithms, Dynamic Programming & Backtracking

15 Marks
Exam Focus: Covers Greedy Strategy (Fractional Knapsack, Activity Selection), Dynamic Programming (0/1 Knapsack, LCS, Memoization vs Tabulation), and Backtracking (N-Queens).

Greedy Strategy: Core Philosophy, Fractional Knapsack & Activity Selection

High Priority10x in Past Papers
Rate:
Exam Sessions:
2024 Model Paper Q13aKTU Dec 2023
Question Type:Part A (3M) & Part B (9M)
💡EXAM NOTE
Greedy property: Makes locally optimal choice at each step hoping for global optimum. Explain Fractional Knapsack algorithm: Sort by value/weight descending; take complete items while capacity allows; take fraction of next item. O(nlogn)O(n log n) time.

Dynamic Programming Principles: Overlapping Subproblems & Optimal Substructure

High Priority10x in Past Papers
Rate:
Exam Sessions:
2024 Model Paper Q6KTU June 2024
Question Type:Part A (3M) & Part B (9M)
💡EXAM NOTE
Contrast Divide-and-Conquer (independent subproblems) with Dynamic Programming (overlapping subproblems). Compare Memoization (top-down caching of recursive calls) and Tabulation (bottom-up table construction).

0/1 Knapsack Problem & Longest Common Subsequence (LCS)

High Priority10x in Past Papers
Rate:
Exam Sessions:
2024 Model Paper Q13bKTU Dec 2023KTU Dec 2022
Question Type:Part A (3M) & Part B (9M)
💡EXAM NOTE
0/1 Knapsack recurrence: V[i, w] = max(V[i-1, w], viv_{i} + V[i-1, w - wiw_{i}]) if wiw_{i} <= w, else V[i-1, w]. Construct 2D table step by step. Contrast why Greedy fails for 0/1 Knapsack but works for Fractional. LCS recurrence: c[i, j] = c[i-1, j-1] + 1 if X[i]==Y[j], else max(c[i-1, j], c[i, j-1]).

Backtracking Fundamentals: State-Space Tree & N-Queens Problem

High Priority9x in Past Papers
Rate:
Exam Sessions:
2024 Model Paper Q14KTU June 2024
Question Type:Part A (3M) & Part B (9M)
💡EXAM NOTE
Backtracking builds candidates incrementally and abandons ('prunes') a partial candidate as soon as it determines it cannot possibly lead to a valid solution. Draw the state-space tree for 4-Queens problem showing dead-end pruning.
Spot an error, wrong question, or missing topic? Let us know so we can fix it right away!
2024 SchemeBETA•60 Marks ESE•2 Hours 30 Minutes
Practice Paper Blueprint
Reg No.: _____________________Name: _____________________

KTUNOTES.LIVE PAPER (BETA)

2024 SCHEME SAMPLE QUESTION PAPER

Independent practice paper prepared by KTUNOTES.LIVE for academic revision and self-assessment. Not affiliated with or endorsed by APJ Abdul Kalam Technological University.
Course Code: UCEST105  •  Course Name: Algorithmic Thinking with Python
Max. Marks: 60Duration: 2 Hours 30 MinutesScheme: 2024 Scheme (4 Modules)
Instructions: Answer all questions from Part A (3 marks each). Answer any one full question from each of the 4 modules in Part B (9 marks each).
PART A
(Answer all questions, each carries 3 marks)  •  8 × 3 = 24 Marks
Q1.
Differentiate between an algorithm, a flowchart, and pseudocode. Give an example of a flowchart symbol for input/output.
Module 1 • CO1 • K2
(3)
Q2.
Explain the purpose of the is operator versus the == operator in Python with suitable code snippets.
Module 1 • CO1 • K2
(3)
Q3.
Write a Python function using recursion to calculate the factorial of a positive integer nn. State the base case and recursive step.
Module 2 • CO2 • K3
(3)
Q4.
Explain the difference between break, continue, and pass statements in Python loops with a simple example for each.
Module 2 • CO2 • K2
(3)
Q5.
Compare Python Lists and Tuples with respect to mutability, memory consumption, and syntax.
Module 3 • CO3 • K2
(3)
Q6.
Given a list of numbers L=[1,2,3,4,5,6,7,8,9,10]L = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], write a single list comprehension to extract all even numbers squared.
Module 3 • CO3 • K3
(3)
Q7.
Explain how exceptions are handled in Python using try, except, else, and finally blocks.
Module 4 • CO4 • K2
(3)
Q8.
Write Python code to open an existing file sample.txt, count the number of lines and words, and close the file safely using the with statement.
Module 4 • CO4 • K3
(3)
PART B
(Answer one full question from each module, each carries 9 marks)  •  4 × 9 = 36 Marks
MODULE 1
Q9.
(a) Draw a complete flowchart and write the Python program to find the roots of a quadratic equation ax2+bx+c=0a x^2 + b x + c = 0 considering real, equal, and complex roots. (5 Marks) (b) Explain type conversion in Python. Distinguish between implicit and explicit type casting with clear illustrative examples. (4 Marks)
Module 1 • CO1 • K3
(9)
OR
Q10.
(a) Develop an algorithm and write a Python script to check whether a given positive integer is an Armstrong number or not. (5 Marks) (b) Explain operator precedence and associativity in Python. Evaluate the expression x=4+3×23//4−5x = 4 + 3 \times 2^3 // 4 - 5 step-by-step. (4 Marks)
Module 1 • CO1 • K3
(9)
MODULE 2
Q11.
(a) Write a Python program to generate Fibonacci series up to NN terms using a function with default arguments. (5 Marks) (b) Explain the scope and lifetime of variables in Python. Differentiate between local, global, and nonlocal variables with code examples. (4 Marks)
Module 2 • CO2 • K3
(9)
OR
Q12.
(a) Write a recursive Python function to solve the Tower of Hanoi problem for nn disks. Print all disk movements step-by-step. (5 Marks) (b) Explain lambda functions in Python. Demonstrate how map(), filter(), and reduce() can be used with lambda functions to process a list of integers. (4 Marks)
Module 2 • CO2 • K3
(9)
MODULE 3
Q13.
(a) Write a Python program to perform matrix multiplication of two 3×33 \times 3 matrices represented as nested lists without using any external library. (5 Marks) (b) Explain Dictionary operations in Python. Write code to count the frequency of each character in an input string and display the results in sorted order of keys. (4 Marks)
Module 3 • CO3 • K3
(9)
OR
Q14.
(a) Develop a Python program to read student records (Roll No, Name, Marks in 3 subjects) into a list of dictionaries. Calculate average marks and display the top-ranking student. (5 Marks) (b) Explain Set operations in Python: union, intersection, difference, and symmetric difference. Provide code demonstrating each operation. (4 Marks)
Module 3 • CO3 • K3
(9)
MODULE 4
Q15.
(a) Write a Python program that reads a text file data.txt, replaces all occurrences of a target word with a replacement word, and writes the output to updated.txt. Handle FileNotFoundError gracefully. (5 Marks) (b) Define custom exceptions in Python. Write a program to create a user-defined exception InvalidAgeError that is raised when age is less than 18. (4 Marks)
Module 4 • CO4 • K3
(9)
OR
Q16.
(a) Explain the difference between text files and binary files in Python. Demonstrate how to write and read objects to a binary file using the pickle module. (5 Marks) (b) Explain Python module creation and importing mechanisms. Differentiate between import module and from module import * in terms of namespace management. (4 Marks)
Module 4 • CO4 • K2
(9)
*** END OF QUESTION PAPER ***
Downloaded from https://ktunotes.liveUCEST105 • KTUNOTES.LIVE Paper (Beta)
Notice an error, typo, or formula discrepancy in this paper?