
DXC Technology


DXC Technology Software Engineer Interview Questions and Answers for Freshers
Q1. Wap to find each character occurrence in string
Wap to find each character occurrence in string
Iterate through the string and use a dictionary to keep track of character counts
Use a for loop to iterate through the string and increment the count of each character in the dictionary
Print the dictionary to display the character counts
Q2. 2. Difference between DELETE and TRUNCATE and DROP
DELETE removes specific rows, TRUNCATE removes all rows, DROP removes entire table.
DELETE is a DML command, TRUNCATE and DROP are DDL commands.
DELETE can have a WHERE clause to specify which rows to delete.
TRUNCATE resets the table and cannot be undone.
DROP removes the table and all associated objects.
Example: DELETE FROM table WHERE id = 1;
Example: TRUNCATE table;
Example: DROP TABLE table;
Q3. What are 4 Pillars of OOPs
4 Pillars of OOPs are Abstraction, Encapsulation, Inheritance, and Polymorphism.
Abstraction: Hiding 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.
Q4. 1. check if string is Palindrome.
Check 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, compare the first and last characters, then the second and second-to-last characters, and so on.
If all pairs match, the string is a palindrome. If any pair does not match, the string is not a palindrome.
Q5. What is class
A class is a blueprint for creating objects that have similar attributes and behaviors.
A class is a user-defined data type that encapsulates data and functions.
It provides a way to organize and structure code.
Objects are instances of a class.
Classes can inherit properties and methods from other classes.
Examples of classes in programming languages include String, Integer, and List.
Q6. Method over loading
Method overloading is a feature in OOP where multiple methods can have the same name but different parameters.
Method overloading is used to improve code readability and reusability.
The methods must have different parameters, either in number or type.
Example: void print(int num), void print(String str), void print(int num1, int num2)
Method overloading is resolved at compile-time based on the number and type of arguments passed.
Top HR Questions asked in DXC Technology Software Engineer for Freshers
Interview Process at DXC Technology Software Engineer for Freshers

Top Software Engineer Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

