Important

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

SQL

1. Print the employee’s name with highest salary and his/her department name
2. 2ND HEIGHEST SALARY
3. Print the employee’s name with highest salary and his/her department name
4. PRINT DETAILS OF EMPLOYEE EARNING MAX SALARY IN EACH DEPARTMENT
5. Select Nth Highest salary from employee table
6. Select TOP N salary from employee table
7. What are different types of JOINS in SQL
8. Delete duplicate rows from a table

9. Find all employees who are also managers

10. Write an SQL Query to find employee whose Salary is equal or greater than 10000.
11. Write an SQL Query to find name of employee whose name Start with ‘M
12. How to get 3 Max salaries from emp table?
13. How to fetch only common records from two tables emp and emp2?
14. How can I retrieve all records of emp1 those should not present in emp2
15. Count the total Sal, Dept no wise where more than 2 employees exist.
16. how will you filter duplicate records from table
17. Difference between UNION & UNION ALL
18. What are constraints in Database table?
19. How do you find duplicates in a particular column
Display all duplicates (with frequency) in the table.
Delete all duplicates in the table

20. Selection based on ‘GROUP BY’ clause with conditions


a. Fetch data from both tables.
b. if the primary key column or foreign key column had NULL values, can you fetch the data from the
same query?
c. Nested queries and, aggregate function queries. Find max salary, second max salary, Nth max salary.
d. Order by queries etc.
e. Write an SQL query to find out the departments where number of employees are greater than 100
Coding
 Check if a given string is palindrome or not
 Binary Search Code
 How will you swap two variables without any third variable and no arithmetic operators? (Use XOR)
 Write a code to find Fibonacci Series.
 Write a code for Push Operation in Stack.
 Minimum stack to implement a Queue and how do we do it?
 Infix to postfix
 Write a program to check whether the given number is Armstrong or not.
 Write a program to print the given number in a binary representation.
 implement a stack using arrays
 Code for Merge Sort
 Search In Rotated Sorted Array
 First non-repeating character in a String (Try to do it in one pass)
 Bubble Sort CODE
 Print all permutations of a string
 Count the number of vowels and consonants in a given string?
 Count the occurrence of a given character in a string?
 How do you find all duplicate characters in a string
 Reverse a string
 Check if two strings are anagrams of each other
 Prime Numbers from 1 to 2000
 Reverse a linked list
 How do you find all pairs of an integer array whose sum is equal to a given number?
 How do you find the largest and smallest number in an unsorted integer array
 Program for Merge Sort and Quick Sort
 Spiral Order Traversal of Matrix
 Find second largest number in array
 Count frequency of each character in a string
 Print this pattern
*
**
***
****
*****
 Find factorial of a number (1. Using recursion. 2. Using for loop)
 Print longest path from root to leaf in binary tree
 Print all root to leaf paths sum of binary tree
 How to search a missing number in an array that contains integers from 1 to 100?
 Swap two variables without using 3rd variable
 Length of linked list
 Check if given number is prime or not
 Given a number. Reverse it
 Find all factors of given number
 Briefly explain pre-order, in-order, and post-order with the help of code.
 You are given a list of n numbers, where n is huge and you must return the top k maximum elements.
 Check if 2 numbers are equal or not without any comparison operator(we use xor)
 Add 2 numbers without + operator
 Implement stack using the array
 implement a linked list, perform insertion from head & tail, deletion & replacement of a key, and print the nodes.
 Given a string as input, return a string based on the given example.
Eg: Input: aaaaabbbbccaa | Output: a5b4c2a2
 Given a matrix, sort the rows of the matrix based on the last column value.
Eg: given a 3X3 Matrix,
125
431
163
Output:
431
163
125
 Find the ceil of a given number in a sorted array
 Write code for finding the longest palindromic substring in a string
 You need to sort an array of numbers which sorting algorithm you will use and why.
 Given an array of 5 numbers and asked to show iterations of quick sort to sort the array.
 Given a linked list, which was sorted but had duplicate values in it, starting from the head node we have to remove all the duplicate nodes of the
linked list. We were not allowed to change the values in the list.
 Find second and third max or min elements in an array….
Coding Links
 https://www.geeksforgeeks.org/minimum-number-swaps-required-sort-array/
 https://www.geeksforgeeks.org/count-ways-reach-nth-stair/
 https://www.geeksforgeeks.org/count-pairs-with-given-sum/
 https://www.geeksforgeeks.org/write-a-c-function-to-print-the-middle-of-the-linked-list/
 https://www.geeksforgeeks.org/a-program-to-check-ief-a-binary-tree-is-bst-or-not/
 https://www.geeksforgeeks.org/sort-an-array-of-0s-1s-and-2s/
 https://www.geeksforgeeks.org/longest-palindrome-substring-set-1/
 https://practice.geeksforgeeks.org/problems/reverse-a-doubly-linked-list/1
 https://www.geeksforgeeks.org/ceiling-in-a-sorted-array/
 https://www.geeksforgeeks.org/dijkstras-shortest-path-algorithm-greedy-algo-7/
 https://www.geeksforgeeks.org/breadth-first-traversal-bfs-on-a-2d-array/
 https://www.geeksforgeeks.org/level-order-tree-traversal/
 https://www.geeksforgeeks.org/implement-stack-using-queue/-----
 https://codingrecipies.blogspot.com/2016/09/123.html----high level
 https://practice.geeksforgeeks.org/problems/palindrome-string0817/1
 https://practice.geeksforgeeks.org/problems/nth-fibonacci-number1335/1
 https://practice.geeksforgeeks.org/problems/swap-two-numbers3844/1
 https://practice.geeksforgeeks.org/problems/finding-middle-element-in-a-linked-list/1
 https://practice.geeksforgeeks.org/problems/non-repeating-element3958/1

 https://practice.geeksforgeeks.org/problems/diameter-of-binary-tree/1
 https://www.geeksforgeeks.org/print-longest-substring-without-repeating-characters/
 https://www.geeksforgeeks.org/write-a-c-program-to-calculate-powxn/
 https://practice.geeksforgeeks.org/problems/inorder-traversal-iterative/1/
 https://www.geeksforgeeks.org/c-program-find-largest-element-array
 https://www.geeksforgeeks.org/program-print-upto-100-without-using-loops/
 https://www.geeksforgeeks.org/find-two-rectangles-overlap/
 https://www.geeksforgeeks.org/two-water-jug-puzzle/
 https://www.geeksforgeeks.org/difference-between-drop-and-truncate-in-sql
 https://www.geeksforgeeks.org/difference-between-commit-and-rollback-in-sql/
 https://practice.geeksforgeeks.org/problems/the-magical-pond-puzzle
 https://www.geeksforgeeks.org/reverse-a-linked-list/
 https://www.geeksforgeeks.org/largest-sum-contiguous-subarray/
 https://www.geeksforgeeks.org/sort-an-array-of-0s-1s-and-2s/
 https://www.geeksforgeeks.org/russian-peasant-multiply-two-numbers-using-bitwise-operators/
 https://www.geeksforgeeks.org/delete-a-node-from-linked-list-without-head-pointer/
 https://www.geeksforgeeks.org/floor-square-root-without-using-sqrt-function-recursive/
 https://www.geeksforgeeks.org/print-all-triplets-with-given-sum/
 https://www.geeksforgeeks.org/remove-duplicates-from-a-given-string/
 https://www.geeksforgeeks.org/merge-two-sorted-arrays/
 https://www.geeksforgeeks.org/insert-a-node-at-a-specific-position-in-a-linked-list /
 https://www.geeksforgeeks.org/check-if-two-strings-are-same-or-not-without-using-library-functions/
 https://www.geeksforgeeks.org/sort-an-array-of-0s-1s-and-2s/
 https://www.geeksforgeeks.org/remove-nth-node-from-end-of-the-linked-list/
 https://www.geeksforgeeks.org/merge-two-sorted-linked-lists/
 https://www.geeksforgeeks.org/count-ways-reach-nth-stair-using-step-1-2-3/
VVVIMP
 https://www.codinginterview.com/oracle-interview-questions
 https://www.interviewkickstart.com/interview-questions/oracle-interview-questions
 https://practice.geeksforgeeks.org/explore?page=1&company[]=Oracle&sortBy=submissions
Puzzles
 https://www.geeksforgeeks.org/puzzle-1-how-to-measure-45-minutes-using-two-identical-wires/
 https://www.geeksforgeeks.org/puzzle-12-maximize-probability-of-white-ball/
 https://www.geeksforgeeks.org/puzzle-mislabeled-jars/
 A frog was at the bottom of a well that is 30 feet deep. It jumps 3 feet each day and falls back 2
feet each day. How many days will it take to reach the top?
 https://www.geeksforgeeks.org/puzzle-100-people-in-a-circle-with-gun-puzzle/
 A person had some chocolates. he distributed these chocolates among 25 children in such a way
that he gave one chocolate to the first child, 3 chocolates to the second child, 5 chocolates to the
third child, and so on till the 25th child. find the number of chocolates the person had. write a
mathematical property to support your answer.

Theory
 Advantages of Binary Search Tree and why do we want it to be balanced.
 Explain about pre-order, in-order, post-order traversal in a tree and write code for in-order, pre-order
and post-order.
 What all sorting algorithms do you know? Explain Time and space complexity of all those
algorithms? Tell me what is the best sorting algorithm among them and why.
 Which has better worst-case time complexity unordered map or map?
 Which data structure is best for search operation and which data structure is best for delete operation.
 Advantage of linked list over arrays.
 Advantage of trees over linked list and arrays.
 SORTING ALGORITHMS THEORY
Merge SORT
Quick SORT
Heap SORT
Insertion SORT
Selection SORT
Bubble SORT
 You need to pick the best sorting Algorithm and Why? (VVVIMP)
 Explain various searching algorithms and their time complexities
 what are trees, and BST, how is BST unbalanced, can we make it balanced
 What is an AVL tree and how do rotations work in AVL trees?
 Explain about BFS and DFS in graph
 You need to sort an array of numbers which sorting algorithm you will use and why.

You might also like