5. Difference between C and C++.
Ans: C++ can be considered as a superset of C, most C programs except some exceptions, work in C++ and C.
C programming is a little bit limited and is a procedural programming language, but C++ supports both procedural and Object-Oriented programming
Since C++ supports object-oriented programming, it is capable of performing tasks like function overloading, templates, inheritance, virtual functions, friend functions. These features are not present in C.
C++ supports exception handling at the language level, in C exception handling is done in the traditional if-else style.
C++ supports references, C doesn’t.
In C, scanf() and printf() are mainly used for input/output. C++ mainly uses streams to perform input and output operations. cin is a standard input stream and cout is a standard output stream.
6. What makes lists different from tuples in python?
Ans: The main difference between list and tuples is :
List can be modified whereas tuples cannot be modified.
7. What are the different types of models available in SDLC?
Ans: Different types of SDLC models include:-
- Waterfall Model
- Iterative Waterfall Model
- Agile Model
- Spiral Model
- Prototype Model
- V model
- RAD model
8. What are the key features of python?
Ans: The key features of python includes:
- Object-oriented
- Dynamically typed language
- Interpreted language
- Extensible
- Dynamic memory allocation
- Integrated
9. What are joins in DBMS?
Ans: Joins are used to retrieve data from multiple tables. In all databases, if you are joining n tables then we are using n -1 join condition.
10. What is SDLC OR Software Development Life Cycle?
Ans: SDLC or Software Development Life Cycle as the name suggest s is the life cycle representing the process of building software. SDLC models include all the phases of software development.
The interviewer gave me two coding problems and asked me to solve one among them. As much as I can remember, the questions were:
- Write a program to check whether a given number is prime or not.
Working:
For an input num
Initialize count = 0
Run an iterative for loop in iteration of (i) b/w 1 -> num
Check if num is divisible i
If divisible increment count
If num == 0 or num == 1 : Not Prime
If count > 2 : Not prime
Else, it is Prime
Code: