Xogene
HDFC Bank Interview Questions and Answers
Q1. Python Data structures(difference between list and tuple)
Lists are mutable, ordered collections of items, while tuples are immutable, ordered collections of items.
Lists are denoted by square brackets [], while tuples are denoted by parentheses ().
Lists can be modified after creation, while tuples cannot be modified.
Lists are typically used for collections of similar items that may need to be changed, while tuples are used for fixed collections of items.
Example: list_example = [1, 2, 3], tuple_example = (4, 5, 6)
Q2. Encapsulation with real life examples
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 only exposing necessary functionalities.
It allows for better control over the data by preventing direct access from outside the class.
Example: A car object encapsulates its properties like speed, fuel level, and methods like start, stop, accelerate.
Example: A bank account object encapsulates its balance, accoun...read more
Q3. Coding round - palindrome number
Check if a number is a palindrome or not
Convert the number to a string
Reverse the string and compare with the original string
If they are the same, the number is a palindrome
Q4. Explain break, pass, continue
break, pass, and continue are control flow statements used in programming to alter the flow of execution.
break: used to exit a loop or switch statement
pass: not a keyword in most programming languages, but can be used as a placeholder for future code
continue: used to skip the rest of the current iteration in a loop and start the next iteration
Q5. Remove duplicates from array
Remove duplicates from array of strings
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
Q6. List and its methods/functions
List is a data structure in Python that stores a collection of items in a specific order.
Common methods/functions for lists in Python include append(), remove(), sort(), and index().
Lists can contain different data types, such as strings, integers, and even other lists.
Lists are mutable, meaning you can change the elements within a list after it has been created.
Interview Process at HDFC Bank
Top Junior Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month