Droisys
10+ RebelLink Interview Questions and Answers
Q1. What are the basic fundamental types in python
Python has four basic fundamental types: integers, floats, booleans, and strings.
Integers are whole numbers, positive or negative, without decimals.
Floats are numbers with decimals.
Booleans are either True or False.
Strings are sequences of characters enclosed in quotes.
Q2. List some key differences between python 2.x and python 3.x
Python 3.x is not backward compatible with Python 2.x due to several changes in syntax and features.
Print statement is replaced with print() function
Division operator (/) returns float instead of integer
Unicode support is improved
Some modules and functions are renamed or removed
New syntax for exception handling
Different way of handling byte strings
Different way of importing modules
Different way of defining classes
Different way of handling metaclasses
Q3. What is decorator in python
Decorator is a design pattern in Python that allows adding behavior to an object dynamically.
Decorators are functions that take another function as input and extend its behavior without modifying it.
They are denoted by '@' symbol followed by the name of the decorator function.
They can be used to add functionality like logging, timing, caching, etc. to a function.
They can also be stacked to apply multiple decorators to a function.
Decorators can be defined as classes as well, u...read more
Q4. What are moderators in python
Moderators are objects that control the flow of execution in Python generators.
Moderators are used to pause and resume the execution of a generator function.
They are created using the yield keyword.
The send() method is used to send a value to the generator and resume its execution.
The throw() method is used to raise an exception in the generator.
The close() method is used to terminate the generator.
Examples: itertools.count(), itertools.cycle(), and itertools.repeat().
Q5. Difference between list and tuple
List is mutable while tuple is immutable. List uses square brackets while tuple uses parentheses.
Lists can be modified while tuples cannot
Lists use square brackets [] while tuples use parentheses ()
Lists are used for collections of homogeneous items while tuples are used for heterogeneous items
Lists are slower than tuples
Lists have more built-in methods than tuples
Q6. What is encapsulation
Encapsulation is the concept of bundling data and methods that operate on the data into a single unit.
Encapsulation helps in hiding the internal state of an object and restricting access to it.
It allows for better control over the data by preventing outside code from directly accessing it.
Encapsulation also helps in achieving data abstraction, where the internal details of an object are hidden and only the necessary information is exposed to the outside world.
Q7. What is Polymorphism
Polymorphism is the ability of a single function or method to operate on different types of data.
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
It enables a single interface to represent multiple underlying data types.
Examples include method overloading and method overriding in object-oriented programming.
Q8. Interface in java
Interface in Java is a reference type in Java, similar to a class, that can contain only abstract methods, default methods, static methods, and constant variables.
Interfaces are used to achieve abstraction and multiple inheritance in Java.
All methods in an interface are public and abstract by default.
A class can implement multiple interfaces but can only extend one class.
Example: interface Shape { void draw(); }
Example: interface Drawable { void draw(); }
Q9. Difference between stored procedure and functions?
Stored procedures are used to perform an action, while functions return a value.
Stored procedures are precompiled and stored in the database, while functions are compiled at runtime.
Functions can be used in SQL statements, while stored procedures cannot be used in SQL statements.
Functions can be called from within stored procedures, but stored procedures cannot be called from within functions.
Functions can have input parameters, while stored procedures can have both input and...read more
Q10. Difference between == & === ?
The == operator compares values, while the === operator compares values and types.
The == operator performs type coercion, while the === operator does not.
The == operator returns true if the values are equal after type coercion, while the === operator returns true only if the values and types are equal.
For example, 1 == '1' returns true, but 1 === '1' returns false.
Interview Process at RebelLink
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month