Amdocs
60+ Andhra Pradesh State Skill Development Corporation Interview Questions and Answers
You are given an array “NUMS” consisting of N integers and an integer, K. Your task is to determine the maximum sum of an increasing subsequence of length K.
Note:
1. The array may contain...read more
Given a string ‘STR’ consisting of lower case English letters, the task is to find the first non-repeating character in the string and return it. If it doesn’t exist, return ‘#...read more
Given a string ‘STR’ of length 'N'. Implement the atoi function. If there are no numbers in the string, return 0.
In other words, given a string ‘STR’ convert the string to an integer.
Ex...read more
You have been given an array/list ARR of length N consisting of 0s and 1s only. Your task is to find the number of subarrays(non-empty) in which the number of 0s and 1s are equal....read more
You are given a string 'S'. Your task is to check whether the string is palindrome or not. For checking palindrome, consider alphabets and numbers only and ignore the symbols ...read more
You are given an array of n integers (a1, a2,....,an), you need to find if the array contains a pythagorean triplet or not.
An array is said to have a pythagorean triplet if there exists thr...read more
You are given an integer, all you have to do is to find whether this number is a Fibonacci number or not.
Fn is said to be a Fibonacci sequence such that each number in Fn is the sum of its two ...read more
You are given a binary tree in which each node contains an integer value and a number ‘K’. Your task is to print every path of the binary tree with the sum of nodes in the path as ‘...read more
Nth term of Fibonacci series F(n), where F(n) is a function, is calculated using the following formula -
F(n) = F(n-1) + F(n-2), Where, F(1) = F(2) = 1
Provided N you have to find out the ...read more
Given an integer N, print all the prime numbers that lie in the range 2 to N (both inclusive).
Print the prime numbers in different lines.
Input Format :
Integer N
Output Format :
Prime numbe...read more
Reverse a given stack of integers using recursion.
Note:
You are not allowed to use any extra space other than the internal stack space used due to recursion. You are not allowed to...read more
Ninja is given a task to implement a priority queue using Heap data structure. The Ninja is busying preparing for the tournament., So he asked for your help.
Your task is to use the c...read more
What do chmod, chown, chgrp commands do?
Q14. How to convert a string containing a number into integer without using inbuilt function?
Convert string to integer without using inbuilt function
Iterate through each character and multiply by 10 and add the integer value of the character
Use ASCII values to convert character to integer
Handle negative numbers separately
Q15. What is right outer join and it's use in real world scenario
Right outer join is a type of join operation that returns all the rows from the right table and the matching rows from the left table.
Right outer join is denoted by the RIGHT JOIN keyword in SQL.
It is used to combine rows from two tables based on a related column.
In the result set, unmatched rows from the right table will have NULL values for the columns of the left table.
A real-world scenario for using a right outer join is when analyzing customer data and sales data. The ri...read more
What is a friend function in C++?
What is meant by normalization and denormalization?
Write a query that joins two tables A and B having common attribute ID and selects records(ID_NAME) that have matching ID values in both tables .
What is Garbage collector in JAVA?
Explain any 5 essential UNIX commands .
Q21. What is recursion?Explain it graphically?How compiler executed recursion?
Recursion is a process in which a function calls itself repeatedly until a base condition is met.
Recursion involves breaking down a problem into smaller subproblems and solving them recursively.
It uses a stack to keep track of function calls and their parameters.
Examples include factorial, Fibonacci sequence, and binary search.
Compiler executes recursion by allocating memory for each function call and storing the return address and local variables on the stack.
It then pops th...read more
What is Static variable in C ?
Explain Run Time Polymorphism in C++.
Explain Left Outer Join and Right Outer Join .
Q25. What is python and constructer ,arrays,data structures
Python is a high-level programming language known for its simplicity and readability. Constructors are special methods used to initialize objects in classes.
Python is a versatile programming language used for web development, data analysis, artificial intelligence, and more.
Constructors in Python are special methods with the __init__() function that initialize objects when they are created.
Arrays in Python are data structures that can hold multiple values of the same type. Th...read more
Q26. Swap two character variables without using third
Swapping two character variables without using third
Use XOR operator to swap two variables without using third variable
Assign the XOR of both variables to the first variable
Assign the XOR of the first variable and second variable to the second variable
Difference between Primary key and Unique key
3 bulbs are there you have to find the correct switch for those bulbs If bulbs are outside the room and switch are inside the room
Q29. Write any program of recursion and explain it using stack frames?
A program demonstrating recursion using factorial function.
Recursion is a technique where a function calls itself.
Factorial function is a classic example of recursion.
Each recursive call creates a new stack frame.
The base case is when the input is 1, and the function returns 1.
The final result is the product of all the recursive calls.
Example: factorial(5) = 5 * factorial(4) = 5 * 4 * factorial(3) = ... = 5 * 4 * 3 * 2 * 1 = 120.
Explain Singleton Class in Java
Q31. which data structure is used in recursion?
The data structure used in recursion is a stack.
Recursion uses a stack data structure to keep track of function calls.
Each time a function is called, its parameters and local variables are pushed onto the stack.
When the function returns, the values are popped off the stack.
This allows the program to keep track of where it is in the recursive process.
Examples of recursive algorithms that use a stack include depth-first search and quicksort.
Q32. 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 can't have null values, Unique key can have one null value
A table can have only one Primary key, but multiple Unique keys
Primary key is automatically indexed, Unique key is not necessarily indexed
Second Highest Salary in a Table
Q34. Write a program to check string is pallindrome or not
Program to check if a string is a palindrome or not.
Remove all spaces and convert to lowercase for case-insensitive comparison.
Compare the first and last characters, then move towards the center until all characters have been compared.
If all characters match, the string is a palindrome.
If any characters do not match, the string is not a palindrome.
Q35. What is a friend function
A friend function is a non-member function that has access to the private and protected members of a class.
Declared inside the class but defined outside the class scope
Can access private and protected members of the class
Not a member of the class but has access to its private members
Used to allow external functions to access and modify private data of a class
Can be declared as a friend in another class
Q36. What is garbage collection in java
Garbage collection in Java is an automatic memory management process.
It frees up memory by removing objects that are no longer in use.
It is performed by the JVM in the background.
It helps prevent memory leaks and improves performance.
There are different types of garbage collectors in Java, such as Serial, Parallel, CMS, and G1.
Example: int[] arr = new int[1000]; arr = null; // Garbage collector will remove the array from memory
Q37. Addition and Deletion of a node in binary tree?
Addition and Deletion of a node in binary tree
For addition, traverse the tree to find the appropriate position and add the new node as a leaf
For deletion, find the node to be deleted and replace it with its successor or predecessor
In case of deletion, if the node has two children, find the inorder successor and replace it with the node to be deleted
Measure 4L using 3L and 5L cans .
Q39. Definition of atoi function of C
atoi function converts a string to an integer in C.
The function takes a string as input and returns an integer.
Leading white spaces are ignored.
If the string contains non-numeric characters, the function stops conversion and returns the converted value.
The function returns 0 if the input string is not a valid integer.
Example: atoi('123') returns 123.
Q40. A program to print star pattern
A program to print star pattern
Use nested loops to print the pattern
The outer loop controls the number of rows
The inner loop controls the number of stars to be printed in each row
Use print() or println() function to print the stars
Find the fastest 3 horses
Q42. What is refrential integrity
Refrential integrity ensures that relationships between tables in a database remain consistent.
It is a database concept that ensures that foreign key values in one table match the primary key values in another table.
It prevents orphaned records in a database.
It maintains data consistency and accuracy.
For example, if a customer record is deleted, all related orders for that customer should also be deleted.
It is enforced through constraints such as foreign key constraints.
Q43. 2.what is singleton pattern
Singleton pattern is a design pattern that restricts the instantiation of a class to one object.
Used when only one instance of a class is needed throughout the application
Provides a global point of access to the instance
Implemented using a private constructor and a static method to return the instance
Example: Database connection, Logger, Configuration settings
Q44. Real time examples of Data structures?
Data structures are used to organize and store data in a computer program.
Arrays - used to store a collection of elements of the same data type
Linked Lists - used to store a collection of elements where each element points to the next element
Stacks - used to store a collection of elements where the last element added is the first element removed
Queues - used to store a collection of elements where the first element added is the first element removed
Trees - used to store hiera...read more
Q45. Which programming languages do you know.
I know multiple programming languages including Java, Python, and C++.
Java
Python
C++
Q46. 3.what is static variable
Static variable is a variable that retains its value even after the function execution is completed.
Declared with static keyword
Memory is allocated once and shared among all instances of the class or function
Can be accessed without creating an object of the class
Q47. Triggers and their types
Triggers are database objects that are automatically executed in response to certain events.
Triggers can be used to enforce business rules, audit changes, or replicate data.
There are two types of triggers: DML triggers and DDL triggers.
DML triggers are fired in response to DML statements (INSERT, UPDATE, DELETE).
DDL triggers are fired in response to DDL statements (CREATE, ALTER, DROP).
Q48. Libraries and packages in python
Libraries and packages in Python are reusable collections of code that provide functionality to perform specific tasks.
Libraries and packages help in reducing the amount of code that needs to be written from scratch
Popular libraries in Python include NumPy for numerical computing, Pandas for data manipulation, and Matplotlib for data visualization
Packages can be installed using package managers like pip or conda
Q49. Run time polymorphism in C++
Run time polymorphism is the ability of a program to determine the object type at runtime and call the appropriate method.
It is achieved through virtual functions and dynamic binding.
Allows for more flexible and extensible code.
Example: a base class Animal with virtual function makeSound() and derived classes Dog and Cat that override makeSound().
At runtime, if an Animal pointer points to a Dog object, calling makeSound() will execute the Dog's implementation.
Q50. Five linux commands you know
Five commonly used Linux commands
ls - list directory contents
cd - change directory
mkdir - make directory
rm - remove files or directories
grep - search for a pattern in a file
Q51. Write a query for delete
Query for deleting data from a database table.
Use the DELETE statement followed by the table name.
Add a WHERE clause to specify the condition for deleting specific rows.
Be careful when deleting data as it cannot be recovered.
Example: DELETE FROM customers WHERE customer_id = 1234;
Q52. Explain time complexity
Time complexity refers to the amount of time taken by an algorithm to run as the input size increases.
It measures the efficiency of an algorithm.
It is usually expressed in Big O notation.
An algorithm with a lower time complexity is more efficient than one with a higher time complexity.
Q53. Count the number of vowels in a string
Count the number of vowels in a given string
Iterate through each character in the string and check if it is a vowel (a, e, i, o, u)
Maintain a count of vowels encountered
Return the total count of vowels in the string
Q54. Write a code for copy constructor
A copy constructor is a special type of constructor which creates a new object as a copy of an existing object.
Ensure the copy constructor has the same signature as the default constructor.
Allocate memory for the new object and copy the values from the existing object.
Handle deep copy vs shallow copy based on the object's data types.
Q55. What is a copy constructor
A copy constructor is a special type of constructor in object-oriented programming that creates a new object as a copy of an existing object.
Creates a new object by copying the attributes of an existing object
Used to initialize a new object with the values of an existing object
Helps in creating deep copies of objects to avoid shallow copy issues
Q56. Explain Oops in java?
Object-oriented programming paradigm in Java focusing on objects and classes.
OOPs stands for Object-Oriented Programming.
It focuses on creating objects that interact with each other through classes.
Key principles include Inheritance, Encapsulation, Polymorphism, and Abstraction.
Example: Class Car { String color; void start() { //code here } }
Example: Car myCar = new Car(); myCar.color = 'red'; myCar.start();
Q57. Collection framework in java?
Collection framework in Java provides a set of interfaces and classes to store and manipulate groups of objects.
Includes interfaces like List, Set, and Map
Classes like ArrayList, LinkedList, HashSet, and HashMap implement these interfaces
Provides methods for adding, removing, and accessing elements in collections
Q58. 1. CountingSubstring in array
Count the number of occurrences of a specific substring in an array of strings.
Iterate through each string in the array and use a function to count occurrences of the substring.
Use a loop to go through each character in the string and check for matches with the substring.
Keep a count variable to track the number of occurrences found.
Q59. joins and their use.
Joins are used in databases to combine rows from two or more tables based on a related column between them.
Joins are used to retrieve data from multiple tables based on a related column.
Common types of joins include 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 t...read more
Q60. Detect cycle in LinkedList
Detect cycle in LinkedList by using Floyd's Tortoise and Hare algorithm.
Use two pointers, slow and fast, to traverse the LinkedList.
If there is a cycle, the fast pointer will eventually meet the slow pointer.
Initialize slow and fast pointers at the head of the LinkedList.
Move slow pointer by one step and fast pointer by two steps.
If fast pointer reaches the end of the LinkedList, there is no cycle.
Top HR Questions asked in Andhra Pradesh State Skill Development Corporation
Interview Process at Andhra Pradesh State Skill Development Corporation
Top Associate Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month