Premium Employer

Xoriant

4.0
based on 1.7k Reviews
Filter interviews by

100+ Interview Questions and Answers

Updated 16 Dec 2024
Popular Designations

Q1. String is immutable but what happens if we assign another value to that string reference

Ans.

Assigning another value to a string reference creates a new string object in memory.

  • Assigning a new value to a string reference creates a new string object in memory

  • The original string object remains unchanged

  • The new value is stored in a different memory location

  • The old value may be garbage collected if there are no other references to it

View 2 more answers

Q2. What are the advantages of python over other programming languages?

Ans.

Python is a versatile language with easy syntax, vast libraries, and cross-platform compatibility.

  • Python has a simple and readable syntax, making it easy to learn and write code quickly.

  • Python has a vast collection of libraries and frameworks for various purposes, such as web development, data analysis, and machine learning.

  • Python is cross-platform compatible, meaning that code written on one platform can run on another without modification.

  • Python has a large and active commu...read more

View 1 answer

Q3. Tell me some of the data types that are used in python?

Ans.

Python has several data types including integers, floats, strings, booleans, lists, tuples, dictionaries, and sets.

  • Integers represent whole numbers, e.g. 5, -10.

  • Floats represent decimal numbers, e.g. 3.14, -2.5.

  • Strings represent sequences of characters, e.g. 'hello', 'Python'.

  • Booleans represent either True or False.

  • Lists are ordered collections of items, e.g. [1, 2, 3].

  • Tuples are similar to lists but immutable, e.g. (1, 2, 3).

  • Dictionaries are key-value pairs, e.g. {'name': 'J...read more

View 2 more answers

Q4. What is the difference between the list & array in python?

Ans.

Lists and arrays in Python are both used to store multiple values, but they have some key differences.

  • Lists can store elements of different data types, while arrays can only store elements of the same data type.

  • Lists are dynamic in size, meaning they can grow or shrink as needed, while arrays have a fixed size.

  • Lists have built-in methods for manipulation and iteration, while arrays require the use of external libraries like NumPy for similar functionality.

View 1 answer
Discover null interview dos and don'ts from real experiences

Q5. What are the constructors in python? Explain in detail about their functionality.

Ans.

Constructors in Python are special methods used to initialize objects. They are called automatically when an object is created.

  • Constructors have the same name as the class they belong to.

  • They are defined using the __init__() method.

  • Constructors can take arguments to initialize instance variables.

  • If a class does not have a constructor, Python provides a default constructor.

  • Constructors can also be used to perform any other setup tasks needed for the object.

Add your answer

Q6. What are the building blocks of object oriented programming? Explain in detail.

Ans.

Building blocks of OOP include encapsulation, inheritance, and polymorphism.

  • Encapsulation: bundling data and methods that operate on that data within a single unit

  • Inheritance: creating new classes from existing ones, inheriting their properties and methods

  • Polymorphism: ability of objects to take on many forms, allowing for flexibility and extensibility

  • Examples: class, object, method, constructor, interface, abstract class

Add your answer
Are these interview questions helpful?

Q7. What are joins in SQL? Explain all the join with their real world application.

Ans.

Joins in SQL are used to combine data from two or more tables based on a related column.

  • Inner join returns only the matching rows from both tables.

  • Left join returns all the rows from the left table and matching rows from the right table.

  • Right join returns all the rows from the right table and matching rows from the left table.

  • Full outer join returns all the rows from both tables.

  • Real world applications include combining customer and order data, employee and salary data, and p...read more

Add your answer

Q8. try{...}finally{..} what happens if exception thrown from try block

Ans.

The finally block will always execute, even if an exception is thrown from the try block.

  • The finally block is used to execute code that should always run, regardless of whether an exception is thrown or not.

  • If an exception is thrown from the try block, the code in the finally block will still execute.

  • This is useful for cleaning up resources, such as closing files or database connections.

  • Example: try { // code that may throw an exception } finally { // code that should always ...read more

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. Is there any destructor in python? If yes then what is that destructor?

Ans.

Yes, Python has a destructor called __del__()

  • The __del__() method is called when an object is about to be destroyed

  • It is used to perform cleanup operations before the object is destroyed

  • The __del__() method is not guaranteed to be called in all cases

Add your answer

Q10. & at last What is index in SQL? What are their types?

Ans.

Indexes in SQL are used to improve query performance by allowing faster data retrieval.

  • Indexes are data structures that provide quick access to data in a table.

  • They are created on one or more columns of a table.

  • Types of indexes include clustered, non-clustered, unique, and full-text indexes.

  • Clustered indexes determine the physical order of data in a table, while non-clustered indexes are separate structures that point to the data.

  • Unique indexes ensure that each value in the i...read more

Add your answer

Q11. What is meant by slicing the list? What is its syntax?

Ans.

Slicing a list means extracting a portion of the list. Syntax: list[start:end:step]

  • Start index is inclusive, end index is exclusive

  • If start is not specified, it defaults to 0

  • If end is not specified, it defaults to the end of the list

  • If step is not specified, it defaults to 1

  • Negative indices count from the end of the list

Add your answer

Q12. How many types of values exist in python? Tell me their names.

Ans.

Python has four types of values: integers, floating-point numbers, strings, and booleans.

  • Integers are whole numbers, positive or negative, such as 5 or -10.

  • Floating-point numbers are decimal numbers, such as 3.14 or -2.5.

  • Strings are sequences of characters, enclosed in single or double quotes, such as 'hello' or "world".

  • Booleans are either True or False, used for logical operations.

Add your answer

Q13. how to get unique values from the collection using stream

Ans.

To get unique values from a collection using stream, use the distinct() method.

  • Call the distinct() method on the stream of the collection.

  • The distinct() method returns a stream of unique elements.

  • Use the collect() method to convert the stream back to a collection.

Add your answer

Q14. What Split() & Join() method? Why & where it is used?

Ans.

Split() & Join() are string methods used to split a string into an array and join an array into a string respectively.

  • Split() method is used to split a string into an array of substrings based on a specified separator.

  • Join() method is used to join the elements of an array into a string using a specified separator.

  • Both methods are commonly used in data processing and manipulation tasks.

  • Example: var str = 'apple,banana,orange'; var arr = str.split(','); // ['apple', 'banana', '...read more

Add your answer

Q15. What is global variable & local variable in python? When it is used?

Ans.

Global and local variables are used in Python to store values. Global variables can be accessed from anywhere in the code, while local variables are only accessible within a specific function.

  • Global variables are declared outside of any function and can be accessed from anywhere in the code

  • Local variables are declared within a function and can only be accessed within that function

  • Global variables can be modified from within a function using the 'global' keyword

  • Local variables...read more

Add your answer

Q16. How will you delete a file in python module using python code?

Ans.

To delete a file in Python module, use the os module's remove() method.

  • Import the os module

  • Use the remove() method to delete the file

  • Specify the file path in the remove() method

Add your answer

Q17. What are the basic datatypes used in python?

Ans.

Python has several built-in datatypes including int, float, bool, str, list, tuple, set, and dict.

  • int: used for integers, e.g. 5, -10

  • float: used for floating-point numbers, e.g. 3.14, -2.5

  • bool: used for boolean values, True or False

  • str: used for strings, e.g. 'hello', 'world'

  • list: used for ordered collections of items, e.g. [1, 2, 3]

  • tuple: used for ordered collections of items that cannot be changed, e.g. (1, 2, 3)

  • set: used for unordered collections of unique items, e.g. {1, ...read more

Add your answer

Q18. What are joins in SQL? Explain each with the real life example?

Ans.

Joins in SQL are used to combine data from two or more tables based on a related column.

  • Inner join returns only the matching rows from both tables.

  • Left join returns all the rows from the left table and matching rows from the right table.

  • Right join returns all the rows from the right table and matching rows from the left table.

  • Full outer join returns all the rows from both tables.

  • Example: Inner join can be used to combine customer and order tables based on customer ID.

Add your answer

Q19. What is the difference between literals & variables?

Ans.

Literals are fixed values while variables can hold different values during program execution.

  • Literals are hardcoded values in code, like 'hello' or 42

  • Variables are containers that can hold different values during program execution

  • Variables can be assigned literals or other variables

  • Variables can be used to store and manipulate data

  • Literals cannot be changed during program execution

Add your answer

Q20. Which python framework we can use in web development?

Ans.

Flask and Django are popular python frameworks for web development.

  • Flask is a micro web framework that is easy to learn and use.

  • Django is a full-stack web framework that provides many built-in features.

  • Other frameworks include Pyramid, Bottle, and Tornado.

  • Flask and Django both use the WSGI standard for serving web applications.

  • Flask is often used for small to medium-sized projects, while Django is better suited for larger projects.

  • Flask allows for more flexibility and customi...read more

Add your answer

Q21. What is function overloading & operator overloading?

Ans.

Function overloading is defining multiple functions with the same name but different parameters. Operator overloading is defining operators to work with user-defined types.

  • Function overloading allows a function to perform different operations based on the number, type, and order of parameters.

  • Operator overloading allows operators such as +, -, *, /, etc. to work with user-defined types.

  • Function overloading is resolved at compile-time while operator overloading is resolved at ...read more

Add your answer

Q22. What are python iterators? What is their functionality?

Ans.

Python iterators are objects that allow iteration over a collection of elements.

  • Iterators are used to access elements of a collection sequentially.

  • They are implemented using the __iter__() and __next__() methods.

  • The __iter__() method returns the iterator object and the __next__() method returns the next element in the collection.

  • Iterators can be used with loops, comprehensions, and other iterable functions.

  • Examples of built-in iterators in Python include range(), enumerate(),...read more

Add your answer

Q23. How will you delete a file in python module using a python code?

Ans.

To delete a file in Python module, use the os module's remove() method.

  • Import the os module

  • Use the remove() method to delete the file

  • Specify the file path in the remove() method

  • Example: import os; os.remove('file.txt')

Add your answer

Q24. How would you manage multi role login system?

Ans.

Multi role login system can be managed by assigning different access levels to each role.

  • Create a database table for roles and their access levels

  • Assign each user a role with corresponding access level

  • Implement role-based access control (RBAC) to restrict access to certain features

  • Use session management to keep track of user roles

  • Provide an admin panel to manage roles and access levels

Add your answer

Q25. difference between == and equals

Ans.

The '==' operator compares the reference of objects, while the 'equals' method compares the content of objects.

  • The '==' operator checks if two objects refer to the same memory location.

  • The 'equals' method compares the content of objects based on their implementation.

  • The 'equals' method can be overridden to provide custom comparison logic.

  • Example: String str1 = new String('hello'); String str2 = new String('hello'); str1 == str2 will be false, but str1.equals(str2) will be tru...read more

View 3 more answers

Q26. Tell me something about init() method in python?

Ans.

init() method is a constructor in Python that initializes an object when it is created.

  • It is called automatically when an object is created.

  • It takes self as the first parameter.

  • It can be used to initialize instance variables.

  • It can also take additional parameters.

  • Example: def __init__(self, name, age): self.name = name; self.age = age

Add your answer

Q27. What is pass by value & pass by reference?

Ans.

Pass by value and pass by reference are two ways of passing arguments to a function.

  • Pass by value means that a copy of the argument is passed to the function.

  • Pass by reference means that a reference to the argument is passed to the function.

  • In pass by value, any changes made to the argument inside the function do not affect the original value.

  • In pass by reference, any changes made to the argument inside the function affect the original value.

  • Pass by value is used for simple d...read more

Add your answer

Q28. If priority of test is -1, 0, 1. which executes first.

Ans.

Test with priority 1 executes first, followed by 0 and then -1.

  • Tests with higher priority are executed first

  • Priority can be used to determine the order of execution

  • Priority can be set in test management tools like JIRA or TestRail

Add your answer

Q29. Do python has any destructor? If yes then what is that destructor?

Ans.

Yes, Python has a destructor called __del__().

  • The __del__() method is called when an object is about to be destroyed.

  • It is used to perform cleanup operations before the object is destroyed.

  • The __del__() method is not guaranteed to be called, so it should not be relied upon for critical cleanup operations.

Add your answer

Q30. If we have @Service, @Controller, @Configuration, and @Repository why do we need @Component? Can we replace them with @Component?

Ans.

The @Component annotation is a generic stereotype annotation that can be used in place of other annotations.

  • The @Component annotation is a general-purpose annotation that can be used in place of @Service, @Controller, @Configuration, and @Repository annotations.

  • However, using more specific annotations can help in better understanding the role of the annotated class.

  • For example, using @Service annotation on a class that provides a service makes it easier to understand the purp...read more

Add your answer

Q31. How to take multiple values from dropdown , write the code

Ans.

To take multiple values from dropdown, use a loop to iterate through each option and select them.

  • Identify the dropdown element using its locator

  • Use the Select class to create an object for the dropdown

  • Use the getOptions() method to get all the options in the dropdown

  • Iterate through the options using a loop and select each option using the selectByVisibleText() or selectByValue() method

Add your answer

Q32. How do you deliver a release in Agile Scrum? What is the difference between monolith, multitenant and microservices, what do you know about kafka, how did you handle a conflict between 2 employees, how did you ...

read more
Ans.

Delivering a release in Agile Scrum involves continuous integration and delivery. Monolith, multitenant, and microservices differ in architecture. Kafka is a distributed streaming platform. Conflict resolution and managing client expectations are crucial skills.

  • Agile Scrum involves continuous integration and delivery

  • Monolith is a single, self-contained application, multitenant serves multiple clients, and microservices are independent components

  • Kafka is a distributed streamin...read more

View 4 more answers

Q33. What is SQL? Why is its application?

Ans.

SQL is a programming language used to manage and manipulate relational databases.

  • SQL stands for Structured Query Language.

  • It is used to create, modify, and query databases.

  • SQL is used in various industries such as finance, healthcare, and e-commerce.

  • Examples of SQL-based databases include MySQL, Oracle, and Microsoft SQL Server.

Add your answer

Q34. Coding Challenge (JS) - determine if words in given array are anagram or not

Ans.

Determines if words in given array are anagram or not using JS

  • Create a function that takes an array of strings as input

  • Loop through the array and sort each string alphabetically

  • Compare the sorted strings to check if they are equal

  • Return true if all strings are anagrams, else false

Add your answer

Q35. difference between lambda expression and method reference

Ans.

Lambda expression is an anonymous function while method reference refers to an existing method

  • Lambda expression is used to create an instance of a functional interface

  • Method reference is used to refer to an existing method of a class or object

  • Lambda expression uses the arrow operator (->) to separate the parameters and the body

  • Method reference uses the double colon (::) operator to separate the class or object and the method name

Add your answer

Q36. Coding challenge (JS) - remove duplicate entries from array

Ans.

Remove duplicate entries from array of strings using JavaScript

  • Use Set to remove duplicates

  • Convert Set back to array

  • Use spread operator to convert Set to array

Add your answer

Q37. Why I am getting elementNotPresent exception even element present on Page. Please explain

Ans.

ElementNotPresent exception occurs even if element is present on page. Why?

  • The element may not be loaded yet, so wait for it to load before checking

  • The element may be hidden or not visible on the page

  • The element may have a different name or ID than expected

  • The element may be in an iframe or shadow DOM

  • The element may have been removed or deleted from the page

Add your answer

Q38. & finally what is indexs in SQL? What are there types?

Ans.

Indexes in SQL are used to improve query performance by allowing faster data retrieval.

  • Indexes are data structures that store a small portion of the table data in an easily searchable format.

  • Types of indexes include clustered, non-clustered, unique, and full-text indexes.

  • Clustered indexes determine the physical order of data in a table, while non-clustered indexes create a separate structure for faster searching.

  • Unique indexes ensure that no two rows in a table have the same ...read more

Add your answer

Q39. What is the purpose of the method public static void main in a Java program? What is the difference between System.out.println and System.err.println? What is an interface in Java? When would you use an abstrac...

read more
Ans.

Answers to common Java interview questions

  • public static void main is the entry point of a Java program

  • System.out.println prints to standard output while System.err.println prints to standard error

  • An interface is a collection of abstract methods that can be implemented by a class

  • Use an abstract class when you want to provide a default implementation or when you need to inherit from multiple classes

  • Public methods can be accessed from anywhere while protected methods can only be...read more

Add your answer

Q40. What is the difference between python & other programming languages?

Ans.

Python is a high-level, interpreted programming language known for its simplicity, readability, and ease of use.

  • Python is dynamically typed, meaning that variable types are determined at runtime.

  • Python has a large standard library and a vast collection of third-party libraries.

  • Python is often used for web development, scientific computing, data analysis, and artificial intelligence.

  • Python code is typically shorter and more concise than code in other languages.

  • Python is slower...read more

Add your answer

Q41. What are the front end technologies you know?

Ans.

I am familiar with HTML, CSS, and JavaScript for front-end development.

  • HTML

  • CSS

  • JavaScript

View 1 answer

Q42. tell me about JIT compiler

Ans.

JIT compiler stands for Just-In-Time compiler. It dynamically compiles code during runtime for improved performance.

  • JIT compiler translates bytecode into machine code at runtime

  • It optimizes code execution by identifying frequently executed code and compiling it

  • Examples include the JIT compilers used in Java Virtual Machine (JVM) and .NET Common Language Runtime (CLR)

View 1 answer

Q43. CSS methods to fixed positions of headers and footers?

Ans.

CSS methods for fixed headers and footers

  • Use position: fixed property

  • Set top or bottom property to 0 for fixed header/footer

  • Add z-index property to ensure header/footer is on top

  • Consider using padding or margin to avoid overlapping content

View 2 more answers

Q44. difference in set and list , explain collections hierarchy , vector and array list

Ans.

Set and list are both collection types in Java. Vector and ArrayList are two implementations of List interface.

  • Set is an unordered collection of unique elements while List is an ordered collection of elements.

  • Collections hierarchy in Java includes Collection interface, List interface, Set interface, and Map interface.

  • Vector is a synchronized implementation of List interface while ArrayList is not synchronized.

  • Arrays are fixed in size while ArrayLists can grow dynamically.

  • Exam...read more

Add your answer

Q45. What is the difference between variable and literal?

Ans.

Variables are containers that store values while literals are values themselves.

  • Variables can be changed while literals cannot

  • Variables can be assigned to literals

  • Literals are used to represent fixed values

  • Variables are used to represent changing values

Add your answer

Q46. What are the building blocks of object oriented programming?

Ans.

The building blocks of object oriented programming are classes, objects, inheritance, encapsulation, and polymorphism.

  • Classes are templates for creating objects

  • Objects are instances of classes

  • Inheritance allows classes to inherit properties and methods from parent classes

  • Encapsulation is the practice of hiding implementation details from users

  • Polymorphism allows objects to take on multiple forms

Add your answer

Q47. What is operator overloading & function overloading?

Ans.

Operator overloading is the ability to redefine operators for user-defined types. Function overloading is the ability to define multiple functions with the same name but different parameters.

  • Operator overloading allows user-defined types to use operators such as +, -, *, /, etc.

  • Function overloading allows multiple functions to have the same name but different parameters.

  • Operator overloading and function overloading both provide a way to make code more readable and intuitive.

  • E...read more

Add your answer

Q48. How is memory arranged in python?

Ans.

Python uses a dynamic memory allocation technique called reference counting.

  • Python uses a heap data structure to store objects.

  • Objects are created dynamically and stored in memory.

  • Python uses a garbage collector to free up memory that is no longer being used.

  • Python also uses a technique called memory pooling to reuse memory for small objects.

  • Python supports both mutable and immutable objects, which affects how memory is allocated and managed.

Add your answer

Q49. fail fast and fail safe in java with examples

Ans.

Fail fast and fail safe are two error handling techniques in Java.

  • Fail fast approach detects errors as early as possible and stops the program execution immediately.

  • Fail safe approach handles errors gracefully and continues program execution.

  • Examples of fail fast include NullPointerException and ArrayIndexOutOfBoundsException.

  • Examples of fail safe include using try-catch blocks and logging errors instead of throwing exceptions.

Add your answer

Q50. Write a program for printing even and odd number up to 10 using two different threads. Where thread one will print only even number and thread 2 will print only odd.

Ans.

Program to print even and odd numbers up to 10 using two threads.

  • Create two threads, one for even numbers and one for odd numbers.

  • Use a loop to iterate through numbers 1 to 10.

  • In each iteration, check if the number is even or odd.

  • If the number is even, print it using the even thread.

  • If the number is odd, print it using the odd thread.

Add your answer

Q51. What Data binding in angular?

Ans.

Data binding in Angular is a way to establish a connection between the UI and the application's data.

  • Data binding allows automatic synchronization of data between the model and the view.

  • It eliminates the need for manual DOM manipulation.

  • There are different types of data binding in Angular, such as interpolation, property binding, event binding, and two-way binding.

  • Interpolation: {{ data }}

  • Property binding: [property]='data'

  • Event binding: (event)='handler()'

  • Two-way binding: [(...read more

View 1 answer

Q52. What are modules in python?

Ans.

Modules in Python are files containing Python code that can be imported and used in other Python programs.

  • Modules are used to organize and reuse code in Python.

  • They allow for better code organization and maintainability.

  • Modules can be imported using the 'import' statement.

  • Python provides a wide range of built-in modules, such as 'math' and 'random'.

  • Custom modules can also be created to encapsulate related functionality.

View 1 answer

Q53. Describe AWS tier architecture, Loadbalacer and S3.

Ans.

AWS tier architecture includes Load Balancer for distributing traffic and S3 for scalable storage.

  • AWS tier architecture consists of multiple layers such as presentation, application, and data tiers.

  • Load Balancer helps distribute incoming traffic across multiple instances to ensure optimal resource utilization and prevent overload.

  • S3 (Simple Storage Service) is a scalable storage solution offered by AWS for storing and retrieving data.

  • S3 allows for easy management of data thro...read more

Add your answer

Q54. What are python literals?

Ans.

Python literals are fixed values that are used to represent data in code.

  • Literals can be of various types such as string, integer, float, boolean, etc.

  • They are used to assign values to variables or as arguments in functions.

  • Examples of literals include 'hello world' (string), 42 (integer), 3.14 (float), True (boolean), etc.

Add your answer

Q55. what is concurrent hashmap

Ans.

ConcurrentHashMap is a thread-safe implementation of the Map interface in Java.

  • It allows multiple threads to access and modify the map concurrently without any external synchronization.

  • It achieves this by dividing the map into segments, each of which can be locked independently.

  • It provides better performance than synchronized HashMap for concurrent access.

  • It is part of the java.util.concurrent package in Java.

  • Example: ConcurrentHashMap map = new ConcurrentHashMap<>();

Add your answer

Q56. Update tuple in list of tuples ? can we update? How about tuple of lists

Ans.

Yes, we can update a tuple in a list of tuples. However, tuples are immutable, so we need to create a new tuple.

  • To update a tuple in a list of tuples, we can convert the tuple to a list, update the desired element, and then convert it back to a tuple.

  • For example, if we have a list of tuples called 'list_of_tuples' and we want to update the second tuple, we can do: list_of_tuples[1] = tuple(updated_list)

  • Similarly, we can update a tuple in a tuple of lists by converting the inn...read more

View 2 more answers

Q57. How many types of values are there in python?

Ans.

Python has five standard data types: Numbers, Strings, Lists, Tuples, and Dictionaries.

  • Numbers include integers, floating-point numbers, and complex numbers.

  • Strings are sequences of Unicode characters.

  • Lists are ordered sequences of values.

  • Tuples are ordered, immutable sequences of values.

  • Dictionaries are unordered collections of key-value pairs.

Add your answer

Q58. Tell something about init() method in python?

Ans.

init() method is a constructor method in Python that is called when an object is created.

  • It initializes the attributes of the object.

  • It takes self as the first parameter.

  • It can be used to perform any setup required before the object is used.

  • It can be overridden to customize the initialization process.

  • Example: def __init__(self, name, age): self.name = name self.age = age

Add your answer

Q59. What is global &amp; local variable in python?

Ans.

Global variables are accessible throughout the program, while local variables are only accessible within a specific function.

  • Global variables are declared outside of any function and can be accessed from any part of the program.

  • Local variables are declared within a function and can only be accessed within that function.

  • If a local variable has the same name as a global variable, the local variable takes precedence within the function.

  • Global variables can be modified from withi...read more

Add your answer

Q60. What are python generators?

Ans.

Python generators are functions that return an iterator object which can be iterated over to produce a sequence of values.

  • Generators are defined using the 'yield' keyword instead of 'return'.

  • They allow for lazy evaluation, generating values on-the-fly instead of all at once.

  • Generators can be used to generate an infinite sequence of values.

  • They are memory efficient as they do not store the entire sequence in memory.

  • Example: def my_generator(): yield 1; yield 2; yield 3;

  • Example...read more

Add your answer

Q61. Will finally block execute if try and catch have return statement?

Ans.

Yes, finally block will execute even if try and catch have return statement.

  • The finally block is always executed regardless of whether an exception is thrown or not.

  • The return statement in try or catch block will be executed before the finally block.

  • Finally block is commonly used to release resources or perform cleanup operations.

View 1 answer

Q62. What is polymorphism in object oriented programming?

Ans.

Polymorphism is the ability of an object to take on many forms.

  • Polymorphism allows objects of different classes to be treated as if they are of the same class.

  • It is achieved through method overriding and method overloading.

  • Example: A parent class Animal can have child classes like Dog, Cat, and Cow, each with their own unique implementation of the method 'makeSound'.

  • Polymorphism makes code more flexible and reusable.

Add your answer

Q63. Return a sorted array given multiple multiple sorted array

Ans.

Merge multiple sorted arrays into one sorted array

  • Merge all arrays into one array

  • Sort the merged array

  • Return the sorted array

Add your answer

Q64. What is composer how we we update drupal through composer

Ans.

Composer is a dependency manager for PHP. Drupal can be updated through composer using the command line.

  • Composer is used to manage dependencies in PHP projects

  • To update Drupal using composer, run the command 'composer update drupal/core --with-dependencies'

  • Composer.lock file should be committed to version control

Add your answer

Q65. internal working of hashmap and hashset

Ans.

Hashmap and Hashset are data structures used to store key-value pairs and unique values respectively.

  • Hashmap uses hashing to store key-value pairs in an array. The hash function is used to map the key to an index in the array.

  • Hashset is similar to Hashmap but only stores unique values. It uses hashing to store values in an array.

  • Both Hashmap and Hashset have constant time complexity for insertion, deletion, and retrieval operations.

  • Hashmap allows null values and one null key,...read more

Add your answer

Q66. What are the migration projects handle

Ans.

Migration projects involve moving data, applications, or infrastructure from one system to another.

  • Migration of data from on-premises servers to cloud storage

  • Upgrading software versions and transferring data to new systems

  • Moving applications from one platform to another, such as from Windows to Linux

  • Consolidating multiple databases into a single system

Add your answer

Q67. difference between sleep and wait

Ans.

Sleep pauses the execution of a thread for a specified time, while wait pauses the execution until a specific condition is met.

  • Sleep is a static method of the Thread class, while wait is an instance method of the Object class.

  • Sleep is used to introduce a delay in the execution of a thread, while wait is used to wait for a specific condition to be met.

  • Sleep releases the lock on the object, while wait does not release the lock.

  • Sleep can be interrupted by another thread, while w...read more

Add your answer

Q68. How to take failed test screenshots

Ans.

Failed test screenshots can be taken using automation tools and saved in a designated folder.

  • Use automation tools like Selenium or Appium to capture screenshots on test failure

  • Save the screenshots in a designated folder for easy access and reference

  • Include the screenshot file name in the test report for better traceability

Add your answer

Q69. What is static service in angular?

Ans.

Static service in Angular is used to share data between components and persists data even after the component is destroyed.

  • Static service is a singleton service that can be injected into any component.

  • It is used to share data between components.

  • Data persists even after the component is destroyed.

  • It is useful for sharing data between sibling components.

  • Example: a shopping cart service that persists the cart data across different pages.

Add your answer

Q70. Explain Automation Framework in your project

Ans.

Our automation framework is built using Selenium WebDriver and TestNG.

  • We use Page Object Model design pattern for better maintainability.

  • We have created custom libraries for common functions like login, logout, etc.

  • We use Jenkins for continuous integration and execution of automated tests.

  • We have implemented data-driven testing using Excel sheets.

  • We use Git for version control and collaboration among team members.

Add your answer

Q71. How to Handle Alerts in Selenium

Ans.

Alerts can be handled using Alert interface in Selenium

  • Use driver.switchTo().alert() method to switch to alert

  • Use getText() method to get the text of the alert

  • Use accept() method to click on OK button of the alert

  • Use dismiss() method to click on Cancel button of the alert

Add your answer

Q72. Which constructors are used in python?

Ans.

Python has two types of constructors - default and parameterized constructors.

  • Default constructor has no parameters and is automatically called when an object is created.

  • Parameterized constructor takes parameters and is used to initialize the object's attributes.

  • Example of default constructor: def __init__(self):

  • Example of parameterized constructor: def __init__(self, name, age):

Add your answer

Q73. How is memory managed in python?

Ans.

Python uses automatic memory management through garbage collection.

  • Python uses reference counting to keep track of memory usage.

  • Objects with no references are automatically deleted by the garbage collector.

  • Python also has a built-in module called 'gc' for manual garbage collection.

  • Memory leaks can occur if circular references are not handled properly.

Add your answer

Q74. Internal working of concurrent hashmap

Ans.

Concurrent hashmap allows multiple threads to access and modify the map concurrently.

  • Concurrent hashmap is thread-safe and uses internal locking mechanisms to ensure consistency.

  • It uses a technique called 'lock striping' to divide the map into multiple segments, each with its own lock.

  • This allows multiple threads to access different segments of the map concurrently without blocking each other.

  • Concurrent hashmap also uses a technique called 'resizing' to dynamically adjust the...read more

Add your answer

Q75. Sequence of Execution of TestNG Annotation

Ans.

TestNG annotations are executed in a specific sequence during test execution.

  • BeforeSuite

  • BeforeTest

  • BeforeClass

  • BeforeMethod

  • Test

  • AfterMethod

  • AfterClass

  • AfterTest

  • AfterSuite

Add your answer

Q76. What is the split &amp; join method?

Ans.

Split method splits a string into an array of substrings based on a specified separator. Join method joins the elements of an array into a string.

  • Split method returns an array of strings.

  • Join method concatenates the elements of an array into a string.

  • Both methods are used to manipulate strings in JavaScript.

  • Example: var str = 'apple,banana,orange'; var arr = str.split(','); var newStr = arr.join('-');

  • Output: arr = ['apple', 'banana', 'orange'], newStr = 'apple-banana-orange'

Add your answer

Q77. Find all occurrences and it's count into given string?

Ans.

The answer to the question is a Python function that finds all occurrences of a given substring in a string and returns the count.

  • Use the `count()` method to find the count of occurrences of a substring in a string.

  • Iterate through the string and use slicing to check for occurrences of the substring.

  • Store the occurrences and their counts in a dictionary or a list of tuples.

View 1 answer

Q78. Iterator and list iterator difference

Ans.

Iterator is a general interface while ListIterator is specific to List interface.

  • Iterator can traverse any collection while ListIterator can traverse only List.

  • ListIterator can traverse in both directions while Iterator can traverse only forward.

  • ListIterator has additional methods like add(), set(), previous(), etc.

  • Iterator is used for read-only access while ListIterator is used for both read and write access.

Add your answer

Q79. Serialization in java

Ans.

Serialization is the process of converting an object into a stream of bytes to store or transmit it.

  • Java provides Serializable interface to enable serialization of objects.

  • Serialization can be used for caching, deep cloning, and remote method invocation.

  • Deserialization is the process of converting a stream of bytes back into an object.

  • Java also provides Externalizable interface for custom serialization.

  • Serialization can be controlled using transient and static fields.

Add your answer

Q80. How to connect multiple database to Drupal

Ans.

Multiple databases can be connected to Drupal using the Database API and configuring settings.php file.

  • Use the Database API to connect to additional databases

  • Add the database connection details to settings.php file

  • Use the db_set_active() function to switch between databases

  • Use the db_query() function to execute queries on the selected database

Add your answer

Q81. Shallow copy and Deep copy in Python Difference ? how to use?

Ans.

Shallow copy and Deep copy in Python Difference and how to use?

  • Shallow copy creates a new object but references the original object's memory address

  • Deep copy creates a new object with a new memory address and copies the original object's values

  • Shallow copy can be done using slicing, copy() method, or the built-in list() function

  • Deep copy can be done using the deepcopy() method from the copy module

  • Shallow copy is faster and uses less memory, but changes to the original object ...read more

Add your answer

Q82. Software development life cycle?

Ans.

Software development life cycle is a process followed by software developers to design, develop and maintain software.

  • SDLC consists of several phases such as planning, analysis, design, implementation, testing, deployment, and maintenance.

  • Each phase has its own set of activities and deliverables.

  • SDLC models include Waterfall, Agile, and DevOps.

  • SDLC helps in ensuring that the software is developed efficiently, meets the requirements, and is of high quality.

  • SDLC also helps in r...read more

Add your answer

Q83. Rate yourself in terms of programming language

Ans.

I rate myself as proficient in programming languages with experience in Java, Python, and C++.

  • Proficient in Java, Python, and C++

  • Experience in developing applications using these languages

  • Familiarity with various frameworks and libraries

  • Ability to write efficient and optimized code

  • Experience in debugging and troubleshooting

  • Continuously learning and improving skills

Add your answer

Q84. What are OOps concepts?

Ans.

Object-oriented programming concepts that help in organizing and designing code for reusability and maintainability.

  • Encapsulation: Bundling data and methods that operate on the data into a single unit (class).

  • 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 to the user.

Add your answer

Q85. What are ACID property?

Ans.

ACID properties are a set of properties that guarantee the reliability of database transactions.

  • ACID stands for Atomicity, Consistency, Isolation, and Durability

  • Atomicity ensures that all operations in a transaction are completed successfully or none at all

  • Consistency ensures that the database remains in a consistent state before and after the transaction

  • Isolation ensures that multiple transactions can run concurrently without affecting each other

  • Durability ensures that once ...read more

Add your answer

Q86. What azure service you worked

Ans.

I have worked with Azure App Services, Azure Functions, Azure SQL Database, and Azure Blob Storage.

  • Azure App Services for hosting web applications

  • Azure Functions for serverless computing

  • Azure SQL Database for relational database management

  • Azure Blob Storage for storing unstructured data

Add your answer

Q87. What are python Modules?

Ans.

Python modules are files containing Python code that can be imported and used in other Python programs.

  • Modules are used to organize code into reusable and maintainable structures.

  • Python has a large standard library of modules that can be imported and used.

  • Third-party modules can also be installed and used in Python programs.

  • Modules can define functions, classes, and variables that can be accessed by other modules.

  • Modules can be imported using the 'import' statement in Python.

Add your answer

Q88. How to check if any job failed &amp; steps. Concept of ITIL

Ans.

To check if any job failed, we can use monitoring tools and logs. ITIL recommends incident management process.

  • Use monitoring tools like Nagios, Zabbix, etc. to check job status

  • Check logs for any error messages or exceptions

  • ITIL recommends following the incident management process to resolve the issue

  • Incident management process includes identifying, logging, categorizing, prioritizing, diagnosing, resolving, and closing the incident

Add your answer

Q89. What is Nested List with example

Ans.

A nested list is a list that contains other lists as its elements.

  • Nested lists can be created using square brackets and separating the elements with commas.

  • Elements of a nested list can be accessed using indexing and slicing.

  • Example: my_list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

  • Accessing element 5: my_list[1][1]

Add your answer

Q90. How to create custom modules and themes?

Ans.

Custom modules and themes can be created in Drupal using PHP and CSS/HTML respectively.

  • To create a custom module, define a .info.yml file, a .module file, and a .routing.yml file.

  • To create a custom theme, define a .info.yml file, a .theme file, and a .libraries.yml file.

  • Use Drupal's hook system to add functionality to your module.

  • Use Twig templates to customize the HTML/CSS of your theme.

  • Use Drupal's theming functions to add dynamic content to your theme.

  • Examples of custom mo...read more

Add your answer

Q91. Why do you prefer python?

Ans.

Python is a versatile language with a simple syntax and a vast library of modules.

  • Easy to learn and read

  • Supports multiple programming paradigms

  • Large community and extensive documentation

  • Suitable for various applications such as web development, data analysis, and machine learning

Add your answer

Q92. What is slicing in Python?

Ans.

Slicing is a way to extract a portion of a sequence (string, list, tuple) in Python.

  • Slicing is done using the colon (:) operator.

  • The syntax for slicing is [start:stop:step].

  • start is the index where the slice starts (inclusive), stop is the index where the slice ends (exclusive), and step is the size of the jump between indices.

  • If start or stop is not specified, it defaults to the beginning or end of the sequence.

  • If step is not specified, it defaults to 1.

  • Slicing can be used o...read more

Add your answer

Q93. Tell about oops concept

Ans.

Object-oriented programming paradigm focusing on objects and classes for code organization and reusability.

  • Encapsulation: Bundling data and methods that operate on the data into a single unit (class)

  • Inheritance: Ability of a class to inherit properties and behavior from another class

  • Polymorphism: Ability to present the same interface for different data types

Add your answer

Q94. What is Interface ?

Ans.

An interface in software engineering is a contract that defines the methods that a class must implement.

  • Interfaces in Java are used to achieve abstraction and multiple inheritance.

  • Interfaces contain only method signatures, not method bodies.

  • Classes can implement multiple interfaces in Java.

  • Interfaces are used to define the behavior of a class without specifying how that behavior is implemented.

Add your answer

Q95. What is queue , explain with example

Ans.

A queue is a data structure that follows the First In First Out (FIFO) principle.

  • Elements are added to the back of the queue and removed from the front.

  • Example: A line of people waiting for a movie ticket.

  • Operations: Enqueue (add element to back), Dequeue (remove element from front), Peek (view front element)

Add your answer

Q96. Can we call == to compare enums

Ans.

No, we cannot use == to compare enums.

  • Enums are objects and == compares object references, not values.

  • We should use .equals() method to compare enum values.

Add your answer

Q97. What are python iterators?

Ans.

Python iterators are objects that allow iteration over a collection of elements.

  • Iterators are used to loop through a collection of elements, one at a time.

  • They implement the __iter__() and __next__() methods.

  • The __iter__() method returns the iterator object and the __next__() method returns the next element in the sequence.

  • Iterators can be created using iter() function or by defining a class that implements the required methods.

  • Examples of built-in iterators in Python include...read more

Add your answer

Q98. How to switch default frame

Ans.

To switch default frame in automation testing, use switchTo() method of WebDriver class.

  • Use driver.switchTo().frame() method to switch to a specific frame by index, name, or WebElement.

  • Use driver.switchTo().defaultContent() method to switch back to the default content.

  • Example: driver.switchTo().frame(0); //switch to first frame

  • Example: driver.switchTo().frame("frameName"); //switch to frame with name "frameName"

Add your answer

Q99. Explain in detail about Oops Concept

Ans.

OOPs (Object-Oriented Programming) is a programming paradigm based on the concept of objects, which can contain data and code.

  • OOPs focuses on creating objects that interact with each other to solve a problem

  • Key principles include Inheritance, Encapsulation, Polymorphism, and Abstraction

  • Inheritance allows a class to inherit properties and behavior from another class

  • Encapsulation restricts access to certain components within an object

  • Polymorphism allows objects to be treated as...read more

Add your answer

Q100. What is N tier and 2 tier architecture?

Ans.

N tier and 2 tier architecture are software architecture patterns used in designing applications.

  • 2 tier architecture involves a client and a server, where the client directly communicates with the server.

  • N tier architecture involves multiple layers of servers, where each layer communicates with the layer above and below it.

  • 2 tier architecture is simpler and faster, but less scalable and secure than N tier architecture.

  • N tier architecture is more complex and slower, but more s...read more

Add your answer
1
2
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at null

based on 48 interviews in the last 1 year
Interview experience
4.1
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

4.2
 • 630 Interview Questions
4.2
 • 210 Interview Questions
4.1
 • 162 Interview Questions
4.2
 • 155 Interview Questions
3.8
 • 140 Interview Questions
3.8
 • 129 Interview Questions
View all
Top Xoriant Interview Questions And Answers
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter