Cognizant
10+ Bsa Corporation Interview Questions and Answers
Q1. your name in a database is repeated multiple number of types.To reduce it or to remove redundancy what do you do?
To remove redundancy in a database with repeated names, use normalization techniques.
Identify the primary key of the table and ensure it is unique
Create separate tables for related data to avoid repeating information
Use foreign keys to link related tables
Consider using indexing to improve performance
Update existing data to conform to the new structure
Q2. To convert a datatype into another what process is used?
Typecasting is used to convert one datatype into another.
Typecasting is the process of converting a value from one datatype to another.
It can be done implicitly or explicitly.
Implicit typecasting is done automatically by the compiler.
Explicit typecasting is done manually by the programmer using casting operators.
Examples of typecasting include converting an integer to a float, a string to an integer, etc.
Q3. what you mean by call by value and reference ,funtions.
Call by value and reference are two ways of passing arguments to functions.
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.
Functions that use call by value cannot modify the original value of the argument.
Functions that use call by reference can modify the original value of the argument.
In some programming languages, call by reference is achieved using pointers.
Example: ...read more
Q4. What are the differences between array list and array?
Array list is a dynamic array that can grow or shrink in size, while array has a fixed size.
Array list can dynamically resize itself, while array has a fixed size.
Array list is part of Java's Collection framework, while array is a basic data structure in most programming languages.
Array list allows insertion and deletion of elements at any position, while array does not support this flexibility.
Q5. Which search is better?linear or binary?and what are time complexities
Binary search is better for sorted arrays. Time complexity: Linear - O(n), Binary - O(log n).
Linear search is suitable for unsorted arrays.
Binary search is suitable for sorted arrays.
Linear search has a time complexity of O(n).
Binary search has a time complexity of O(log n).
Q6. What is the difference between 3NF and BCNF?
3NF eliminates transitive dependencies while BCNF eliminates partial dependencies.
3NF stands for Third Normal Form and BCNF stands for Boyce-Codd Normal Form.
3NF eliminates transitive dependencies by breaking down tables into smaller ones.
BCNF eliminates partial dependencies by ensuring that every determinant is a candidate key.
3NF is a subset of BCNF.
Example: In a table with columns A, B, and C, where A determines B and B determines C, 3NF would require splitting the table i...read more
Q7. Able to relocate according to project requirements
Yes, I am willing to relocate for project requirements.
I am open to relocating for the duration of the project
I understand that project requirements may require me to move to a different location
I am willing to adapt to new environments and work with different teams
Q8. How many types of join inSQL?
There are four types of joins in SQL: INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN.
INNER JOIN: Returns rows when there is at least one match in both tables.
LEFT JOIN: Returns all rows from the left table, and the matched rows from the right table.
RIGHT JOIN: Returns all rows from the right table, and the matched rows from the left table.
FULL JOIN: Returns rows when there is a match in one of the tables.
Q9. What is encapsulation
Encapsulation is the concept of bundling data and methods that operate on the data into a single unit, known as a class.
Encapsulation helps in hiding the internal state of an object and restricting access to it.
It allows for data hiding, which prevents direct access to the internal state of an object.
Encapsulation also helps in achieving data abstraction, where the internal details of an object are hidden and only the necessary details are exposed.
By using access modifiers li...read more
Q10. Explain linear and binary search
Linear search checks each element in a list sequentially. Binary search divides the list in half to find the target.
Linear search has a time complexity of O(n), while binary search has a time complexity of O(log n).
Linear search is useful for small lists or unsorted data, while binary search is useful for large sorted lists.
Binary search requires the list to be sorted in ascending or descending order.
Example of linear search: searching for a name in a phone book.
Example of bi...read more
Q11. Your introduction, and why you chose programming.
I am a passionate software engineer trainee with a strong interest in problem-solving and creating innovative solutions through programming.
I have always been fascinated by technology and the endless possibilities it offers.
Programming allows me to express my creativity and logical thinking in a tangible way.
I enjoy the challenge of solving complex problems and the satisfaction of seeing my code come to life.
For example, I developed a mobile app for tracking personal fitness ...read more
Q12. What is inheritance
Inheritance is a concept in object-oriented programming where a class can inherit attributes and methods 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 access public and protected members of the base class
Example: Class 'Car' can inherit from class 'Vehicle'
Q13. 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 overloading and method overriding.
Example: A shape class can have different subclasses like circle, square, triangle, etc. and all can be treated as shapes.
Example: A method can take different types of objects as parameters and perform different actions based on the object type.
Q14. Explain public static void main
The main method in Java is the entry point for any Java program. It is declared as public static void main(String[] args).
public: The main method is public so that it can be accessed by the JVM.
static: The main method is static so that it can be called without creating an instance of the class.
void: The main method does not return any value.
main: The name of the method that serves as the entry point for the program.
String[] args: The main method takes an array of strings as a...read more
Q15. Print hello world in java
Printing hello world in Java using System.out.println() method
Use System.out.println("Hello, World!"); to print hello world in Java
Make sure to include the semicolon at the end of the statement
More about working at Cognizant
Interview Process at Bsa Corporation
Top Software Engineer Trainee Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month