Hexaware Technologies
20+ SA Infrastructure Consultants Interview Questions and Answers
Q1. Program to find second largest number from set of array
Program to find second largest number from set of array
Sort the array in descending order
Return the second element of the sorted array
Q2. Write a program to check whether string is palindrome or not?
Program to check if a string is a palindrome or not.
Create a function to compare the original string with its reverse.
Ignore spaces and punctuation when checking for palindrome.
Example: 'racecar' is a palindrome, 'hello' is not.
Q3. Stack implementation, difference between stack and linked list , merge sort algorithm
Question on stack implementation, difference between stack and linked list, and merge sort algorithm.
Stack is a LIFO data structure while linked list is a linear data structure.
Stack is implemented using arrays or linked lists while linked list is implemented using pointers.
Merge sort is a divide and conquer algorithm that divides the input array into two halves, sorts them separately, and then merges them.
Merge sort has a time complexity of O(nlogn) and is a stable sorting a...read more
Q4. What are OOPS concepts and explain
OOPS concepts are the principles of Object-Oriented Programming that help in creating modular and reusable code.
OOPS stands for Object-Oriented Programming System
It includes concepts like Inheritance, Polymorphism, Encapsulation, and Abstraction
Inheritance allows a class to inherit properties and methods from another class
Polymorphism allows objects to take on multiple forms or behaviors
Encapsulation is the practice of hiding data and methods within a class
Abstraction is the ...read more
Q5. Explain Protected, private and public access modifier
Protected, private and public are access modifiers in object-oriented programming that control the visibility of class members.
Public members are accessible from anywhere in the program.
Private members are only accessible within the class they are declared in.
Protected members are accessible within the class they are declared in and any subclasses.
Access modifiers are used to enforce encapsulation and prevent unauthorized access to class members.
Q6. Write a program to reverse a string eg. Hello World to olleh dlrow
A program to reverse a string by iterating through the characters and appending them in reverse order.
Create a function that takes a string as input
Initialize an empty string to store the reversed string
Iterate through the characters of the input string in reverse order and append them to the empty string
Return the reversed string
Q7. Write a program to find second maximum number in an array.
Program to find second maximum number in an array of strings.
Convert array elements to integers for comparison.
Sort the array in descending order.
Return the second element in the sorted array.
Q8. Brief discription of project, regression in machine learning.
Regression in machine learning is a technique used to predict continuous numerical values based on input data.
Regression models are used to analyze the relationship between variables and predict outcomes.
Linear regression is a common type of regression used in machine learning.
Examples of regression in machine learning include predicting housing prices based on features like location and square footage, or predicting stock prices based on historical data.
Regression can also b...read more
Q9. What is Object Oriented Programming?
Object Oriented Programming is a programming paradigm based on the concept of objects, which can contain data and code.
OOP focuses on creating objects that interact with each other to solve problems
Objects have attributes (data) and methods (functions)
Encapsulation, inheritance, and polymorphism are key principles of OOP
Examples of OOP languages include Java, C++, and Python
Q10. Name 4 pillars of Object Oriented Programming
Encapsulation, Inheritance, Polymorphism, Abstraction are the 4 pillars of OOP
Encapsulation: Bundling data and methods that operate on the data into a single unit. Example: Class in Java
Inheritance: Ability of a class to inherit properties and behavior from another class. Example: Subclass extending a superclass
Polymorphism: Ability to present the same interface for different data types. Example: Method overloading in Java
Abstraction: Hiding the complex implementation details...read more
Q11. what is oop? what is os? joins in sql, insert query
OOP is Object-Oriented Programming. OS is Operating System. SQL joins and insert queries are used to manipulate data in databases.
OOP is a programming paradigm that focuses on objects and their interactions.
OS is a software that manages computer hardware and software resources.
SQL joins are used to combine data from two or more tables based on a related column.
Insert queries are used to add new data to a table in a database.
Q12. What is the difference b/w complie time and run time polymorphism?
Compile time polymorphism is resolved at compile time, while run time polymorphism is resolved at run time.
Compile time polymorphism is achieved through function overloading and operator overloading.
Run time polymorphism is achieved through function overriding and virtual functions.
Compile time polymorphism is faster as the resolution is done at compile time.
Run time polymorphism allows dynamic binding of functions based on the object type at run time.
Compile time polymorphis...read more
Q13. What is jagged array?
A jagged array is an array of arrays where each element can be of different sizes.
Each sub-array can have a different number of elements
Useful for representing data structures like matrices or tables
Example: [['apple', 'banana'], ['orange', 'grape', 'kiwi']]
Q14. What is Software Development Lifecycle ?
Software Development Lifecycle is a process followed by software development teams to design, develop and maintain software.
It includes phases like planning, analysis, design, implementation, testing, deployment, and maintenance.
Each phase has its own set of activities and deliverables.
It helps in ensuring that the software is developed efficiently and meets the requirements of the stakeholders.
Examples of SDLC models are Waterfall, Agile, and DevOps.
Q15. What are constructors?
Constructors are special methods in a class that are used to initialize objects.
Constructors have the same name as the class they belong to.
They are called automatically when an object is created.
Constructors can have parameters to initialize object properties.
They do not have a return type.
Example: public class Car { public Car(String color) { this.color = color; }}
Q16. Intro What is oops Encapsulation Polymorphism Runtime, compile time Dbms Sql vs no sql
Questions related to programming concepts and database management systems.
OOPs stands for Object-Oriented Programming which is a programming paradigm based on the concept of objects.
Encapsulation is the process of hiding the implementation details of an object from the outside world.
Polymorphism is the ability of an object to take on many forms.
Runtime and compile time are two phases of program execution.
DBMS stands for Database Management System which is a software system us...read more
Q17. Difference between DELETE and TRUNCATE ?
DELETE removes specific rows from a table while TRUNCATE removes all rows and resets the table.
DELETE is a DML command while TRUNCATE is a DDL command.
DELETE can be rolled back while TRUNCATE cannot be rolled back.
DELETE is slower than TRUNCATE as it logs each row deletion while TRUNCATE does not.
DELETE can have WHERE clause while TRUNCATE cannot have WHERE clause.
DELETE does not reset the identity of the table while TRUNCATE resets the identity of the table.
Q18. Explain prime number program
A program that identifies prime numbers.
A prime number is a number that is only divisible by 1 and itself.
The program should take an input number and check if it is prime.
One way to check for prime numbers is to divide the number by all numbers less than it.
If the number is only divisible by 1 and itself, it is prime.
Q19. Diff b/w call by value and call by reference?
Call by value passes a copy of the value, while call by reference passes the memory address of the value.
Call by value creates a new copy of the value being passed.
Call by reference passes the memory address of the value being passed.
Changes made to the parameter in call by value do not affect the original value.
Changes made to the parameter in call by reference affect the original value.
Q20. Explain program of Palindrome
A program that checks if a given string is the same when read forwards and backwards.
A palindrome can be a word, phrase, number, or other sequence of characters.
The program should remove any spaces and punctuation before checking for palindrome.
Examples of palindromes include 'racecar', 'level', and 'A man, a plan, a canal, Panama!'
Q21. Difference between Union and Union ALL ?
Union combines and removes duplicates from two or more tables, while Union ALL combines all rows from two or more tables.
Union removes duplicates, Union ALL does not
Union requires the same number of columns in each table, Union ALL does not
Union is slower than Union ALL
Example: SELECT column1 FROM table1 UNION SELECT column1 FROM table2
Example: SELECT column1 FROM table1 UNION ALL SELECT column1 FROM table2
Q22. Brief about arrays and a small program on array.
Arrays are a collection of similar data types. They are used to store and access multiple values using a single variable.
Arrays can be of different types such as integer, float, character, etc.
Arrays are declared with a fixed size and can be accessed using index numbers.
Example: int arr[5] = {1, 2, 3, 4, 5};
Arrays can also be of strings, which are essentially arrays of characters.
Example: char str[10] = 'Hello';
Q23. Explain the OOP Concepts? Use of OOP?
OOP stands for Object-Oriented Programming. It is a programming paradigm based on the concept of objects.
OOP focuses on creating objects that contain both data and methods to manipulate that data.
Encapsulation: Objects hide their internal state and require interaction through defined interfaces.
Inheritance: Objects can inherit attributes and methods from parent classes.
Polymorphism: Objects can take on multiple forms and behave differently based on their data type.
Example: In...read more
Q24. Write Bubble sort Program ?
Bubble sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order.
Compare adjacent elements and swap them if they are in the wrong order
Repeat this process until the list is sorted
Time complexity is O(n^2)
Example: [5, 3, 8, 4, 2] -> [3, 5, 8, 4, 2] -> [3, 5, 4, 8, 2] -> [3, 5, 4, 2, 8] -> [3, 4, 5, 2, 8] -> [3, 4, 2, 5, 8] -> [3, 4, 2, 5, 8] -> [3, 2, 4, 5, 8] -> [2, 3, 4, 5, 8]
Q25. 1.Different between c and c++
C++ is an extension of C with added features like object-oriented programming, templates, and exception handling.
C++ supports object-oriented programming while C does not.
C++ has a richer set of data types and operators than C.
C++ supports function overloading and templates while C does not.
C++ has exception handling while C does not.
C++ is backward compatible with C.
Example: C++ allows defining classes and objects while C does not.
Example: C++ supports function overloading, ...read more
Top HR Questions asked in SA Infrastructure Consultants
Interview Process at SA Infrastructure Consultants
Top Graduate Engineer Trainee (Get) Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month