Question How do you test a vending machine Answer One time I was asked this question over the phone. In a site interview I was asked how to test a calculator. In another site interview I was also asked how to test an elevator system. All these none software related questions are similar in the
Problem Given the following sequence of integer numbers: Write a recursive function that receives the index of a given number in the sequence above and returns the corresponding sequence number for example if index = 2 the function should return 2, if the index = 5 the function should return 8 and so on Solution
Problem Given the following sequence of integer numbers: Write a function that receives the index of a given number in the sequence above and returns the corresponding sequence number for example if index = 2 the function should return 2, if the index = 5 the function should return 8 and so on Solution The
What is Recursion: Please Bear with me This is going to be a short and technical article so please bear with my bad English and writing style. Language is also a mean of communication and sometimes it fails to convey understanding so I will brain dump the concept in plain English to the best of
Question What is the difference between delete table and truncate table operation Answer Delete table operation deletes all rows in the table. The deletion of rows is logged in the transaction log. On the other hand truncate table operation similarly deletes all rows in the table but it does not log the deletion of rows
Question Suggest few areas to inspect to improve the performance of a slow query Answer Here are few areas to check: Tables have no indexes. Database indexes improve query performance dramatically on the expense of slow writes and extra space Tables are scanned in full. Scanning huge tables degrades performance Table statistics are not updated.
Question What happens if you create an index on each column of a database table Answer Query optimizer can choose from all existing indexes and come up with an efficient execution plan which in turn improves performance. On the other hand data modification operations such as insert, update and delete will become slow because indexes
Question What is the difference between clustered and non clustered database index Answer A database index is a special data structure (tree, hash, etc) that improves the performance of data retrieval. There is nothing free so the performance gain comes with slower writes and increased storage space. Database index architecture can be classified into clustered
Question What is the difference between WHERE and HAVING clauses. Answer The WHERE clause restricts which rows are returned while the HAVING clause operates on groups of rows. HAVING is always used with GROUP BY and must have a function it restricts. The rule says if a condition refers to an aggregate function put that
Question What is a database view. Mention few database sql views advantages Answer A view is a virtual table (not part of the physical schema) composed from the result set of a stored query. Views contain dynamic content. This means if you modify the physical tables from which the view is constructed then the data shown in subsequent invocations of the