### programming

# database interview questions

## Database interview questions

**Basic database administrator interview questions** which every database admin should know their answers .

They are listed below:

- How to find the first non-repeated character in a String?
- How to print a tree by levels?
- How to reverse a String iteratively and recursively?
- How to determine if 2 Strings are anagrams?
- How to implement a binary min heap. Turn it into a binary max heap?
- How to implement a queue using 2 stacks?
- How to implement a linked list?
- How to find the Nth element in a linked list?
- How to remove the Nth element of a linked list?
- How to check if a linked list has cycles?
- How to check whether a link list is a palindrome?
- How to implement bubble sort?
- How to reverse a linked list iteratively and recursively?
- What is the database on which Clipper is a based?
- How to implement selection sort?
- How to implement square root function?
- What is the format used for real numbers by Clipper?
- How to check if String is a palindrome?
- How to implement an exponent function (bonus: now try in log(n) time)
- Given a function rand5() that returns a random int between 0 and 5, implement rand7()
- How to write a multiply function that multiples 2 integers without using *?
- How to check if a String is composed of all unique characters?
- How to determine if a String is an int or a double?
- How is file locking handled in Clipper?
- How to write a function that determines if a tree is a BST?
- Given a 2D array of 1s and 0s, count the number of “islands of 1s” (e.g. groups of connecting 1s)
- How to find the smallest element in a BST?
- How to implement insertion sort?
- How to print all permutations of a String?
- How to implement merge sort?
- How to find the shortest palindrome in a String?
- How to implement quick sort?
- How to implement binary search in a rotated array (ex. {5,6,7,8,1,2,3})?
- How to find the common elements of 2 int arrays?
- How to implement binary search of a sorted array of integers?
- How to use dynamic programming to find the first X prime numbers?
- How to write a function that prints out the binary form of an int?
- How to implement parseInt?
- What are the features of Clipper VO?
- How to find the most frequent integer in an array?
- How to implement a BST with insert and delete functions?
- How can a user have multiple access to a clipper database in two different operating systems?
- How to write fibbonaci iteratively and recursively?
- How to find pairs in an integer array whose sum is equal to 16?
- If you are given a single-line text String and a maximum width value, write the function ‘String justify(String text, int maxWidth)’ that formats the input text using full-justification, i.e., extra spaces on each line are equally distributed between the words; the first word on each line is flushed left and the last word on each line is flushed right?
- What are the features of Clipper that makes it easy to create multi-user applications?

What are the steps for connecting Clipper database from PHP script? - Given 2 integer arrays, determine of the 2nd array is a rotated version of the 1st array. Ex. Original Array A={1,2,3,5,6,7,8} Rotated Array B={5,6,7,8,1,2,3}
- How to Find the only element in an array that only occurs once.
- How to Print a tree using BFS and DFS?
- What are the tools or process used for running Clipper on UNIX systems?
- How to Find the 2nd largest number in a BST?
- How to Given a binary tree which is a sum tree (child nodes add to parent), write an algorithm to determine whether the tree is a valid sum tree?
- How to Find the distance between 2 nodes in a BST and a normal binary tree?
- How to Implement a stack with push and pop functions?
- What is the query to change the rows into column and columns into row?
- What is a waterfall testing?
- How to exp, imp from higher version to lower version?
- How to Print the coordinates of every node in a binary tree, where root is 0,0?
- If given a binary tree which is a sum tree, write an algorithm to determine whether the tree is a valid sum tree?
- How to Find the max distance between 2 nodes in a BST?
- How to Construct a BST given the pre-order and in-order traversal Strings?
- How to Implement a queue with queue and dequeue functions?
- What is mean by fractured block in terms of manual hot backup?
- How to Find the minimum element in a stack in O(1) time?
- What are the single and multi-user commands supported by Clipper?
- How will you find-out if your database is using recovery catalog or not?
- What are the operating systems under which Clipper can operate?
- How to write a function that sorts a stack?
- How to schedule the backup with cron at linux ?
- What are the initial steps to follow a database backup and job scheduling ?
**What is DBMS?**- What are the disadvantage in File Processing System?
- Describe the three levels of data abstraction?
- What are the advantages of DBMS?
**What is indexing in database?**(simple question)