0% found this document useful (0 votes)
19 views2 pages

CTS Python Interview Questions

Uploaded by

iblamemjc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views2 pages

CTS Python Interview Questions

Uploaded by

iblamemjc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Top CTS Python Interview Questions

While going for an interview, it is always better to be well prepared. You can have
a word with your acquaintances who have attended interviews for similar posts or at
CTS. This will help you get an idea of how to go about with your preparations. Here
we have provided some of the python interview questions for you.

1. Why are linked lists better than arrays?


Linked lists are better than arrays in the following ways:

For insertion and deletion, we only need to update the address present in the next
pointer of a node.
We do not have to provide an initial size during the time of creation since it can
grow and shrink at runtime by allocating and deallocating memory.
Since it is allocated during the runtime, no memory is wasted.
2. What is TCP/IP protocol?
TCP/IP protocol, also known as Transmission Control/Internet Protocol, is a set of
communication protocols used to interconnect network devices on the internet.

3. What is the Hamming Code?


It is a set of error-correction codes that arise when data is transferred from one
source to another. These codes can detect one-bit and two-bit errors and rectify
one-bit errors without the detection of uncorrected errors.

4. What are pure virtual functions?


A pure virtual function is a function for which we only need to declare, not
define.

5. How is a router different from a gateway?


A router connects multiple network segments and directs traffic in the network. It
transfers data from source to destination in form of packets. It can send data
between similar networks only. A gateway also regulates the network traffic but it
can send data between two dissimilar networks.

6. Can a database table exist without a primary key?


Yes, a database table can exist without a primary key.

7. Write down a program to show the largest number among three numbers using binary
minus operator.
package javaapplication9;
import java.util.Scanner;

public class JavaApplication9 {

public static void main(String[] args)

{
Scanner s = new Scanner(System.in);

int x = s.nextInt();

int y = s.nextInt();

int z = s.nextInt();

if(x-y>0 && x-z>0)

System.out.println(“Largest is a :-“+x);
else
if(y-z>0)
System.out.println(“\nLargest is y :-“+y);
else
System.out.println(“\nLargest is y :-“+z);
}
}

8. What is the difference between method overloading and method overriding?


Method Overloading is used to increase the readability of a program whereas method
overriding provides specific implementation of the method that is already provided
by super class.

9. What is Pass in Python?


In Python, pass statement is a null statement. It is used to delay the time of
compilation.

10. What Is the Difference Between Del and Remove() on Lists?


The del function removes all elements of a list within a given range whereas
remove() removes the first occurrence of a particular character.

11. Explain BCNF.


BCNF or Boycs Codd Normal Form, is an advanced version of 3nf form.

For a table to be in BCNF form it must fulfill the following properties:-

should be in 3nf
every functional dependency, A->B, must be a superkey
Knowledge of Python programming offers numerous career opportunities in CTS. A
career as a python developer in CTS is both financially rewarding and fulfilling.
With the right preparation, you will be able to embark on your dream career.

12. What is the use of break statement?


Break Statement is used to terminate a loop. When a break statement is encountered
within a loop, the loop iterations stop and the control returns to the first
statement after the loop.

13. What is the difference between SciPy and NumPy?


SciPy consists of all the numerical code. NumPy contains array data and basic
operations such as sorting, indexing, etc.

14. How can you copy an object in Python?


To copy an object in Python, we use = operator. It creates a new variable that
shares the reference of the original object.

15. Differentiate between pickling and unpickling?


Pickling, also known as serialization, converts a Python object hierarchy to a byte
stream. On the other hand, unpickling, also known as deserialization, converts a
byte stream to a Python object hierarchy.

You might also like