TCS
200+ CitiusTech Interview Questions and Answers
Q1. Constellation Identification Problem
Given a matrix named UNIVERSE
with 3 rows and 'N' columns, filled with characters {#, *, .}, where:
- '*' represents stars.
- '.' represents empty space.
- '#' represents a separ...read more
The task is to identify constellations shaped like vowels within a matrix filled with characters {#, *, .}.
Iterate through the matrix to find 3x3 constellations shaped like vowels.
Check for vowels 'A', 'E', 'I', 'O', 'U' in the constellations.
Print the vowels found in each test case.
Q2. Given a string S(input consisting) of ‘*’ and ‘#’. The length of the string is variable. The task is to find the minimum number of ‘*’ or ‘#’ to make it a valid string. The string is considered...
read moreFind minimum number of * or # to make a string valid with equal number of * and #.
Count the number of * and # in the string.
Find the absolute difference between the counts.
Return the difference as the minimum number of characters to add.
If the counts are already equal, return 0.
Q3. Space Survival Game Challenge
Ninja is in space with unlimited fuel in his super spaceship. He starts with a health level H
and his spaceship has an armour A
. Ninja can be on only one of the three planets at a ...read more
Calculate the maximum time Ninja can survive in a space survival game challenge.
Create a function that takes initial health and armour as input for each test case
Simulate Ninja's movement between planets and update health and armour accordingly
Keep track of the maximum time Ninja can survive before health or armour reaches 0
Q4. 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
Calculate 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 in the day.
Q5. Valid Pairs Problem Statement
Given an array of integers ARR
with a size of 'N' and two integers 'K' and 'M', determine if it is possible to divide the array into pairs such that the sum of every pair yields a ...read more
Determine if it is possible to divide an array into pairs such that the sum of every pair yields a specific remainder when divided by a given number.
Iterate through the array and calculate the sum of each pair.
Check if the sum of each pair gives the desired remainder when divided by the given number.
Return true if all pairs satisfy the condition, otherwise return false.
Q6. Maximize the Sum Through Two Arrays
You are given two sorted arrays of distinct integers, ARR1
and ARR2
. If there is a common element in both arrays, you can switch from one array to the other.
Your task is to ...read more
Given two sorted arrays, find the path through common elements for maximum sum.
Iterate through common elements in both arrays to find the path with maximum sum
Switch between arrays at common elements to maximize the sum
Keep track of the running sum as you traverse the arrays
Return the maximum sum obtained
Q7. Minimum Count of Balls in a Bag Problem Statement
You are given an integer array ARR
of size N
, where ARR[i]
represents the number of balls in the i-th
bag. Additionally, you have an integer M
, which indicates ...read more
Determine the minimum possible value of the maximum number of balls in a bag after performing a given number of operations.
Iterate through the bags and split them into two bags until the maximum number of operations is reached.
Keep track of the maximum number of balls in a bag after each operation.
Return the minimum possible value of the maximum number of balls in a bag.
Q8. What are the functions used in a particular code.
The functions used in the code are calculateSum, displayResult, and validateInput.
calculateSum - calculates the sum of two numbers
displayResult - displays the result of the calculation
validateInput - checks the validity of user input
Q9. Stack using Two Queues Problem Statement
Develop a Stack Data Structure to store integer values using two Queues internally.
Your stack implementation should provide these public functions:
Explanation:
1. Cons...read more
Implement a stack using two queues to store integer values with specified functions.
Create a stack class with two queue data members.
Implement push(data) function to add elements to the stack.
Implement pop() function to remove and return the top element.
Implement top() function to return the top element without removing it.
Implement size() function to return the current number of elements.
Implement isEmpty() function to check if the stack is empty.
Q10. Pair Sum Problem Statement
You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to find and return a list of all pairs of elements where each sum of a pair equals 'S'.
Note:
Each pa...read more
Given an array and a target sum, find pairs of elements that add up to the target sum.
Iterate through the array and for each element, check if the complement (target sum - current element) exists in a hash set.
If the complement exists, add the pair to the result list.
Sort the result list based on the first element of each pair, then the second element if the first elements are equal.
Q11. Heap Sort Problem Statement
Your task is to sort an array of integers in non-decreasing order using the Heap Sort algorithm.
Input:
The first line contains an integer 'T' denoting the number of test cases.
Each...read more
Heap Sort is used to sort an array of integers in non-decreasing order by creating a max heap and repeatedly extracting the maximum element.
Create a max heap from the input array.
Swap the root (maximum element) with the last element and reduce the heap size.
Heapify the root element to maintain the heap property.
Repeat the above steps until the heap size is 1.
The array will be sorted in non-decreasing order.
Q12. Loot Houses Problem Statement
A thief is planning to steal from several houses along a street. Each house has a certain amount of money stashed. However, the thief cannot loot two adjacent houses. Determine the...read more
Determine the maximum amount of money a thief can steal from houses without looting two consecutive houses.
Create an array 'dp' to store the maximum money that can be stolen up to the i-th house.
Iterate through the houses and update 'dp' based on whether the current house is looted or not.
Return the maximum value in 'dp' as the answer.
Q13. 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
The task is to determine the maximum possible number of unique vehicle registrations given the number of districts, the range of series letters, and the range of digits.
Parse the input for each test case: number of districts, 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.
Ensure to handle the constraints specified in the problem state...read more
Q14. Binary Palindrome Check
Given an integer N
, determine whether its binary representation is a palindrome.
Input:
The first line contains an integer 'T' representing the number of test cases.
The next 'T' lines e...read more
Check if the binary representation of a given integer is a palindrome.
Convert the integer to binary representation.
Check if the binary representation is a palindrome by comparing it with its reverse.
Return true if it is a palindrome, false otherwise.
Q15. Find Maximum Triangle Area
Given a 2D array/list POINTS
containing 'N' distinct points on a 2D coordinate system, where POINTS[i] = [Xi, Yi]
, you need to find the maximum area of the triangle that can be formed...read more
Find the maximum area of a triangle formed by 3 points in a 2D coordinate system.
Iterate through all possible combinations of 3 points to calculate the area of the triangle using the formula for area of a triangle given 3 points.
Keep track of the maximum area found so far and return it as the result.
Ensure to handle edge cases like collinear points or points with the same coordinates.
Q16. 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
Identify duplicate elements in an array of integers within a given range.
Iterate through the array and keep track of the frequency of each element using a hashmap.
Return elements with frequency greater than 1 as duplicates.
Handle edge cases like empty array or no duplicates found.
Example: For input [0, 3, 1, 2, 3], output should be [3].
Q17. Yogesh And Primes Problem Statement
Yogesh, a bright student interested in Machine Learning research, must pass a test set by Professor Peter. To do so, Yogesh must correctly answer Q questions where each quest...read more
Yogesh needs to find the minimum possible P such that there are at least K prime numbers in the range [A, P].
Iterate from A to B and check if each number is prime
Keep track of the count of prime numbers found in the range [A, P]
Return the minimum P that satisfies the condition or -1 if no such P exists
Q18. What is linklist ? Write a code to insert a node at the beginning of list ?
A linked list is a data structure that consists of a sequence of nodes, where each node contains a reference to the next node.
A linked list is a dynamic data structure that can grow or shrink as needed.
Each node in a linked list contains two parts: data and a reference to the next node.
To insert a node at the beginning of a linked list, we create a new node, set its data, and update the reference of the new node to point to the current head of the list.
Q19. What is the difference between c and c++?
C++ is an extension of C with object-oriented programming features.
C++ supports classes and objects while C does not.
C++ has better support for polymorphism and inheritance.
C++ has a standard template library (STL) while C does not.
C++ is more complex and has more features than C.
C++ is often used for developing large-scale software projects.
C is often used for system programming and embedded systems.
Q20. What are local variable and global variables? and their default values and program
Local variables are declared within a specific function or block, while global variables are declared outside of any function or block.
Local variables have a limited scope and are only accessible within the function or block where they are declared.
Global variables can be accessed from anywhere in the program.
Local variables are created when a function is called and destroyed when the function ends.
Global variables are created when the program starts and exist until the progr...read more
Q21. What is arraylist ? Advantage over generic arrays ?
ArrayList is a dynamic array that can grow or shrink in size. It provides advantages like dynamic resizing and built-in methods.
ArrayList is a resizable array implementation of the List interface in Java.
It can store elements of any type, including objects and primitives.
Advantages over generic arrays include dynamic resizing, automatic memory management, and built-in methods like add(), remove(), etc.
Example: ArrayList
names = new ArrayList (); names.add("John"); names.add("Ja...read more
Q22. Why is your handwriting bad ? And what steps you take to improve it
My handwriting is bad due to lack of practice and poor motor skills. I am taking steps to improve it.
I have started practicing writing regularly to improve my motor skills.
I am using handwriting improvement books and online resources to learn proper techniques.
I am also seeking feedback from others to identify areas of improvement.
I am using tools like grip aids and ergonomic pens to make writing more comfortable.
I am committed to improving my handwriting and am open to any s...read more
Q23. Did you participate in any program offered by tcs like codevita etc..?
Yes, I have participated in TCS CodeVita.
I participated in TCS CodeVita in 2020 and 2021.
I was able to solve several coding problems during the competition.
Participating in CodeVita helped me improve my coding skills and problem-solving abilities.
Q24. What is asymptotic notation ?
Asymptotic notation is a way to describe the performance of an algorithm by analyzing its behavior as the input size approaches infinity.
Asymptotic notation is used to analyze the efficiency and scalability of algorithms.
It provides a way to compare algorithms based on their growth rates.
Commonly used asymptotic notations include Big O, Big Omega, and Big Theta.
Big O notation represents the upper bound or worst-case scenario of an algorithm's time complexity.
For example, an a...read more
Q25. What is the difference between unions and joins? What is the difference between primary and unique keys?
Unions and joins are used to combine data from multiple tables. Primary keys are unique identifiers for a table, while unique keys ensure uniqueness of a column.
Unions combine data from two or more tables into a single result set, while joins combine data from two or more tables based on a common column.
Primary keys are used to uniquely identify each row in a table and cannot contain null values. Unique keys ensure that a column has unique values, but can contain null values....read more
Q26. What are the advantage and disadvantages of an array over Linked List?
Arrays offer constant time access and efficient memory usage, but have fixed size. Linked lists have dynamic size but slower access.
Arrays provide constant time access to elements using index
Arrays have efficient memory usage as they store elements in contiguous memory locations
Arrays have a fixed size and cannot be easily resized
Linked lists have dynamic size and can grow or shrink as needed
Linked lists allow efficient insertion and deletion of elements
Linked lists require e...read more
Q27. Will you sign the service bonds?
Yes, I am willing to sign the service bonds.
I understand the importance of service bonds in ensuring job security and commitment to the company.
I am willing to commit to the terms and conditions of the bond.
I believe in the company's vision and goals and am excited to contribute to its growth.
I have signed service bonds in the past and have fulfilled my obligations.
I am open to discussing the terms of the bond before signing.
Q28. What is join (Database) ?inner join ,outer join ?
Join is a database operation that combines rows from two or more tables based on a related column between them.
Inner join returns only the matching rows from both tables.
Outer join returns all the rows from one table and the matching rows from the other table.
There are different types of outer joins: left outer join, right outer join, and full outer join.
Joining tables can be done using the JOIN keyword in SQL.
Example: SELECT * FROM table1 INNER JOIN table2 ON table1.column =...read more
Q29. What is the use of python programming language on real problem ?
Python is a versatile programming language used for solving real-world problems in various fields.
Python is used for web development, data analysis, machine learning, and artificial intelligence.
It is used in scientific computing, finance, and gaming industries.
Python is used for automation, scripting, and building desktop applications.
It is also used for creating chatbots, web crawlers, and data visualization tools.
Python's simplicity, readability, and vast libraries make it...read more
Q30. What is the difference between Delete and Truncate commands?
Delete command removes rows from a table, while Truncate command removes all rows from a table.
Delete command is a DML (Data Manipulation Language) command, while Truncate command is a DDL (Data Definition Language) command.
Delete command can be rolled back, while Truncate command cannot be rolled back.
Delete command fires triggers, while Truncate command does not fire triggers.
Delete command is slower as it maintains logs, while Truncate command is faster as it does not main...read more
Q31. 2. What is an array? How to define an array? how to assign value to an array index?
An array is a collection of similar data types. It can be defined and values can be assigned to its indices.
Arrays can be defined using square brackets [] and specifying the size or leaving it empty for dynamic sizing.
Values can be assigned to array indices using the assignment operator = and specifying the index number.
Example: int arr[5]; arr[0] = 1; arr[1] = 2; arr[2] = 3; arr[3] = 4; arr[4] = 5;
Arrays can also be initialized during declaration like int arr[] = {1, 2, 3, 4...read more
Q32. What is difference between truncate, drop and delete?
Truncate, drop, and delete are SQL commands used to remove data from a table, but they differ in their functionality.
Truncate is a DDL command that removes all rows from a table, but keeps the structure intact.
Drop is a DDL command that removes an entire table, including its structure and data.
Delete is a DML command that removes specific rows from a table based on a condition.
Truncate is faster than delete as it doesn't generate any transaction logs.
Drop is irreversible and ...read more
Q33. What is static variable in C? with program
A static variable in C is a variable that retains its value between function calls.
Static variables are declared using the 'static' keyword.
They are initialized only once, at the start of the program.
Their value persists even after the function call ends.
Static variables have a default initial value of 0.
They are useful for maintaining state across function calls.
Q34. Which programming languages are you comfortable in?
I am comfortable in multiple programming languages including Java, Python, and C++.
Proficient in Java with experience in developing web applications using Spring framework
Skilled in Python with experience in data analysis and machine learning using libraries like NumPy and Pandas
Familiar with C++ and its object-oriented programming concepts
Also comfortable in languages like JavaScript and SQL
Q35. Given a maximum of 100 digit numbers as input, find the difference between the sum of odd and even position digits
Find the difference between the sum of odd and even position digits in a maximum of 100 digit number.
Iterate through the digits of the number and add the digits at odd positions to a variable for odd position digits and even positions to a variable for even position digits.
Calculate the difference between the two variables.
Return the difference.
Example: For the number 123456, the sum of digits at odd positions is 1+3+5=9 and the sum of digits at even positions is 2+4+6=12. Th...read more
Q36. Given an array Arr[] of N integers and a positive integer K. The task is to cycally rotate the array clockwise by K.
Cyclically rotate an array of N integers clockwise by K.
Create a temporary array of size K and copy the last K elements of the original array into it.
Shift the remaining elements of the original array K positions to the right.
Copy the elements from the temporary array to the beginning of the original array.
Time complexity: O(N)
Space complexity: O(K)
Q37. write a program for swapping 2 numbers without the 3rd variable.
Swapping 2 numbers without a third variable in a program.
Use arithmetic operations to swap the values of the variables.
Add the values of both variables and store the result in one variable.
Subtract the value of the second variable from the sum and store the result in the second variable.
Subtract the value of the first variable from the sum and store the result in the first variable.
Q38. What is call by value and call by reference?
Call by value and call by reference are two ways of passing arguments to a function.
Call by value passes a copy of the argument's value to the function.
Call by reference passes a reference to the argument's memory location to the function.
Call by value is used for simple data types like int, float, etc.
Call by reference is used for complex data types like arrays, structures, etc.
Q39. Write the program to check if a string is a palindrome or not
This program checks if a given string is a palindrome or not.
A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward.
To check if a string is a palindrome, we can compare the characters from the beginning and end of the string.
If the characters match for all positions, the string is a palindrome.
We can ignore spaces, punctuation, and letter case while checking for palindromes.
Q40. Tell me 5 differences between 8085 and 8086?
8085 and 8086 are two different microprocessors with distinct features.
8085 is an 8-bit microprocessor while 8086 is a 16-bit microprocessor.
8085 has a maximum clock frequency of 3 MHz while 8086 has a maximum clock frequency of 10 MHz.
8085 has a 16-bit address bus and an 8-bit data bus while 8086 has a 20-bit address bus and a 16-bit data bus.
8085 has a simple architecture with fewer instructions while 8086 has a complex architecture with more instructions.
8085 has a lower p...read more
Q41. Write a query to select the highest salary from employee table.
Query to select highest salary from employee table.
Use SELECT statement to retrieve data from employee table.
Use MAX function to find the highest salary.
Combine both using the syntax: SELECT MAX(salary) FROM employee;
Ensure that the column name is correct and matches the table schema.
Q42. what are scale up and scale down operations?
Scale up and scale down operations refer to increasing or decreasing the resources allocated to a system or application.
Scale up involves adding more resources to a system to handle increased demand or workload.
Examples of scale up include adding more RAM, CPU, or storage to a server.
Scale down involves reducing the resources allocated to a system when demand or workload decreases.
Examples of scale down include removing unused resources or shutting down servers that are no lo...read more
Q43. What is the difference between C and C++? What is the difference between c++ and java?
C is a procedural programming language while C++ is an object-oriented programming language. C++ is an extension of C with additional features.
C is a procedural programming language, while C++ is an object-oriented programming language.
C++ supports features like classes, inheritance, polymorphism, and operator overloading which are not present in C.
C++ is an extension of C, so C code can be easily integrated into C++ programs.
Java is also an object-oriented programming langua...read more
Q44. Is multiple inheritance is possible in Java, If not what is best possible way for this kind of implementation
Multiple inheritance is not possible in Java due to the Diamond Problem. The best way to achieve similar functionality is through interfaces or using composition.
Java does not support multiple inheritance of classes to avoid the Diamond Problem
Instead, Java supports multiple inheritance of interfaces, allowing a class to implement multiple interfaces
Composition can also be used to achieve similar functionality by creating objects of other classes within a class
Q45. Explain the term inheritance and give exmapld by writing a program
Inheritance is a mechanism in object-oriented programming where a new class is created by inheriting properties of an existing class.
Inheritance allows code reusability and saves time and effort in programming.
The existing class is called the parent or base class, and the new class is called the child or derived class.
The child class inherits all the properties and methods of the parent class and can also add its own unique properties and methods.
Example: class Car is a paren...read more
Q46. What is the difference between inner and outer join ?
Inner join returns only the matching rows from both tables while outer join returns all rows from both tables with null values for non-matching rows.
Inner join is used to combine rows from two tables where the join condition is met.
Outer join is used to combine rows from two tables even if the join condition is not met.
There are three types of outer join: left outer join, right outer join, and full outer join.
Left outer join returns all rows from the left table and matching r...read more
Q47. How do you execute code inside loop and then check for condition?
Use a do-while loop to execute code and then check for condition.
Write the code to be executed inside the do block
After the code block, add a while loop with the condition to be checked
The code inside the do block will always execute at least once
Example: do { code } while (condition);
Q48. What are the different operators in c?
C language has various operators like arithmetic, relational, logical, bitwise, assignment, and conditional operators.
Arithmetic operators: +, -, *, /, %
Relational operators: <, >, <=, >=, ==, !=
Logical operators: &&, ||, !
Bitwise operators: &, |, ^, ~, <<, >>
Assignment operators: =, +=, -=, *=, /=, %=
Conditional operator: ? :
Q49. Which programming language do you know?
I know multiple programming languages including Java, Python, and C++.
Java
Python
C++
Q50. What is cache memory?with real time example
Cache memory is a small, fast memory that stores frequently accessed data for quick access.
Cache memory is faster than main memory but smaller in size.
It reduces the time taken to access data from main memory.
Examples include CPU cache, web browser cache, and disk cache.
Cache memory is volatile and can be cleared at any time.
Cache hit is when data is found in cache, cache miss is when it's not.
Q51. What is polymorphism, difference between C and C++ , write a program using 6 loops etc
Answering questions related to polymorphism, C and C++, and loops.
Polymorphism is the ability of an object to take on many forms. C++ supports both compile-time and runtime polymorphism.
C++ is an object-oriented language while C is a procedural language.
A program using 6 loops can be written in various ways depending on the requirements.
Examples of loops include for, while, do-while, range-based for, nested loops, and infinite loops.
Q52. 1. In which programming language you are comfortable with?
I am comfortable with multiple programming languages including Java, Python, and C++.
Proficient in Java with experience in developing web applications using Spring framework
Skilled in Python for data analysis and machine learning projects
Familiar with C++ for competitive programming and algorithm development
Comfortable with SQL for database management
Experience with JavaScript and HTML/CSS for front-end development
Continuously learning and exploring new technologies and langu...read more
Q53. What is method overloading and method overriding?
Method overloading is creating multiple methods with the same name but different parameters. Method overriding is creating a new implementation of an existing method in a subclass.
Method overloading is used to provide different ways of calling a method with different parameters.
Method overriding is used to change the behavior of an existing method in a subclass.
Method overloading is resolved at compile-time based on the number and type of arguments passed.
Method overriding is...read more
Q54. What is the local and global variable?
Local variables are declared within a function and have a limited scope, while global variables are declared outside of a function and can be accessed throughout the program.
Local variables are only accessible within the function they are declared in.
Global variables can be accessed from any part of the program.
Local variables are created when a function is called and destroyed when the function ends.
Global variables are created when the program starts and destroyed when the ...read more
Q55. 2. What is OOPS in C++? What are the properties of OOPS?
OOPS in C++ stands for Object-Oriented Programming System. It is a programming paradigm based on the concept of objects.
OOPS is based on the four main principles: Encapsulation, Inheritance, Polymorphism, and Abstraction.
Encapsulation is the process of binding data and functions that manipulate the data, and keeping them together as a single unit.
Inheritance is the process of creating a new class from an existing class, inheriting all the properties and methods of the parent ...read more
Q56. What are loops? What is if, else and while loop?
Loops are used to repeat a set of instructions. If, else and while loops are conditional statements used in programming.
If statement is used to execute a block of code if a condition is true.
Else statement is used to execute a block of code if the same condition is false.
While loop is used to execute a block of code repeatedly as long as a condition is true.
For loop is used to execute a block of code a specific number of times.
Q57. What is method overriding? with program
Method overriding is a feature in object-oriented programming where a subclass provides a different implementation of a method that is already defined in its superclass.
Method overriding is used to achieve runtime polymorphism.
The method in the subclass must have the same name, return type, and parameters as the method in the superclass.
The @Override annotation can be used to indicate that a method is intended to override a superclass method.
The overridden method in the subcl...read more
Q58. What is the difference between sql and mysql
SQL is a language used to manage relational databases, while MySQL is a specific relational database management system.
SQL is a language used to manage relational databases, while MySQL is a specific implementation of a relational database management system.
SQL is a standard language used across different database management systems, while MySQL is a specific product developed by Oracle Corporation.
MySQL is an open-source database management system that uses SQL as its langua...read more
Q59. What is the difference between Java and c++?
Java is an object-oriented programming language while C++ is a hybrid language with both object-oriented and procedural programming features.
Java is platform-independent while C++ is platform-dependent.
Java has automatic garbage collection while C++ requires manual memory management.
Java has a simpler syntax and is easier to learn than C++.
C++ allows for low-level memory manipulation and is faster than Java.
Java is used for developing web applications, mobile applications, an...read more
Q60. What is byte code ? (Java)
Byte code is a compiled code that is generated by the Java compiler and can be executed by the Java Virtual Machine (JVM).
Byte code is an intermediate representation of Java source code.
It is platform-independent and can be executed on any device with a JVM.
Byte code is stored in .class files.
Examples of byte code instructions include loading, storing, and arithmetic operations.
Q61. Write a query to delete a row. Write a syntax to convert if loop to while loo
Answering a query to delete a row and converting if loop to while loop.
To delete a row, use the DELETE statement with the WHERE clause to specify the row to be deleted.
Syntax: DELETE FROM table_name WHERE condition;
To convert an if loop to while loop, replace the if statement with a while loop and add a condition to exit the loop.
Example: if (condition) { // code } can be converted to while (condition) { // code }
Q62. Difference between service based and product based company?
Service-based companies provide services to clients while product-based companies sell products to customers.
Service-based companies focus on providing services to clients, such as consulting, outsourcing, and support services.
Product-based companies focus on selling products to customers, such as software, hardware, and consumer goods.
Service-based companies typically have a more flexible business model and may have a wider range of clients, while product-based companies may...read more
Q63. Explain me about exception handling? with program
Exception handling is a mechanism to handle runtime errors and prevent program crashes.
Exceptions are objects that represent errors or exceptional situations in a program.
When an exception occurs, the program stops executing and jumps to the nearest exception handler.
Exception handling involves catching and handling exceptions to prevent program crashes.
Try-catch blocks are used to catch and handle exceptions.
Example: try { //code that may throw an exception } catch (Exceptio...read more
Q64. Project details,tech stack used for the project where did you use python ?
Developed a web application for inventory management using Python, Django, HTML, CSS, and JavaScript.
Used Python for backend development to handle data processing and business logic
Utilized Django framework for building the web application
Implemented HTML and CSS for frontend design and user interface
Integrated JavaScript for client-side interactions and dynamic content
Worked on database management using Django ORM
Q65. Tell me recent activities of TCS
TCS has recently launched a new AI-powered solution for supply chain management.
TCS launched an AI-powered solution for supply chain management called 'Supply Chain Command Center'
TCS partnered with SAP to launch a new digital learning platform for their employees
TCS was ranked as the third largest employer in the IT services sector by Forbes
TCS announced a collaboration with Intel to develop a blockchain solution for the insurance industry
Q66. Tell me what you know about python language
Python is a high-level, interpreted programming language known for its simplicity and readability.
Python was created by Guido van Rossum in the late 1980s.
It is widely used in web development, scientific computing, data analysis, artificial intelligence, and more.
Python has a large standard library and supports multiple programming paradigms.
Some popular frameworks and libraries in Python include Django, Flask, NumPy, and Pandas.
Python code is often written in a text editor a...read more
Q67. What is view and constraint in SQL?
View is a virtual table while constraint is a rule to limit data in a table.
View is created by a SELECT statement and does not store data
Constraint is used to limit the type or amount of data that can be inserted into a table
Examples of constraints are PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK
Views can be used to simplify complex queries or to restrict access to sensitive data
Q68. Find the distinct elements in a given array.(Assume size of array n<=20)
Find distinct elements in a given array of size n<=20.
Iterate through the array and add each element to a set.
Return the size of the set as the number of distinct elements.
Example: [1, 2, 3, 2, 1] -> {1, 2, 3} -> 3 distinct elements.
Q69. Who is the CEO of TCS?
The CEO of TCS is Rajesh Gopinathan.
Rajesh Gopinathan became the CEO of TCS in 2017.
He has been with TCS for over 20 years, starting as an engineer.
Under his leadership, TCS has continued to grow and expand globally.
Gopinathan has also emphasized the importance of digital transformation and innovation.
He holds a degree in electrical and electronics engineering from the National Institute of Technology, Tiruchirappalli.
Q70. What is a list and tuple?
List and tuple are data structures in Python used to store collections of items.
Lists are mutable and can be modified, while tuples are immutable and cannot be modified.
Lists are defined using square brackets [], while tuples are defined using parentheses ().
Lists are commonly used for storing and manipulating data, while tuples are used for grouping related data.
Example of a list: my_list = [1, 2, 3]
Example of a tuple: my_tuple = (4, 5, 6)
Q71. what is a++ and ++a?
a++ and ++a are both increment operators in programming languages like C++ and Java.
a++ is a post-increment operator which increments the value of a after the expression is evaluated.
++a is a pre-increment operator which increments the value of a before the expression is evaluated.
Both operators can be used with variables of numeric data types like int, float, etc.
Example: int a = 5; int b = a++; // b = 5, a = 6; int c = ++a; // c = 7, a = 7;
Q72. drawbacks of iphone 6? what do you use?
Drawbacks of iPhone 6 include battery life, storage capacity, and lack of headphone jack. I use an iPhone 11.
Battery life is relatively short compared to newer models
Storage capacity is limited and non-expandable
Lack of headphone jack requires the use of adapters or wireless headphones
iPhone 11 has longer battery life, larger storage capacity, and improved camera features
Q73. What is difference between static and dynamic polymorphism.
Static polymorphism is resolved at compile-time while dynamic polymorphism is resolved at runtime.
Static polymorphism is achieved through function overloading and operator overloading.
Dynamic polymorphism is achieved through virtual functions and function overriding.
Static polymorphism is faster as it is resolved at compile-time.
Dynamic polymorphism is more flexible as it allows for runtime binding of functions.
Example of static polymorphism: function overloading - multiple f...read more
Q74. Write the logic for a palindrome, Armstrong number, Fibonacci sequence and etc?
Logic for palindrome, Armstrong number, Fibonacci sequence, etc.
Palindrome: Reverse the given number/string and check if it's equal to the original
Armstrong number: Sum of cubes of individual digits should be equal to the number itself
Fibonacci sequence: Add the previous two numbers to get the next number in the sequence
Prime number: A number that is divisible only by 1 and itself
Factorial: Multiply all the numbers from 1 to the given number
GCD: Find the greatest common divis...read more
Q75. Explain theta notation diagrammatically ?
Theta notation is a way to describe the upper bound of an algorithm's time complexity.
Theta notation is represented by Θ
It describes the tightest possible bound on an algorithm's time complexity
It takes into account both the best and worst case scenarios
For example, an algorithm with Θ(n) time complexity will have a linear runtime
An algorithm with Θ(n^2) time complexity will have a quadratic runtime
Q76. What is OOPS, explain the basic principles of OOPS.
OOPS stands for Object-Oriented Programming System. It is a programming paradigm based on the concept of objects.
OOPS is based on four basic principles: Encapsulation, Inheritance, Polymorphism, and Abstraction.
Encapsulation is the process of hiding the implementation details of an object from the outside world.
Inheritance allows a class to inherit properties and methods from another class.
Polymorphism allows objects of different classes to be treated as if they were of the s...read more
Q77. What is microprocessor?, what all are present inside microprocessor?,
A microprocessor is an integrated circuit that contains the functions of a central processing unit of a computer.
Microprocessor is the brain of a computer system.
It contains an arithmetic logic unit (ALU), control unit (CU), and registers.
Examples of microprocessors include Intel's Pentium, AMD's Ryzen, and ARM's Cortex.
Microprocessors are used in various devices such as smartphones, cars, and home appliances.
Q78. What is pointers and what is tree and a program to print pattern
Pointers are variables that store memory addresses. Trees are data structures consisting of nodes connected by edges. A program to print pattern can vary depending on the desired pattern.
Pointers are used to manipulate memory and create dynamic data structures.
They can be used to pass values by reference instead of by value.
Example: int *ptr; ptr = # *ptr = 10; //num now equals 10
Trees are used to represent hierarchical relationships between data.
They consist of nodes connect...read more
Q79. What is stack?operations and program
A stack is a data structure that follows the Last In First Out (LIFO) principle.
Elements are added to the top of the stack and removed from the top.
Common operations include push (add element to top) and pop (remove element from top).
Stacks are used in programming for function calls, expression evaluation, and memory management.
Example: The back button in a web browser uses a stack to keep track of visited pages.
Example: Undo/Redo functionality in a text editor can be impleme...read more
Q80. What is delete, truncate and drop?
Delete, truncate and drop are SQL commands used to remove data from a database.
DELETE command removes specific rows from a table
TRUNCATE command removes all rows from a table
DROP command removes an entire table from the database
DELETE and TRUNCATE can be rolled back, but DROP cannot
DELETE and TRUNCATE can have WHERE clause to specify which rows to remove
Q81. What do you know about TCS?
TCS is a multinational IT services company headquartered in India.
TCS stands for Tata Consultancy Services.
It was founded in 1968 by J.R.D. Tata.
It is one of the largest IT services companies in the world.
TCS offers services in areas such as consulting, digital transformation, and engineering.
It has a presence in over 46 countries.
Some of its clients include major companies like Microsoft, Citigroup, and General Electric.
Q82. What is hashing is it similar to dictionary in python
Hashing is a technique to convert any data into a fixed size value. It is similar to dictionary in Python.
Hashing is used to store and retrieve data quickly
Hashing function takes input data and returns a fixed size value
Hashing is used in password storage, data encryption, and indexing
Python dictionaries use hashing to store and retrieve key-value pairs
Q83. Final year project, in detail explain design and justify the design.
Designed a smart irrigation system using IoT technology.
The system uses sensors to detect soil moisture levels and weather conditions.
Data is transmitted to a microcontroller which controls the irrigation system.
The system is designed to conserve water and reduce manual labor.
The design was justified by its potential to save water and increase crop yield.
Q84. 5 essentials of cloud computing if any?
The 5 essentials of cloud computing are on-demand self-service, broad network access, resource pooling, rapid elasticity, and measured service.
On-demand self-service: Users can provision computing resources as needed without human interaction.
Broad network access: Services are available over the network and can be accessed by various devices.
Resource pooling: Resources are shared among multiple users to achieve efficiency and scalability.
Rapid elasticity: Resources can be qui...read more
Q85. What are different Database commands?
Database commands are used to manipulate and retrieve data from a database.
SELECT: retrieves data from a database
INSERT: adds new data to a database
UPDATE: modifies existing data in a database
DELETE: removes data from a database
CREATE: creates a new database or table
DROP: deletes a database or table
ALTER: modifies the structure of a database or table
Q86. What is computer science ?
Computer science is the study of computers and computational systems.
Computer science involves the theory, design, development, and application of computer systems.
It encompasses various areas such as algorithms, programming languages, data structures, artificial intelligence, and computer networks.
Computer scientists solve complex problems and create innovative solutions using computational techniques.
Examples of computer science applications include software development, da...read more
Q87. What is dangling pointer?
A dangling pointer is a pointer that points to a memory location that has been deallocated or freed.
Dangling pointers occur when a pointer is not set to NULL after the memory it points to is freed.
Accessing a dangling pointer can lead to undefined behavior or crashes.
Dangling pointers can be avoided by setting pointers to NULL after freeing the memory they point to.
Q88. How is flutter different from other mobile technologies
Flutter is a cross-platform mobile development framework created by Google, allowing developers to build native-like apps for both iOS and Android using a single codebase.
Flutter uses a single codebase for both iOS and Android, reducing development time and effort.
Flutter has a hot reload feature, allowing developers to see changes instantly without restarting the app.
Flutter provides a rich set of customizable widgets, making it easy to create visually appealing UIs.
Flutter ...read more
Q89. What are statefull and stateless widgets in flutter
Stateful widgets maintain state that might change during the lifetime of the widget, while stateless widgets do not.
Stateful widgets have a State object that can hold dynamic information and can be updated over time.
Stateless widgets are immutable and their properties cannot change once they are initialized.
Examples of stateful widgets include TextField, Checkbox, and Slider.
Examples of stateless widgets include Text, Icon, and RaisedButton.
Q90. What is the difference between abstraction and encapsulation.
Abstraction focuses on the outside view of an object while encapsulation deals with the internal workings of an object.
Abstraction is the process of hiding complex implementation details and showing only the necessary information to the user.
Encapsulation is the process of wrapping data and methods into a single unit (class) and restricting access to the internal details.
Abstraction is achieved through abstract classes and interfaces.
Encapsulation is achieved through access m...read more
Q91. Which provides more security Java or c
Java provides more security compared to C.
Java has built-in security features like bytecode verification, sandboxing, and automatic memory management.
C does not have these built-in security features and is more prone to buffer overflows and memory leaks.
Java's platform independence also adds an extra layer of security as it reduces the risk of system vulnerabilities.
Java's strict type checking helps prevent common programming errors that can lead to security vulnerabilities.
C...read more
Q92. Difference between Java and javascript. Benefits of using javascript. Site three difference between Java and javascript Write a program to find palindrome. What is DOM What is virtual DOM
Java is a programming language used for general-purpose programming, while JavaScript is a scripting language primarily used for web development.
Java is a statically typed language, while JavaScript is dynamically typed.
Java is compiled and runs on the Java Virtual Machine (JVM), while JavaScript is interpreted and runs in the browser.
Java is used for backend development, desktop applications, and Android apps, while JavaScript is used for front-end web development.
Q93. Why TCS, Five facts about TCS, Preferred Location
TCS is a global IT services, consulting and business solutions organization.
TCS is one of the largest IT services companies in the world.
It has a presence in over 46 countries.
TCS has won numerous awards for its innovation and sustainability practices.
It offers a wide range of services including application development, infrastructure management, and digital transformation.
Preferred location is dependent on the project requirements and client location.
Q94. What is object oriented programming language? Difference between method overloading and method overriding. Explain oops concepts.
Object oriented programming language is a programming paradigm based on the concept of objects, which can contain data and code.
Method overloading is when multiple methods have the same name but different parameters in the same class. Example: void print(int a) and void print(int a, int b)
Method overriding is when a subclass provides a specific implementation of a method that is already provided by its superclass. Example: class A { void display() { System.out.println('A'); }...read more
Q95. What is an operating system?
An operating system is a software that manages computer hardware and software resources and provides common services for computer programs.
An operating system acts as an intermediary between the user and the computer hardware.
It provides a user interface to interact with the computer system.
It manages memory, processes, files, and devices.
Examples of operating systems include Windows, macOS, Linux, Android, and iOS.
Q96. Difference between abstract class and interface, how to check mysql version.
Abstract class is a class with implementation while interface is a contract without implementation. To check MySQL version, use SELECT VERSION();
Abstract class can have constructors while interface cannot
Abstract class can have non-abstract methods while interface cannot
A class can implement multiple interfaces but can only inherit from one abstract class
To check MySQL version, use SELECT VERSION(); in MySQL command line or any MySQL client
Q97. What are the features of C?
C is a high-level programming language known for its efficiency and portability.
C is a compiled language
It has a rich set of operators and data types
It supports both procedural and object-oriented programming
C is widely used in system programming, embedded systems, and game development
Examples of C-based software include the Linux kernel, MySQL, and Adobe Photoshop
Q98. What is pass and break?
In programming, pass and break are keywords used for control flow.
pass is a keyword used to indicate that no action should be taken in a certain block of code.
break is a keyword used to exit a loop or switch statement.
pass is commonly used as a placeholder when a statement is required syntactically but no action is needed.
break is used to terminate the execution of a loop or switch statement and continue with the next statement outside the loop or switch.
Q99. What is the latest technology?
The latest technology is artificial intelligence (AI).
Artificial intelligence (AI) is a branch of computer science that enables machines to perform tasks that typically require human intelligence.
AI technologies include machine learning, natural language processing, computer vision, and robotics.
Examples of AI applications include virtual assistants (e.g., Siri, Alexa), autonomous vehicles, facial recognition systems, and recommendation algorithms.
AI is being used in various ...read more
Q100. Explain jvm , jre , jdk ?
JVM is a virtual machine that executes Java bytecode. JRE is a runtime environment that includes JVM and libraries. JDK is a development kit that includes JRE and tools for developing Java applications.
JVM stands for Java Virtual Machine and is responsible for executing Java bytecode.
JRE stands for Java Runtime Environment and includes JVM and libraries required to run Java applications.
JDK stands for Java Development Kit and includes JRE along with tools for developing Java ...read more
More about working at TCS
Top HR Questions asked in CitiusTech
Interview Process at CitiusTech
Reviews
Interviews
Salaries
Users/Month