TCS
200+ HDFC Bank Interview Questions and Answers
Q1. Palindromic Numbers Finder
Given an integer 'N', your task is to identify all palindromic numbers from 1 to 'N'. These are numbers that read the same way forwards and backwards.
Input:
The first line provides a...read more
Implement a function to find all palindromic numbers from 1 to N.
Iterate from 1 to N and check if each number is a palindrome
Use string manipulation to check for palindromes
Consider edge cases like single-digit numbers and 11
Q2. Strings of Numbers Problem Statement
You are given two integers 'N' and 'K'. Consider a set 'X' of all possible strings of 'N' number of digits where all strings only contain digits ranging from 0 to 'K' inclus...read more
The task is to find a string of minimal length that includes every possible string of N digits with digits ranging from 0 to K as substrings.
Generate all possible strings of N digits with digits from 0 to K
Concatenate these strings in a way that all are substrings of the final string
Return 1 if the final string contains all possible strings, else return 0
Q3. Maximum Vehicle Registrations Problem
Bob, the mayor of a state, seeks to determine the maximum number of vehicles that can be uniquely registered. Each vehicle's registration number is structured as follows: S...read more
Calculate the maximum number of unique vehicle registrations based on given constraints.
Parse input for number of test cases, district count, letter ranges, and digit ranges.
Calculate the total number of unique registrations based on the given constraints.
Output the maximum number of unique vehicle registrations for each test case.
Q4. Every day, we come across different types of computer software that helps us with our tasks and increase our efficiency. From MS Windows that greets us when we switch on the system to the web browser that is us...
read moreSoftware is a collection of data, programs, procedures, instructions, and documentation that perform tasks on a computer system.
Software is essential for computers to be useful.
It includes programs, libraries, and non-executable data.
Software and hardware work together to enable modern computing systems.
Examples of software include operating systems, web browsers, and games.
Q5. Diagonal Sum of Binary Tree
You are given a binary tree with 'N' nodes. Your task is to find and return a list containing the sums of all the diagonals of the binary tree, computed from right to left.
Input:
Th...read more
Find and return the sums of all diagonals of a binary tree from right to left.
Traverse the binary tree level by level and keep track of the diagonal sums using a hashmap.
Use a queue to perform level order traversal of the binary tree.
For each node, update the diagonal sum based on its level and position in the diagonal.
Return the diagonal sums in reverse order from rightmost to leftmost diagonal.
Longest Switching Subarray Problem Statement
You are provided with an array 'ARR' consisting of 'N' positive integers. Your task is to determine the length of the longest contiguous subarray that is switching.
Find the length of the longest contiguous subarray where elements at even indices are equal and elements at odd indices are equal.
Iterate through the array and keep track of the length of the current switching subarray.
Update the length when the switching condition is broken.
Return the maximum length found for each test case.
Q7. Jar of Candies Problem Statement
You are given a jar containing candies with a maximum capacity of 'N'. The jar cannot have less than 1 candy at any point. Given 'K', the number of candies a customer wants, det...read more
Given a jar of candies with a maximum capacity, determine the number of candies left after providing the desired count to a customer.
Check if the number of candies requested is valid (less than or equal to the total number of candies in the jar)
Subtract the number of candies requested from the total number of candies in the jar to get the remaining candies
Return the remaining candies or -1 if the request is invalid
Q8. Shuffle Two Strings
You are provided with three strings: A
, B
, and C
. Your task is to determine if C
is formed by interleaving A
and B
. A string C
is considered an interleaving of A
and B
if:
- The length of
C
i...read more
Determine if a string C is formed by interleaving two strings A and B.
Check if the length of C is equal to the sum of lengths of A and B.
Ensure all characters of A and B are present in C.
Verify that the order of characters in C matches the order in A and B.
Q9. Find All Pairs Adding Up to Target
Given an array of integers ARR
of length N
and an integer Target
, your task is to return all pairs of elements such that they add up to the Target
.
Input:
The first line conta...read more
Given an array of integers and a target, find all pairs of elements that add up to the target.
Iterate through the array and for each element, check if the target minus the element exists in a hash set.
If it exists, add the pair to the result. If not, add the element to the hash set.
Handle cases where the same element is used twice in a pair.
Return (-1, -1) if no pair is found.
Q10. Sum of Even & Odd Digits
You need to determine the sum of even digits and odd digits separately from a given integer.
Input:
The first line of input is an integer T
representing the number of test cases. Each t...read more
Implement a function to find the sum of even and odd digits separately in a given integer.
Iterate through each digit of the integer and check if it is even or odd.
Keep track of the sum of even and odd digits separately.
Return the sums of even and odd digits for each test case.
Q11. Add Two Numbers Represented as Linked Lists
Given two linked lists representing two non-negative integers, where the digits are stored in reverse order (i.e., starting from the least significant digit to the mo...read more
Add two numbers represented as linked lists in reverse order and return the sum as a linked list.
Traverse both linked lists simultaneously, adding corresponding digits and carrying over if necessary.
Handle cases where one list is longer than the other by considering carry over.
Create a new linked list to store the sum digits in reverse order.
Return the head of the new linked list as the result.
Q12. Make Palindrome Problem Statement
You are provided with a string STR
of length N
comprising lowercase English alphabet letters. Your task is to determine and return the minimum number of characters that need to...read more
The task is to find the minimum number of characters needed to make a given string a palindrome.
Iterate from both ends of the string and compare characters to find the number of characters needed to make it a palindrome.
Use dynamic programming to optimize the solution by storing previously calculated results.
Handle edge cases like an already palindrome string or an empty string.
Consider using recursion or iteration to solve the problem efficiently.
Ensure to handle the case wh...read more
Q13. Factorial Calculation Problem
Given an integer N
, determine the factorial value of N
. The factorial of a number N
is the product of all positive integers from 1 to N
.
Input:
First line of input: An integer 'T',...read more
Calculate the factorial of a given integer N.
Iterate from 1 to N and multiply each number to get the factorial value.
Handle edge cases like N=0 or N=1 separately.
Use recursion or iteration to calculate the factorial value.
Q14. Distance Greater Than K Problem Statement
You are provided an undirected graph, a source vertex, and an integer k
. Determine if there is any simple path (without any cycle) from the source vertex to any other v...read more
Check if there is a path from source vertex to any other vertex with distance greater than k in an undirected graph.
Use Depth First Search (DFS) to traverse the graph and keep track of the distance from the source vertex.
If at any point the distance exceeds k, return true.
If DFS traversal completes without finding a path with distance greater than k, return false.
Q15. Middle of a Linked List
You are given the head node of a singly linked list. Your task is to return a pointer pointing to the middle of the linked list.
If there is an odd number of elements, return the middle ...read more
Return the middle element of a singly linked list, or the one farther from the head node in case of even number of elements.
Traverse the linked list using two pointers, one moving at twice the speed of the other.
When the faster pointer reaches the end, the slower pointer will be at the middle.
Return the element pointed to by the slower pointer.
Q16. Delete Alternate Nodes from a Singly Linked List
Given a Singly Linked List of integers, remove all the alternate nodes from the list.
Input:
The first and the only line of input will contain the elements of th...read more
Remove alternate nodes from a singly linked list of integers.
Traverse the linked list and skip every alternate node while connecting the previous node to the next node.
Update the next pointers accordingly to remove the alternate nodes.
Ensure to handle edge cases like empty list or list with only one node.
Q17. Reverse the String Problem Statement
You are given a string STR
which contains alphabets, numbers, and special characters. Your task is to reverse the string.
Example:
Input:
STR = "abcde"
Output:
"edcba"
Input...read more
Reverse a given string containing alphabets, numbers, and special characters.
Iterate through the string from the end to the beginning and append each character to a new string.
Use built-in functions like reverse() or StringBuilder in languages like Python or Java for efficient reversal.
Handle edge cases like empty string or strings with only one character.
Ensure to consider the constraints provided in the problem statement while implementing the solution.
Q18. Smallest Number with Given Digit Product
Given a positive integer 'N', find and return the smallest number 'M', such that the product of all the digits in 'M' is equal to 'N'. If such an 'M' is not possible or ...read more
Find the smallest number with given digit product equal to a positive integer N.
Iterate from 2 to 9 and find the smallest digit that divides N, then add it to the result.
Repeat the process until N is reduced to 1 or a prime number.
If N cannot be reduced to 1 or a prime number, return 0.
Q19. What will happen if you replace class with struct What is vector Can I add particular element in vector Use insert function Tell me about all the commands you know Tell me all the command in Linux you know Case...
read moreInterview questions for a software developer on topics like class vs struct, vectors, Linux commands, inheritance, and pointer safety.
Replacing class with struct changes the default access level to public
Vector is a dynamic array that can be resized at runtime
Elements can be added to vector using push_back() or insert() function
Inheritance allows a derived class to inherit properties and methods from a base class
To call base class function with derived class object, use scope...read more
Q20. What is list,tuple? What is shallow copy? Name some libraries in python. What is python current version and how do you find on Command prompt? OOPS in python. Abstraction vs Encapsulation
Questions related to Python programming language and concepts.
List and tuple are data structures in Python. List is mutable while tuple is immutable.
Shallow copy creates a new object but references the original object's elements.
Some libraries in Python are NumPy, Pandas, Matplotlib, and Scikit-learn.
Python's current version is 3.9. You can find it on Command prompt by typing 'python --version'.
OOPS in Python stands for Object-Oriented Programming. It allows for creating clas...read more
Q21. Prime Time Again Problem Statement
You are given two integers DAY_HOURS
and PARTS
. Consider a day with DAY_HOURS
hours, which can be divided into PARTS
equal parts. Your task is to determine the total instances...read more
Given DAY_HOURS and PARTS, find total instances of equivalent prime groups in a day divided into equal parts.
Divide the day into equal parts and check for prime groups at the same position in different parts.
Each prime group consists of prime numbers occurring at the same position in different parts.
Return the total number of equivalent prime groups found.
Ensure DAY_HOURS is divisible by PARTS and each hour in a prime group is in a different part.
Q22. Find Duplicates in an Array
Given an array ARR
of size 'N', where each integer is in the range from 0 to N - 1, identify all elements that appear more than once.
Return the duplicate elements in any order. If n...read more
Find duplicates in an array of integers within a specified range.
Iterate through the array and keep track of the count of each element using a hashmap.
Return elements with count greater than 1 as duplicates.
Time complexity can be optimized to O(N) using a set to store duplicates.
Example: For input [0, 3, 1, 2, 3], output should be [3].
Q23. Reverse Array Elements
Given an array containing 'N' elements, the task is to reverse the order of all array elements and display the reversed array.
Explanation:
The elements of the given array need to be rear...read more
Reverse the order of elements in an array and display the reversed array.
Iterate through the array from both ends and swap the elements until the middle is reached.
Use a temporary variable to store the element being swapped.
Print the reversed array after all elements have been swapped.
Q24. Cycle Detection in a Singly Linked List
Determine if a given singly linked list of integers forms a cycle or not.
A cycle in a linked list occurs when a node's next
points back to a previous node in the list. T...read more
Detect if a singly linked list forms a cycle by checking if a node's next points back to a previous node.
Use Floyd's Cycle Detection Algorithm to determine if there is a cycle in the linked list.
Maintain two pointers, one moving at twice the speed of the other, if they meet at some point, there is a cycle.
If one of the pointers reaches the end of the list (null), there is no cycle.
Q25. Does Java support multiple Inheritance? If not then how an interface inherits two interfaces? Explain
Java does not support multiple inheritance, but interfaces can inherit multiple interfaces.
Java does not allow a class to inherit from multiple classes, but it can implement multiple interfaces.
Interfaces can inherit from multiple interfaces using the 'extends' keyword.
For example, interface C can extend interfaces A and B: 'interface C extends A, B {}'
Q26. Valid Parentheses Problem Statement
Given a string 'STR' consisting solely of the characters “{”, “}”, “(”, “)”, “[” and “]”, determine if the parentheses are balanced.
Input:
The first line contains an integer...read more
Check if given strings containing parentheses are balanced or not.
Use a stack to keep track of opening parentheses
Iterate through the string and push opening parentheses onto the stack
When a closing parenthesis is encountered, pop from the stack and check if it matches the corresponding opening parenthesis
If stack is empty at the end and all parentheses are matched, the string is balanced
Q27. Number Pattern Problem Statement
Create a number pattern as specified by Ninja. The pattern should be constructed based on a given integer value 'N'.
Example:
Input:
N = 4
Output:
4444 3444 2344 1234
Explanatio...read more
Generate a number pattern based on a given integer value 'N' by incrementing digits from right to left in each line.
Start from the rightmost side and increment digits while moving towards the left in each line
Print 'N' lines for each test case
Handle multiple test cases by reading the number of test cases 'T' first
Q28. 1. what is static variables 2. what is a array 3. what is collections 4. Difference between c++ and java 5. what is java Architecture 6. what is java 7. what is Oops
Static variables are variables that are shared among all instances of a class. Arrays are a data structure that stores a collection of elements. Collections are classes in Java that store and manipulate groups of objects. C++ and Java differ in syntax, memory management, and platform independence. Java architecture consists of JVM, JRE, and JDK. Java is a high-level programming language known for its platform independence. Object-oriented programming (OOP) is a programming pa...read more
Q29. Do you have any experience in programming ? If yes , explain?
Yes, I have experience in programming.
I have a Bachelor's degree in Computer Science.
I have worked as a software developer for 3 years.
I am proficient in programming languages like Java, C++, and Python.
I have developed web applications using frameworks like React and Angular.
I have experience in database management with SQL and NoSQL databases.
I have worked on projects involving data analysis and machine learning algorithms.
Q30. Explain oops concepts with an example
Explanation of OOPs concepts with an example
OOPs stands for Object-Oriented Programming
Encapsulation - Binding data and functions that manipulate the data together
Inheritance - A class can inherit properties and methods from another class
Polymorphism - Ability of an object to take many forms
Abstraction - Hiding implementation details and showing only functionality
Example: A car is an object that has properties like color, model, and methods like start, stop, accelerate
Encapsu...read more
TATA group has made significant contributions to the nation through various industries and philanthropic initiatives.
TATA Steel is one of the largest steel producers in India, contributing to infrastructure development.
TATA Motors is a leading automobile manufacturer, driving innovation in the automotive sector.
TATA Consultancy Services (TCS) is a global IT services company, creating job opportunities and boosting the economy.
TATA Trusts have undertaken numerous social welfar...read more
Cut the cake horizontally into two equal halves, then cut one of the halves vertically in the middle.
First, cut the cake horizontally into two equal halves.
Next, cut one of the halves vertically in the middle.
You will now have three equal pieces of cake.
Example: Cut the cake horizontally into two halves, then cut one half vertically in the middle.
An operating system is a software that manages computer hardware and provides services for computer programs.
An operating system is the most important software that runs on a computer.
It manages the computer hardware and provides common services for computer programs.
Examples of operating systems include Windows, macOS, Linux, and Unix.
A process table is a data structure used by the operating system to manage information about all running processes.
It typically includes detai...read more
SQL query to output data of students whose names start with 'A'.
Use SELECT statement to retrieve data from the table.
Use WHERE clause with LIKE operator to filter names starting with 'A'.
Example: SELECT * FROM students WHERE name LIKE 'A%';
The COVID-19 pandemic has significantly impacted the IT industry, leading to remote work, increased demand for digital solutions, and delays in projects.
Transition to remote work for many IT companies
Increased demand for digital solutions such as online collaboration tools, e-commerce platforms, and telehealth services
Delays in projects due to disruptions in supply chains and workforce availability
Shift towards cloud computing and cybersecurity solutions to support remote wor...read more
Q36. how is multithreading implemented in JAVA
Multithreading in Java allows concurrent execution of multiple threads.
Java provides built-in support for multithreading through the java.lang.Thread class.
Threads can be created by extending the Thread class or implementing the Runnable interface.
The start() method is used to start a new thread, which calls the run() method.
Synchronization mechanisms like synchronized blocks and locks can be used to control access to shared resources.
Java also provides high-level concurrency...read more
Q37. What id difference between procedure and function
A procedure is a set of instructions that performs a specific task, while a function is a procedure that returns a value.
Procedures are used to perform actions, while functions are used to calculate and return values.
Procedures do not have a return statement, while functions always have a return statement.
Functions can be called within expressions, while procedures cannot.
Procedures can have input parameters, while functions can have both input parameters and a return value.
Q38. Can you explain the concept of object oriented programming?
Object oriented programming is a programming paradigm based on the concept of objects, which can contain data in the form of fields and code in the form of procedures.
Objects are instances of classes, which define the structure and behavior of the objects.
Encapsulation is the concept of bundling data and methods that operate on the data within a single unit, such as a class.
Inheritance allows classes to inherit attributes and methods from other classes.
Polymorphism allows obj...read more
Q39. how wil you dispaly data of two tables? explain?
Display data of two tables by joining them using a common column.
Use SQL JOIN statement to combine data from two tables based on a common column.
Choose the appropriate type of JOIN based on the relationship between the tables.
Specify the columns to be displayed in the SELECT statement.
Use aliases to differentiate between columns with the same name in both tables.
Apply any necessary filters or sorting to the result set.
Q40. What are the important categories of software?
There are two important categories of software: System software and Application software.
System software: manages and controls computer hardware so that application software can perform its tasks. Examples: Operating systems, device drivers, firmware.
Application software: performs specific tasks for the user. Examples: Word processors, web browsers, games.
Q41. How will you display data of two tables?
Join the tables on a common column and display the combined data.
Identify the common column in both tables
Use JOIN statement to combine the tables
Select the columns to display
Apply any necessary filters or sorting
Display the data in a table or list format
Q42. how multithreading is carried in java
Java supports multithreading through the java.lang.Thread class and java.util.concurrent package.
Java threads are created by extending the Thread class or implementing the Runnable interface.
Threads can be started using the start() method.
Synchronization can be achieved using synchronized keyword or locks.
Java provides several classes and interfaces to support concurrent programming such as Executor, ExecutorService, Future, etc.
Thread pools can be created using ExecutorServi...read more
Q43. How will you display data of two tables? Explain
To display data of two tables, we can use JOIN operation in SQL.
Identify the common column(s) between the two tables.
Use JOIN operation to combine the data from both tables based on the common column(s).
Choose the appropriate type of JOIN operation (INNER, LEFT, RIGHT, FULL) based on the requirement.
Use SELECT statement to display the required columns from the combined table.
Example: SELECT t1.column1, t2.column2 FROM table1 t1 JOIN table2 t2 ON t1.common_column = t2.common_c...read more
Q44. what is multithreading
Multithreading is the ability of a program to perform multiple tasks concurrently.
Multithreading allows for better utilization of CPU resources
It can improve program performance and responsiveness
Examples include running multiple downloads simultaneously or updating a GUI while performing a background task
Synchronization is important to prevent race conditions and ensure thread safety
Q45. Explain. Difference between primary key and unique key
Primary key uniquely identifies a record in a table, while unique key ensures uniqueness of a column.
Primary key cannot have null values, while unique key can have one null value.
A table can have only one primary key, but multiple unique keys.
Primary key is used as a foreign key in other tables, while unique key is not.
Example: Employee ID can be a primary key, while email address can be a unique key.
Q46. What is trigger explain with syntax
A trigger is a special type of stored procedure that automatically executes in response to certain events.
Triggers are used to enforce business rules or to perform complex calculations.
Syntax: CREATE TRIGGER trigger_name {BEFORE | AFTER} {INSERT | UPDATE | DELETE} ON table_name FOR EACH ROW {trigger_body}
Example: CREATE TRIGGER audit_log AFTER INSERT ON employees FOR EACH ROW INSERT INTO audit VALUES (NEW.id, 'inserted', NOW())
Q47. What is difference between primary key and unique key
Primary key uniquely identifies a record in a table, while unique key ensures uniqueness of a column.
Primary key cannot have null values, while unique key can have null values.
A table can have only one primary key, but multiple unique keys.
Primary key is automatically indexed, while unique key may or may not be indexed.
Example: Employee ID can be a primary key, while email address can be a unique key.
Q48. What is your favourite programming language?
My favorite programming language is Python because of its simplicity, readability, and versatility.
Python is known for its clean and readable syntax, making it easy to learn and understand.
Python has a large standard library with built-in modules for various tasks, reducing the need for external libraries.
Python is versatile and can be used for web development, data analysis, artificial intelligence, and more.
Q49. if the sides of a rectangle are increased by 20% ,by what percentage does the area increase?
Increasing the sides of a rectangle by 20% increases its area by 44%.
Calculate the new dimensions of the rectangle after increasing the sides by 20%.
Use the formula for the area of a rectangle to calculate the new area.
Compare the new area to the original area to determine the percentage increase.
Q50. Difference between Do – While and While loop.
Do-While loop executes the code block once before checking the condition, while loop checks the condition first.
Do-While loop is used when the code block needs to be executed at least once.
While loop is used when the code block may not need to be executed at all.
Do-While loop is less efficient than While loop as it always executes the code block at least once.
Example of Do-While loop: do { //code block } while (condition);
Example of While loop: while (condition) { //code bloc...read more
Q51. what is oops concept waht is multithreading define the term abstraction
OOPs is a programming paradigm based on the concept of objects, while multithreading is the ability of a CPU to execute multiple threads concurrently, and abstraction is the process of hiding implementation details while showing only the necessary information.
OOPs is based on the concept of objects, which encapsulate data and behavior
Multithreading allows for concurrent execution of multiple threads, improving performance
Abstraction is the process of hiding implementation det...read more
Q52. what are different types of tag in html and tags which do not require closing tag
Different types of HTML tags include block-level tags, inline tags, empty tags, and self-closing tags.
Block-level tags: <div>, <p>, <h1>
Inline tags: <span>, <a>, <strong>
Empty tags: <img>, <br>, <input>
Self-closing tags: <img />, <br />
SQL questions related to joins
Types of joins in SQL (inner join, left join, right join, full outer join)
Difference between inner join and outer join
Common join conditions (using ON vs WHERE)
Handling NULL values in joins
Performance considerations when using joins
Q54. what is the difference between method and block.
Method is a named block of code that can be called multiple times, while a block is a group of statements enclosed in curly braces.
A method has a name and can accept parameters, while a block does not.
A method can return a value, while a block cannot.
A method can be called from anywhere in the program, while a block is only accessible within the scope it was defined.
Example of a method: public int add(int a, int b) { return a + b; }
Example of a block: if (condition) { int x =...read more
Q55. What is polymorphism
Polymorphism is the ability of an object to take on many forms.
It allows objects of different classes to be treated as if they were objects of the same class.
It is achieved through method overriding and method overloading.
Example: A shape class can have different subclasses like circle, square, triangle, etc. and all of them can be treated as shapes.
Example: A method can have different implementations in different classes but can be called using the same name.
Example: The + o...read more
Q56. What are state management
State management is the process of managing the state of an application or system.
It involves storing and updating data that represents the current state of the application.
State can be managed locally or globally, depending on the architecture of the application.
Common techniques for state management include using local state, global state, and state containers like Redux.
Examples of state management in action include updating the UI based on user input, managing user authen...read more
Q57. Difference between interface and abastract, required and include, method overriding and method over loading
Interface vs abstract, required vs include, method overriding vs overloading
Interface is a contract that defines methods that must be implemented by a class, while abstract class can have implemented methods
Required is used to specify mandatory dependencies in a module, while include is used to import code from another file
Method overriding is when a subclass provides its own implementation of a method from its superclass, while overloading is when a class has multiple method...read more
Q58. how does view get to know that binded property has been changed in viewmodel
The view gets to know that a binded property has been changed in the viewmodel through data binding mechanisms.
Data binding mechanisms like two-way binding or event listeners are used to notify the view of property changes in the viewmodel.
Frameworks like Angular, React, or Vue.js provide built-in mechanisms for handling property changes in the viewmodel.
ViewModels often implement observable patterns or use libraries like RxJS to notify the view of property changes.
Q59. What are the problems you face while developing software
Software development problems
Bugs and errors
Compatibility issues
Lack of documentation
Poor performance
Security vulnerabilities
Q60. Explain about javascript selector
JavaScript selectors are used to select and manipulate HTML elements.
Selectors can be used with methods like getElementById(), getElementsByClassName(), and querySelector().
Selectors can target specific elements based on their tag name, class, ID, attributes, and more.
Selectors can also be combined to create more complex queries.
Examples: document.getElementById('myElement'), document.querySelector('.myClass')
Q61. What are constraints
Constraints are limitations or restrictions that are put in place to ensure certain requirements are met.
Constraints can be physical, such as the size of a database or the amount of memory available
Constraints can also be logical, such as business rules or security requirements
Constraints can help ensure data integrity and prevent errors or security breaches
Examples of constraints include primary keys, foreign keys, check constraints, and unique constraints
Q62. What is view state
View state is a feature in ASP.NET that preserves the state of server-side controls between postbacks.
View state is used to maintain the state of server-side controls between postbacks.
It is a hidden field on the page that stores the values of the controls.
View state can be disabled to improve performance, but it may cause issues with control state.
Example: A text box retains its value even after a postback due to view state.
Q63. how it is implemented in java
The question is asking about how a specific implementation is done in Java.
Explain the implementation details of the specific feature or functionality in Java
Provide code examples if applicable
Discuss any relevant libraries or frameworks used in the implementation
Q64. Python program to find the count of a letter in a sentence
Python program to find the count of a letter in a sentence
Use the count() method on the string to find the number of occurrences of a specific letter
Convert the sentence to lowercase to make the search case-insensitive
Handle both uppercase and lowercase versions of the letter to get an accurate count
Q65. Write a Java code cheke the given String is palindrome or not ?
Java code to check if a given String is a palindrome or not.
Create a function that takes a String as input
Use two pointers, one starting from the beginning and one from the end, to compare characters
If all characters match, return true; otherwise, return false
Q66. diff betn while & do while loop
While loop executes only if the condition is true, do-while loop executes at least once before checking the condition.
While loop checks the condition first, then executes the code block
Do-while loop executes the code block first, then checks the condition
While loop may not execute at all if the condition is false initially
Do-while loop always executes at least once before checking the condition
Q67. what is react? explain about react lifecycle
React is a JavaScript library for building user interfaces.
React is a declarative, efficient, and flexible library for building user interfaces.
It allows developers to create reusable UI components.
React follows a component-based architecture where UI is broken down into smaller components.
React lifecycle consists of three main phases: Mounting, Updating, and Unmounting.
During Mounting, a component is created and inserted into the DOM.
During Updating, a component re-renders w...read more
Q68. What are static variables and how they are accessed
Static variables are variables that retain their values throughout the program's execution and are accessed using the class name.
Static variables are declared using the 'static' keyword.
They are shared among all instances of a class.
Static variables are accessed using the class name followed by the dot operator.
Example: ClassName.staticVariableName;
Q69. what is data encapsulation
Data encapsulation is the concept of bundling data and methods that operate on that data within a single unit.
Data 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 external interference.
Encapsulation also promotes code reusability and modularity.
Example: In object-oriented programming, a class encapsulates data (attributes) and methods (functions) that operate on that data.
Q70. sql query for highest salary from list of employees table
Use SQL query with MAX function to find highest salary from employees table.
Use SELECT MAX(salary) FROM employees;
Make sure to replace 'employees' with the actual table name if different.
Ensure the column name for salary is correct in the query.
Q71. How is security implemented in your application?
Security is implemented in our application through encryption, authentication, and authorization mechanisms.
We use encryption algorithms to secure sensitive data both at rest and in transit.
Authentication is implemented through secure login mechanisms like OAuth or JWT.
Authorization controls access to different parts of the application based on user roles and permissions.
Q72. what is variable and types of variable.
A variable is a container that holds a value. There are different types of variables in programming.
Variables are used to store data in a program
They can be assigned different values during runtime
Types of variables include integers, floats, strings, booleans, and more
Variables can be declared with a specific data type or left untyped
Examples: int age = 25, float price = 9.99, string name = 'John Doe'
Q73. what is multithreaing
Multithreading is the ability of a CPU to execute multiple threads concurrently.
Multithreading improves performance by utilizing idle CPU time.
Threads share the same memory space, allowing for efficient communication.
Examples include web servers handling multiple requests and video games rendering graphics while processing user input.
Q74. What are the types f design pattern?
Design patterns are reusable solutions to common problems in software design.
Creational patterns - Singleton, Factory, Builder
Structural patterns - Adapter, Decorator, Facade
Behavioral patterns - Observer, Strategy, Template Method
Q75. Different between confidential and over confidential
Confidential refers to information that is meant to be kept private, while over confidential implies an excessive level of secrecy.
Confidential information is sensitive and should only be shared with authorized individuals.
Over confidential suggests an unnecessary or excessive level of secrecy beyond what is required.
Examples of confidential information include trade secrets, personal data, and classified documents.
An example of over confidential behavior could be refusing to...read more
Q76. What you know about cloud computing?
Cloud computing is the delivery of computing services over the internet, including servers, storage, databases, networking, software, analytics, and intelligence.
Cloud computing allows users to access resources on-demand without the need for physical infrastructure.
It offers scalability, flexibility, and cost-efficiency compared to traditional on-premises solutions.
Examples of cloud computing providers include Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platf...read more
Q77. What is the latest version of android
The latest version of Android is Android 12.
Android 12 was released on October 4, 2021.
It includes new features such as Material You design, privacy enhancements, and improved performance.
It is currently available for select devices and will roll out to more in the coming months.
Q78. Define different types of Inheritances in Python
Python supports single, multiple, multilevel, hierarchical, and hybrid inheritance.
Single Inheritance: A class can inherit from only one base class.
Multiple Inheritance: A class can inherit from multiple base classes.
Multilevel Inheritance: A class can inherit from a derived class, creating a chain of inheritance.
Hierarchical Inheritance: Multiple derived classes inherit from a single base class.
Hybrid Inheritance: Combination of multiple and multilevel inheritance.
Q79. What is the use of circular linked list
Circular linked list is a linked list where the last node points back to the first node, forming a circle.
Allows for efficient traversal from the end of the list to the beginning
Useful for applications where data needs to be accessed in a circular manner, such as round-robin scheduling
Can be used to implement a circular buffer in data structures
Q80. Multithreading and servlets in Java
Multithreading and servlets are important concepts in Java for concurrent programming and web development.
Multithreading allows multiple threads to run concurrently, improving performance and responsiveness of applications.
Servlets are Java classes that handle HTTP requests and generate responses, used for web development.
Multithreading can be used in servlets to handle multiple requests simultaneously.
However, care must be taken to ensure thread safety and avoid race conditi...read more
Q81. What is the use of Init method in python
The init method in Python is used as a constructor to initialize the object's attributes when an instance of a class is created.
Init method is called automatically when a new object is created from a class.
It is used to initialize the object's attributes or perform any setup required for the object.
The init method is defined with the __init__ function in Python.
Q82. How lists are different from Sets
Lists allow duplicate elements and maintain insertion order, while sets do not allow duplicates and do not maintain order.
Lists allow duplicate elements, while sets do not
Lists maintain insertion order, while sets do not
Lists are implemented using classes like ArrayList or LinkedList, while sets are implemented using classes like HashSet or TreeSet
Q83. diff betn primary & unique key
Primary key uniquely identifies a record in a table, while unique key ensures uniqueness of a column.
Primary key is a column or set of columns that uniquely identifies each record in a table
Primary key cannot have null values
A table can have only one primary key
Unique key ensures that a column or set of columns have unique values
Unique key can have null values
A table can have multiple unique keys
Q84. What is different between java and C++
Java is platform-independent, object-oriented, and has automatic memory management, while C++ is platform-dependent, supports multiple inheritance, and requires manual memory management.
Java is platform-independent, while C++ is platform-dependent
Java is object-oriented, while C++ supports both procedural and object-oriented programming
Java has automatic memory management (garbage collection), while C++ requires manual memory management
Java does not support multiple inheritan...read more
Q85. What is oops and pillars of oops?
OOPs stands for Object-Oriented Programming. Pillars of OOPs are Inheritance, Encapsulation, Abstraction, and Polymorphism.
OOPs is a programming paradigm based on the concept of objects, which can contain data in the form of fields and code in the form of procedures.
Pillars of OOPs include Inheritance (ability of a class to inherit properties and behavior from another class), Encapsulation (binding data and methods that manipulate the data into a single unit), Abstraction (hi...read more
Q86. From Java what is friend function
Friend function is not a concept in Java.
Friend function is a concept in C++ where a non-member function can access private and protected members of a class.
Java does not have the concept of friend function.
In Java, access to private and protected members of a class is restricted to the class itself and its subclasses.
Q87. Internal working of HashMap and it's implementation in Detais
HashMap is a data structure that stores key-value pairs and uses hashing to efficiently retrieve values.
HashMap internally uses an array of linked lists to store key-value pairs.
When a key-value pair is added, the key is hashed to find the index in the array where the pair will be stored.
If multiple keys hash to the same index, a linked list is used to handle collisions.
HashMap allows null keys and values, and can have one null key and multiple null values.
Example: HashMap
ma...read more
Q88. What are the 4 basic principles of OOPS?
The 4 basic principles of OOPS are Abstraction, Encapsulation, Inheritance, and Polymorphism.
Abstraction: Hiding complex implementation details and showing only necessary information.
Encapsulation: Binding data and functions together and restricting access to them.
Inheritance: Creating new classes from existing ones, inheriting properties and methods.
Polymorphism: Ability of objects to take on multiple forms or behaviors.
Q89. What is c ,c++ and debugging
C and C++ are programming languages used for system and application development. Debugging is the process of finding and fixing errors in code.
C is a procedural language used for system programming and embedded systems.
C++ is an object-oriented language used for application development and game programming.
Debugging involves using tools like breakpoints, print statements, and debuggers to identify and fix errors in code.
Common debugging techniques include step-by-step executi...read more
Q90. what are types of variables in python?
Types of variables in Python include integers, floats, strings, lists, tuples, dictionaries, and booleans.
Integers: whole numbers without decimal points (e.g. 5, -3)
Floats: numbers with decimal points (e.g. 3.14, -0.5)
Strings: sequences of characters enclosed in quotes (e.g. 'hello', '123')
Lists: ordered collections of items enclosed in square brackets (e.g. [1, 'apple', True])
Tuples: ordered collections of items enclosed in parentheses (e.g. (1, 'banana', False))
Dictionaries...read more
Q91. Why do we need oops concepts? Oops concepts
OOPs concepts are essential in software development as they provide a structured approach to designing and organizing code.
Encapsulation: Helps in bundling data and methods together, providing data security and code reusability.
Inheritance: Allows code reuse and promotes code organization by creating a hierarchy of classes.
Polymorphism: Enables objects to take on multiple forms, allowing flexibility and extensibility in code.
Abstraction: Simplifies complex systems by breaking...read more
Q92. what is inheritance
Inheritance is a concept in object-oriented programming where a class inherits properties and behaviors from another class.
Allows a class to inherit attributes and methods from another class
Promotes code reusability and reduces redundancy
Creates a parent-child relationship between classes
Derived class can override or extend the functionality of the base class
Q93. how to update records in before insert?
Use a before insert trigger to update records before they are inserted into the database.
Create a before insert trigger on the object you want to update records for.
Write the logic in the trigger to update the records as needed.
Make sure to test the trigger thoroughly before deploying it to production.
Q94. Multithreading and how to use it
Multithreading allows multiple threads to run concurrently, improving performance and responsiveness.
Multithreading is used to execute multiple tasks simultaneously within a single process.
It can improve performance by utilizing multiple CPU cores efficiently.
Common multithreading libraries include Java's Thread class and C#'s Task Parallel Library.
Example: In a web server, multithreading can handle multiple client requests concurrently.
Example: In a video game, multithreadin...read more
Q95. Sql Join IIS server Project on which you worked
SQL Join is used to combine rows from two or more tables based on a related column between them.
INNER JOIN returns only the matching rows between tables
LEFT JOIN returns all rows from the left table and matching rows from the right table
RIGHT JOIN returns all rows from the right table and matching rows from the left table
FULL OUTER JOIN returns all rows from both tables
IIS server is a web server used to host web applications
Project details depend on individual experience
Q96. How do you implemented singleton class
Singleton class ensures only one instance of a class is created and provides a global point of access to it.
Use a private constructor to prevent instantiation of the class from outside.
Create a static method to return the instance of the class, creating it if it doesn't exist.
Maintain a private static variable to hold the instance of the class.
Q97. What is the advantage of helper file
Helper files provide reusable functions and code snippets to simplify development tasks.
Organizes code into separate files for better maintainability
Encapsulates common functions for easy reuse
Reduces code duplication and promotes DRY (Don't Repeat Yourself) principle
Improves readability and modularity of code
Example: A helper file containing functions for date formatting used across multiple components
Q98. what is ajax and how does ajax works
AJAX stands for Asynchronous JavaScript and XML. It is a technique used for creating fast and dynamic web pages.
AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes.
It uses XMLHttpRequest object to communicate with the server and update parts of a web page without reloading the entire page.
AJAX can be used to create interactive web applications that can retrieve data from the server without interfering with t...read more
Q99. Do you know android programming
Yes, I have experience in Android programming.
I have developed several Android applications using Java and Kotlin.
I am familiar with Android Studio and the Android SDK.
I have experience with Android UI design and development.
I have worked with various Android libraries and APIs, such as Retrofit, Gson, and Google Maps API.
I have published apps on the Google Play Store.
Q100. Are u available for rotational shifts
Yes, I am available for rotational shifts.
I am flexible with my work schedule and can accommodate rotational shifts.
I understand the importance of being available during different times to support the team.
I have previous experience working in rotational shifts and have no issues with it.
More about working at TCS
Top HR Questions asked in HDFC Bank
Interview Process at HDFC Bank
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month