Impetus Technologies
Fidelity International Interview Questions and Answers
Q1. Overloading with different return type allowed or not
Overloading with different return type is not allowed in Java.
Overloading is based on method signature, not return type
Methods with same name and different return type will result in compile-time error
Example: int add(int a, int b) and double add(int a, int b) is not allowed
Q2. How to remove duplicates from string
Use a set to remove duplicates from a string array.
Create a set to store unique strings.
Iterate through the array and add each string to the set.
Convert the set back to an array to get the unique strings.
Q3. How to achieve authentication in web API
Authentication in web API is achieved by using tokens or API keys to verify the identity of users.
Use tokens (such as JWT) to authenticate users
Implement OAuth for secure authentication
Utilize API keys for authentication purposes
Q4. Sealed virtual static new keyword use
Sealed virtual static new keywords are used in C# to control inheritance and method hiding.
Sealed keyword prevents a class from being inherited.
Virtual keyword allows a method to be overridden in derived classes.
Static keyword makes a member of a class accessible without creating an instance of the class.
New keyword hides a method from the base class in the derived class.
Q5. Diff interface vs abstract class
Interface defines a contract for classes to implement, while abstract class can have both abstract and concrete methods.
Interfaces can only have abstract methods and constants, while abstract classes can have both abstract and concrete methods.
A class can implement multiple interfaces but can only inherit from one abstract class.
Interfaces are used to achieve multiple inheritance in Java, while abstract classes are used to provide a common base for subclasses.
Q6. Diff string string builder
Diff string string builder compares two strings and returns the differences.
Use a loop to iterate through each character of the strings
Compare characters at the same index in both strings
Build a new string with the differing characters
Q7. Diff array vs array list
Arrays are fixed in size, while ArrayLists can dynamically resize.
Arrays have a fixed size determined at initialization, while ArrayLists can dynamically resize.
Arrays are faster for accessing elements, while ArrayLists are better for adding or removing elements.
Arrays use [] syntax for accessing elements, while ArrayLists use get() and set() methods.
Arrays can only store primitive types, while ArrayLists can store objects.
Q8. Diff = vs .equal
Diff method compares values of two objects while equal method compares references of two objects.
Diff method compares values of two objects, while equal method compares references.
Diff method is used to check if two objects are different, while equal method is used to check if two objects are the same.
Example: obj1.diff(obj2) vs obj1.equal(obj2)
Q9. Four pillars of OOPS
Encapsulation, Inheritance, Polymorphism, Abstraction
Encapsulation: Bundling data and methods that operate on the data into a single unit
Inheritance: Ability of a class to inherit properties and behavior from another class
Polymorphism: Ability to present the same interface for different data types
Abstraction: Hiding the complex implementation details and showing only the necessary features
More about working at Impetus Technologies
Top Lead Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month