Viva Questions

INT108

Unit 1 Python Versions Easy
1
What is the primary difference between Python 2 and Python 3 mentioned in the syllabus regarding backward compatibility?
Unit 1 Environment Setup Medium
2
Why is it critical to check 'Add Python to PATH' during installation on Windows?
Unit 1 Variables Easy
3
Explain the concept of Dynamic Typing in Python.
Unit 1 Variable Naming Easy
4
List three rules for naming variables in Python.
Unit 1 Operators Medium
5
What is the difference between the / operator and the // operator?
Unit 1 String Operations Medium
6
How does the * operator function when applied to a string?
Unit 1 Errors Easy
7
What causes a NameError in Python?
Unit 1 Order of Operations Medium
8
Explain the PEMDAS rule in Python expression evaluation.
Unit 1 Composition Hard
9
What is 'Composition' in the context of Python statements?
Unit 1 Comments Easy
10
How do you denote a single-line comment versus a multi-line comment in Python?
Unit 2 The Modulus Operator Medium
11
What are two common use cases for the Modulus operator (%)?
Unit 2 Random Numbers Easy
12
What does random.random() return compared to random.randint(a, b)?
Unit 2 Logic Operators Hard
13
Explain 'Short-circuit evaluation' in Python logical operators.
Unit 2 Boolean Expressions Easy
14
What is the difference between = and ==?
Unit 2 Conditional Statements Medium
15
When would you use elif instead of a nested else: if structure?
Unit 2 While Loops Medium
16
Why is a while loop called 'indefinite iteration'?
Unit 2 Loop Control Medium
17
Differentiate between break and continue.
Unit 2 For Loops Medium
18
What sequence does range(2, 10, 2) generate?
Unit 2 Encapsulation Hard
19
How does Encapsulation improve code quality in the context of loops?
Unit 2 Generalization Hard
20
What is Generalization in programming functions?
Unit 3 Function Types Easy
21
What is the difference between a Fruitful function and a Void function?
Unit 3 Type Conversion Medium
22
Explain the difference between Type Coercion and Type Casting.
Unit 3 Math Functions Easy
23
What does math.ceil(4.2) return and why?
Unit 3 Variable Scope Medium
24
What is the scope of a 'Local Variable'?
Unit 3 Parameters vs Arguments Medium
25
Technically, how do Parameters differ from Arguments?
Unit 3 Argument Types Medium
26
How do Keyword Arguments differ from Positional Arguments?
Unit 3 Arbitrary Arguments Hard
27
When would you use *args in a function definition?
Unit 3 Recursion Hard
28
What are the two mandatory parts of a recursive function to avoid infinite loops?
Unit 3 Recursion Memory Hard
29
What is a limitation of using recursion regarding memory?
Unit 3 Flow of Execution Medium
30
Describe the flow of execution when a function is called.
Unit 4 String Immutability Medium
31
What does it mean that strings are 'immutable' in Python?
Unit 4 Slicing Medium
32
In the slice s[start:stop], is the stop index inclusive or exclusive?
Unit 4 Lists vs Tuples Easy
33
What is the primary difference between a List and a Tuple?
Unit 4 List Deletion Medium
34
How does pop() differ from remove() in lists?
Unit 4 Tuple Assignment Medium
35
How can you swap values of two variables a and b using tuple assignment?
Unit 4 Dictionary Basics Easy
36
What are the requirements for keys in a Python dictionary?
Unit 4 Dictionary Methods Medium
37
Why would you use the get() method instead of bracket notation dict[key]?
Unit 4 Sparse Matrices Hard
38
How can dictionaries be used to represent sparse matrices efficiently?
Unit 4 Aliasing Hard
39
What is Aliasing in the context of lists?
Unit 4 Copying Hard
40
What is the difference between a Shallow Copy and a Deep Copy?
Unit 5 OOP Concepts Easy
41
Define 'Class' and 'Object'.
Unit 5 Constructors Medium
42
What is the purpose of the __init__ method?
Unit 5 The self Parameter Medium
43
What does self represent in a Python class method?
Unit 5 Inheritance Easy
44
What is Class Inheritance?
Unit 5 Method Overriding Medium
45
What is Method Overriding?
Unit 5 Super Function Hard
46
What is the use of the super() function in inheritance?
Unit 5 Encapsulation Medium
47
How do you denote a 'Private' attribute in Python, and what does it do?
Unit 5 Name Mangling Hard
48
Can private attributes be accessed at all? If so, how?
Unit 5 Function Overloading Medium
49
Does Python support traditional function overloading? How is it handled?
Unit 5 Attributes Easy
50
What is the difference between Class Attributes and Instance Attributes?
Unit 6 File Modes Easy
51
What is the difference between 'w' and 'a' modes in file handling?
Unit 6 Context Managers Medium
52
Why is it best practice to use the with statement when opening files?
Unit 6 Reading Files Medium
53
What is the difference between read() and readlines()?
Unit 6 Writing Files Easy
54
Can you pass an integer directly to the file.write() method?
Unit 6 Serialization Hard
55
What is 'Pickling' in Python?
Unit 6 Exception Handling Medium
56
What is the purpose of the try...except block?
Unit 6 The Else Block Medium
57
When does the else block execute in a try...except...else structure?
Unit 6 Regular Expressions Easy
58
What do the metacharacters . and ^ represent in Regex?
Unit 6 Regex Functions Medium
59
How does re.match() differ from re.findall()?
Unit 6 Regex Special Sequences Medium
60
What do \d and \w match in a Regular Expression?