Infosys BPM
10+ Alf Electric Vehicles Interview Questions and Answers
Q1. Examples of encapsulation and polymorphism,types of classes,what requirements we need to write a good code.
Encapsulation and polymorphism examples, class types, and requirements for good code.
Encapsulation: hiding implementation details, e.g. private variables in a class
Polymorphism: using a single interface to represent multiple types, e.g. method overloading
Class types: abstract, final, static, inner, anonymous, etc.
Requirements for good code: readability, maintainability, efficiency, scalability, etc.
Q2. What is the difference between the TRUNCATE and DELETE commands in a database?
TRUNCATE removes all records from a table, while DELETE removes specific records based on a condition.
TRUNCATE is faster than DELETE as it does not log individual row deletions.
TRUNCATE resets the auto-increment value of the table, while DELETE does not.
TRUNCATE cannot be rolled back, while DELETE can be rolled back if used within a transaction.
TRUNCATE does not trigger any delete triggers on the table, while DELETE does.
Q3. How to reverse a string in python
To reverse a string in Python, we can use slicing or the built-in reversed() function.
Using slicing: string[::-1]
Using reversed() function: ''.join(reversed(string))
Both methods return the reversed string
Q4. What are the four pillars of Object-Oriented Programming (OOP)?
The four pillars of Object-Oriented Programming are encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation: Bundling data and methods that operate on the data into a single unit (class).
Inheritance: Allowing a new class to inherit properties and behavior from an existing class.
Polymorphism: The ability for objects of different classes to respond to the same message in different ways.
Abstraction: Hiding the complex implementation details and showing only the n...read more
Q5. Why java doesn't support multiple inheritance?
Java doesn't support multiple inheritance to avoid the diamond problem.
Multiple inheritance can lead to the diamond problem where a class inherits from two classes with a common parent.
This can cause ambiguity in method calls and lead to code complexity.
Java supports multiple interface inheritance to achieve similar functionality.
For example, a class can implement multiple interfaces to inherit their methods.
This allows for code reuse without the complexity of multiple inheri...read more
Q6. Write a program to find reverse of a string without using inbuilt methods
Program to reverse a string without using inbuilt methods
Create an empty string to store the reversed string
Iterate through the original string from end to start and append each character to the new string
Return the reversed string
Q7. What is operating system What is view and tuples
An operating system is a software that manages computer hardware and software resources and provides common services for computer programs.
An OS acts as an interface between the user and the computer hardware.
It manages memory, processes, and input/output devices.
Examples of OS include Windows, macOS, Linux, and Android.
View is a virtual table that displays data from one or more tables in a database.
Tuples are rows in a table that contain data for each column.
Q8. Why java string are immutable?
Java strings are immutable to ensure security, thread safety, and performance optimization.
Immutable strings prevent malicious code from modifying the string content.
Immutable strings can be safely shared across multiple threads without synchronization issues.
Immutable strings allow for efficient memory allocation and garbage collection.
String pool in Java is possible because of immutability.
Examples of immutable classes in Java include Integer, Float, and Boolean.
Q9. What is compiler What is class file
A compiler is a program that translates source code into machine code.
Compilers are used to convert high-level programming languages into low-level machine code.
They perform lexical analysis, syntax analysis, semantic analysis, and code generation.
Examples of compilers include GCC, Clang, and Visual C++.
Compilers can optimize code for performance and size.
Class files are the compiled output of Java source code, containing bytecode that can be executed on the Java Virtual Mach...read more
Q10. What is Stack and Queue?
Stack is a data structure that follows Last In First Out (LIFO) principle. Queue is a data structure that follows First In First Out (FIFO) principle.
Stack: LIFO principle, push and pop operations, examples - function call stack, undo feature in software applications
Queue: FIFO principle, enqueue and dequeue operations, examples - printer queue, message queue in operating systems
Top HR Questions asked in Alf Electric Vehicles
Interview Process at Alf Electric Vehicles
Top System Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month