21 Apr 2013

Important C++ Exam and Interview Questions.

Important C++ Exam and Interview Questions.

  1. Why main function is special in C++ ?

  2. What is run-time error, logical error and syntax error?

  3. What is the role of #include directive in C++?

  4. What is compiler and linker?

  5. Why is char often treated as integer data type in C++ ?

  6. What is type conversion in C++ ?

  7. What is type castin>g in C++ ?

  8. What is the effect of absence of break in switch case in C++ ?

  9. In control structure switch-case what is the purpose of default in C++ ?

  10. What is the difference between while and do-while loop?

  11. What is the difference between call by value and call by reference in a user defined function in C++?

  12. What is preprocessor directive?

  13. What is the difference between local variable and global variable?

  14. What is the role of #define in C++?

  15. What are the major differences between Object Oriented Programming        and Procedural Programming?

  16. What are the basic concepts of OOP?

  17. How is OOP implement in C++?

  18. What is abstract class?

  19. What is concrete class?

  20. What is a constructor? What are its features?

  21. What does a destructor do?

  22. Define inheritance.

  23. Define Base class and derived class.

  24. What are the different forms of inheritance in C++ ?

  25. What is virtual base class in C++ ? What is its significance?

  26. How are binary files different from text files in C++?

  27. What is a stream? Name the streams generally used for file I/O.

  28. Difference between get() and getline().

  29. Difference between ios::app and ios::out.

  30. What is pointer?

  31. What is pointer arithmetic ? How is it performed?

  32. Differentiate between static and dynamic allocation of memory.

  33. What do you understand by memory leaks? How can memory leaks be avoided?

  34. What is this pointer? What is its Significance?

  35. What is the full form of LIFO? Give an example of LIFO list?

  36. What is the full form of FIFO? What is FIFO list technically called?

  37. What are the preconditions for Binary search to be performed on a single dimensional array?

Important Oracle Queries that you might Face in an Interview......

Important Oracle Queries that you might Face in an Interview......

Q.What is the purpose of database links in Oracle?

Database links are created to establish communication between different databases or different environments such as development, test and production of the same database. The database links are usually designed to be read-only to access other database information . They are also useful when you want to copy production data into test environment for testing.

Q. What is Oracle's data dictionary used for?

Data dictionary in Oracle contains information about all database objects such as tables, triggers, stored procedures, functions, indexes, constraints, views, users, roles, monitoring information, etc.

Q. Which data dictionary objects are used to retrieve the information about the following objects from a given schema?
1) tables
2) views
3) triggers
4) procedures
5) constraints
6) all of the above mentioned objects

The objects used are:
a> user_tables or tabs
b> user_views
c> user_triggers
d> user_procedures
e> user_constraints
f> user_objects


fferent SQL queries in the same PL/SQL program vs. design time declared explicit cursors with an association to only one query.


Q. You want to view top 50 rows from Oracle table. How do I this?

Use ROWNUM, the pseudo column in where clause as follows:
Where rownum < 51

After complete execution of query and before displaying output of SQL query to the user oracle internally assigns sequential numbers to each row in the output. These numbers are held in the hidden column or pseudo column that is a ROWNUM column. Now it is so simple to apply the above logical condition, as you would have done to any other column of the table.

Q. How do you reference column values in BEFORE and AFTER insert and delete triggers?

The BEFORE and AFTER insert triggers can reference column values by new collection using keyword “:new.column name”. The before and after delete triggers can reference column values by old collection using keyword “:old. column name”.

Q. Can you change the inserted value in one of the columns in AFTER insert trigger code?

This is not possible as the column values supplied by the insert SQL query are already inserted into the table. If you try to assign new value to the column in AFTER insert trigger code then oracle error would be raised. To alter any values supplied by insert SQL query create BEFORE insert trigger.

Q. Explain use of SYSDATE and USER keywords.

SYSDATE is a pseudo column and refers to the current server system date. USER is a pseudo column and refers to the current user logged onto the oracle session. These values come handy when you want to monitor changes happening to the table.



Q. What is the difference between explicit cursor and implicit cursor?

When a single insert, delete or update statement is executed within PL/SQL program then oracle creates an implicit cursor for the same, executes the statement, and closes the cursor. You can check the result of execution using SQL%ROWCOUNT function.

Explicit cursors are created programmatically. The cursor type variable is declared and associated with SQL query. The program then opens a cursor, fetches column information into variables or record type variable, and closes cursor after all records are fetched. To check whether cursor is open or not use function SQL%ISOPEN and to check whether there are any records to be fetched from the cursor use function SQL%FOUND.


Q. Why does a query in Oracle run faster when ROWID is used as a part of the where clause?

ROWID is the logical address of a row - it is not a physical column. It is composed of file number, data block number and row number within data block. Therefore I/O time is minimized retrieving the row, resulting in a faster query.

Q. What type of exception will be raised in the following situations:

a> select..into statement returns more than one row.

b> select..into statement does not return any row.

c> insert statement inserts a duplicate record.

The errors returned are:
a> TOO_MANY_ROWS

b> NO_DATA_FOUND

c> DUP_VAL_ON_INDEX

18 Apr 2013

Using Gotoxy(position) and text color in Dev c++ Editor....

Using Gotoxy(position) and text color in Dev c++ Editor....


#include"stdio.h"
#include"iostream"
#include"conio.h"
#include"windows.h"

using namespace std;
HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE);
COORD CursorPosition;

void gotoxy(int x, int y)
{
CursorPosition.X = x;
CursorPosition.Y = y;
SetConsoleCursorPosition(console,CursorPosition);
}

void settextcolor(int color)
{
    HANDLE h;
    h=GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(h,color); 
}
int main()
{
gotoxy(15,5);
settextcolor(6);
cout<<"This Blog is AwesomE.";
return 0;
}

Comments

© 2013-2016 ITTechnocrates. All rights resevered. Developed by Bhavya Mehta