0% found this document useful (0 votes)
88 views13 pages

Professional Developer Technical Interview

The document discusses pointers versus references in C++. It notes that pointers can be reassigned and refer to NULL, while references cannot be reassigned after initialization and cannot refer to NULL. Both pointers and references occupy the same amount of memory as they are implemented as pointers under the hood. The document recommends using references as function parameters and pointers to implement algorithms and data structures.

Uploaded by

NohaM.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views13 pages

Professional Developer Technical Interview

The document discusses pointers versus references in C++. It notes that pointers can be reassigned and refer to NULL, while references cannot be reassigned after initialization and cannot refer to NULL. Both pointers and references occupy the same amount of memory as they are implemented as pointers under the hood. The document recommends using references as function parameters and pointers to implement algorithms and data structures.

Uploaded by

NohaM.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Professional Developer technical interview

Differences between pointer and reference

Summary from answers and links below:

1. A pointer can be re-assigned any number of times while a reference can not be reassigned after initialization.
2. A pointer can point to NULL while reference can never point to NULL
3. You can't take the address of a reference like you can with pointers
4. There's no "reference arithmetics" (but you can take the address of an object pointed by a reference and do pointer
arithmetics on it as in &obj + 5).
To clarify a misconception:

The C++ standard is very careful to avoid dictating how a compiler must implement references, but every C++ compiler
implements references as pointers. That is, a declaration such as:
int &ri = i;
allocates the same amount of storage as a pointer, and places the address of i into that storage.
So pointer and reference occupies same amount of memory
As a general rule,

 Use references in function parameters and return types to define attractive interfaces.
 Use pointers to implement algorithms and data structures.

Unified Modeling Language(UML)

UML stands for Unified Modeling Language.UML is used to manage large and complex systems.

With UML you can:

 Manage project complexity.


 create database schema.
 Produce reports.
Types of UML Diagrams:

1. Class Diagrams
2. Package Diagrams
3. Object Diagrams
4. Use Case Diagrams
5. Sequence Diagrams
6. Collaboration Diagrams
7. State chart Diagrams
8. Activity Diagrams
9. Component Diagrams
10. Deployment Diagrams
A static constructor is used to initialize any static data, or to perform a particular action that needs
performed once only. It is called automatically before the first instance is created or any static members
are referenced.

 Static constructors have the following properties:


 A static constructor does not take access modifiers or have parameters.
 A static constructor is called automatically to initialize the class before the first instance is
created or any static members are referenced.
 A static constructor cannot be called directly.
 The user has no control on when the static constructor is executed in the program

Database Questions:
1- What is the difference between primary key and foreign key?
 A primary key is a field or combination of fields that uniquely identify a record in a table, so
that an individual record can be located without confusion.
 A foreign key (sometimes called a referencing key) is a key used to link two tables together.
Typically you take the primary key field from one table and insert it into the other table where it
becomes a foreign key (it remains a primary key in the original table
2- What is Normalization 1NF, 2NF and 3NF (one, second and third normal form)?
 Eliminating redundant data
o 1NF: ‫ميكونش فيه اي عمود مركب يعني مكون من عمودين وميكونش قيم مختلفه‬
o 2NF: ‫جميع األعمدة العادية في الجدول تعتمد على المفتاح األساسي كامال وليس جزء منه‬
o 3NF: ‫ميكونش فيه عمود بيعتمد علي عمود تاني‬
3- Relationship types (one to one, one to many and many to many)?
 One-to-one: Both tables can have only one record on either side of the relationship. Each
primary key value relates to only one (or no) record in the related table. They're like spouses
—you may or may not be married, but if you are, both you and your spouse have only one
spouse. Most one-to-one relationships are forced by business rules and don't flow naturally
from the data. In the absence of such a rule, you can usually combine both tables into one
table without breaking any normalization rules.
 One-to-many: The primary key table contains only one record that relates to none, one, or
many records in the related table. This relationship is similar to the one between you and a
parent. You have only one mother, but your mother may have several children.
 Many-to-many: Each record in both tables can relate to any number of records (or no
records) in the other table. For instance, if you have several siblings, so do your siblings
(have many siblings). Many-to-many relationships require a third table
4- What are the advantages and disadvantages of Databases?

Advantages

 Reduced data redundancy


 Reduced updating errors and increased consistency
 Greater data integrity and independence from applications programs
 Improved data access to users through use of host and query languages
 Improved data security
 Reduced data entry, storage, and retrieval costs
 Facilitated development of new applications program

   Disadvantages

 Database systems are complex, difficult, and time-consuming to design


 Substantial hardware and software start-up costs
 Damage to database affects virtually all applications programs
 Extensive conversion costs in moving form a file-based system to a database system
 Initial training required for all programmers and users
5- Examples of Databases management systems ( Oracle, Microsoft SQL Server, DB2, MySQL)
6- What is RDBMS (Relational database management system)?
 RDBMS stands for Relational Database Management System. RDBMS data is structured in
database tables, fields and records. Each RDBMS table consists of database table rows. Each
database table row consists of one or more database table fields. 
 RDBMS store the data into collection of tables, which might be related by common fields
(database table columns). RDBMS also provide relational operators to manipulate the data
stored into the database tables. Most RDBMS use SQL as database query language.
7- What is an Entity?

An Entity is a person, place, thing or concept about which data can be collected. Examples
include EMPLOYEE, HOUSE, CAR

8- What is Weak Entity?


 A Strong Entity is one that exists on its own, independent of other entities.
 A Weak Entity is one whose existence depends on another entity.
9- What are the different types of attributes?
 Simple and Composite Attribute
 Single Valued and Multi Valued attribute
 Stored and Derived Attributes
 Complex Attribute

SQL Questions:
1- What is SQL (Structured Query language)?
2- What is the difference between Where and Having?
‫ تستخدم مع الحقول العادية التي من قاعدة البيانات‬where ‫ال‬ 
‫ ولكن على النتائج‬Select ‫ فهي تستخدم مع الحقول التجميعية فهي تعمل نفس عمل ال‬having ‫ام ال‬ 
Group By ‫ يعني أن وجودها مرهون بوجود ال‬Group By ‫التي ظهرت من جملة ال‬
3- What is the order of Select statement clauses (Select, From, Where)?
4- What is the different between Delete and Truncate?
o Truncate: fast and cannot undo
o Delete: can undo this delete
5- Having and Group By, Which one is mandatory or prerequisite?
6- Define View and its types?
7- Define Index and its types?
8- Define Subquery and its types?
9- What is Join and the different types of Join?
10- What is the difference between DML, DDL and DCL?
11- What is the difference between Group by and Order By?
12- What is the difference between Delete and Drop?
13- After creating Database table can you add additional column?
14- What is the difference between Function and Stored Procedure?
15- What are the different types of Constraints?

Object Oriented
1.       What is OOPS?
OOPS is abbreviated as Object Oriented Programming system in which programs are considered
as a collection of objects. Each object is nothing but an instance of a class.

2.       Write basic concepts of OOPS?


Following are the concepts of OOPS and are as follows:.
1. Abstraction.
2. Encapsulation.
3. Inheritance.
4. Polymorphism.

3.       What is a class?
A class is simply a representation of a type of object. It is the blueprint/ plan/ template that
describe the details of an object.

4.       What is an object?
Object is termed as an instance of a class, and it has its own state, behavior and identity.

5.       What is Encapsulation?
Encapsulation is an attribute of an object, and it contains all data which is hidden. That hidden
data can be restricted to the members of that class.
Levels are Public, Protected, Private, Internal and Protected Internal.

6.       What is Polymorphism?
Polymorphism is nothing but assigning behavior or value in a subclass to something that was
already declared in the main class. Simply, polymorphism takes more than one form.

7.       What is Inheritance?
Inheritance is a concept where one class shares the structure and behavior defined in another
class. If inheritance applied on one class is called Single Inheritance, and if it depends on
multiple classes, then it is called multiple Inheritances.

8.       What are manipulators?


Manipulators are the functions which can be used in conjunction with the insertion (<<) and
extraction (>>) operators on an object. Examples are endl and setw.

9.       Define a constructor?
Constructor is a method used to initialize the state of an object, and it gets invoked at the time
of object creation. Rules for constructor are:.
 Constructor Name should be same as class name.
 Constructor must have no return type.

10.   Define Destructor?
Destructor is a method which is automatically called when the object is made of scope or
destroyed. Destructor name is also same as class name but with the tilde symbol before the
name.

11.   What is Inline function?


Inline function is a technique used by the compilers and instructs to insert complete body of the
function wherever that function is used in the program source code.

12.   What is a virtual function?


Virtual function is a member function of class and its functionality can be overridden in its
derived class. This function can be implemented by using a keyword called virtual, and it can be
given during function declaration.
Virtual function can be achieved in C++, and it can be achieved in C Language by using function
pointers or pointers to function.

13.   What is friend function?


Friend function is a friend of a class that is allowed to access to Public, private or protected data
in that same class. If the function is defined outside the class cannot access such information.
Friend can be declared anywhere in the class declaration, and it cannot be affected by access
control keywords like private, public or protected.

14.   What is function overloading?


Function overloading is defined as a normal function, but it has the ability to perform different
tasks. It allows creation of several methods with the same name which differ from each other by
type of input and output of the function.
Example
void add(int& a, int& b);
void add(double& a, double& b);
void add(struct bob& a, struct bob& b);

15.   What is operator overloading?


Operator overloading is a function where different operators are applied and depends on the
arguments. Operator,-,* can be used to pass through the function , and it has their own
precedence to execute.
Example:
class complex {
double real, imag;
public:
complex(double r, double i) :
real(r), imag(i) {}
complex operator+(complex a, complex b);
complex operator*(complex a, complex b);
complex& operator=(complex a, complex b);
}
a=1.2, b=6

16.   What is an abstract class?


An abstract class is a class which cannot be instantiated. Creation of an object is not possible
withabstract class , but it can be inherited. An abstract class can contain only Abstract method.

17.   What is a ternary operator?


Ternary operator is said to be an operator which takes three arguments. Arguments and results
are of different data types , and it is depends on the function. Ternary operator is also called
asconditional operator.

18.   What is the use of finalize method?


Finalize method helps to perform cleanup operations on the resources which are not currently
used. Finalize method is protected , and it is accessible only through this class or by a derived
class.

19.   What are different types of arguments?


A parameter is a variable used during the declaration of the function or subroutine and
arguments are passed to the function , and it should match with the parameter defined. There
are two types of Arguments.
 Call by Value – Value passed will get modified only inside the function , and it returns the same
value whatever it is passed it into the function.
 Call by Reference – Value passed will get modified in both inside and outside the functions and it
returns the same or different value.
 
20.   What is super keyword?
Super keyword is used to invoke overridden method which overrides one of its super class
methods. This keyword allows to access overridden methods and also to access hidden
members of the super class.
It also forwards a call from a constructor to a constructor in the super class.
21.   What is method overriding?
Method overriding is a feature that allows sub class to provide implementation of a method that
is already defined in the main class. This will overrides the implementation in the super class by
providing the same method name, same parameter and same return type.

22.   What is an interface?
An interface is a collection of abstract method. If the class implements an inheritance, and
then thereby inherits all the abstract methods of an interface.

23.   What is exception handling?


Exception is an event that occurs during the execution of a program. Exceptions can be of any
type – Run time exception, Error exceptions. Those exceptions are handled properly through
exception handling mechanism like try, catch and throw keywords.

24.   What are tokens?


Token is recognized by a compiler and it cannot be broken down into component elements.
Keywords, identifiers, constants, string literals and operators are examples of tokens.
Even punctuation characters are also considered as tokens – Brackets, Commas, Braces and
Parentheses.

25.   Difference between overloading and overriding?


Overloading is static binding whereas Overriding is dynamic binding. Overloading is nothing but
the same method with different arguments, and it may or may not return the same value in the
same class itself.
Overriding is the same method names with same arguments and return types associates with
the class and its child class.

26.   Difference between class and an object?


An object is an instance of a class. Objects hold any information , but classes don’t have any
information. Definition of properties and functions can be done at class and can be used by the
object.
Class can have sub-classes, and an object doesn’t have sub-objects.

27.   What is an abstraction?
Abstraction is a good feature of OOPS , and it shows only the necessary details to the client of an
object. Means, it shows only necessary details for an object, not the inner details of an object.
Example – When you want to switch On television, it not necessary to show all the functions of
TV. Whatever is required to switch on TV will be showed by using abstract class.

28.   What are access modifiers?


Access modifiers determine the scope of the method or variables that can be accessed from
other various objects or classes. There are 5 types of access modifiers , and they are as follows:.
  Private.
 Protected.
 Public.
 Friend.
 Protected Friend.

29.   What is sealed modifiers?


Sealed modifiers are the access modifiers where it cannot be inherited by the methods. Sealed
modifiers can also be applied to properties, events and methods. This modifier cannot be
applied to static members.
 
30.   How can we call the base method without creating an instance?
Yes, it is possible to call the base method without creating an instance. And that method should
be,.
Static method.
Doing inheritance from that class.-Use Base Keyword from derived class.

31.   What is the difference between new and override?


The new modifier instructs the compiler to use the new implementation instead of the base
class function. Whereas, Override modifier helps to override the base class function.

32.   What are the various types of constructors?


There are three various types of constructors , and they are as follows:.
-          Default Constructor – With no parameters.
-          Parametric Constructor – With Parameters. Create a new instance of a class and also
passing arguments simultaneously.
-          Copy Constructor – Which creates a new object as a copy of an existing object.

33.   What is early and late binding?


Early binding refers to assignment of values to variables during design time whereas late binding
refers to assignment of values to variables during run time.

34.   What is ‘this’ pointer?


THIS pointer refers to the current object of a class. THIS keyword is used as a pointer which
differentiates between the current object with the global object. Basically, it refers to the
current object.

35.   What is the difference between structure and a class?


Structure default access type is public , but class access type is private. A structure is used for
grouping data whereas class can be used for grouping data and methods. Structures are
exclusively used for data and it doesn’t require strict validation , but classes are used to
encapsulates and inherit data which requires strict validation.

36.   What is the default access modifier in a class?


The default access modifier of a class is Private by default.

37.   What is pure virtual function?


A pure virtual function is a function which can be overridden in the derived class but cannot be
defined. A virtual function can be declared as Pure by using the operator =0.
Example -.
Virtual void function1() // Virtual, Not pure
Virtual void function2() = 0 //Pure virtual

38.   What are all the operators that cannot be overloaded?


Following are the operators that cannot be overloaded -.
1. Scope Resolution (:: )
2. Member Selection (.)
3. Member selection through a pointer to function (.*)
 
39.   What is dynamic or run time polymorphism?
Dynamic or Run time polymorphism is also known as method overriding in which call to an
overridden function is resolved during run time, not at the compile time. It means having two or
more methods with the same name, same signature but with different implementation.

40.   Do we require parameter for constructors?


No, we do not require parameter for constructors.

41.   What is a copy constructor?


This is a special constructor for creating a new object as a copy of an existing object. There will
be always only on copy constructor that can be either defined by the user or the system.

42.   What does the keyword virtual represented in the method definition?


It means, we can override the method.

43.   Whether static method can use non static members?


False.

44.   What are base class, sub class and super class?


Base class is the most generalized class , and it is said to be a root class.
Sub class is a class that inherits from one or more base classes.
Super class is the parent class from which another class inherits.

45.   What is static and dynamic binding?


Binding is nothing but the association of a name with the class. Static binding is a binding in
which name can be associated with the class during compilation time , and it is also called as
early Binding.
Dynamic binding is a binding in which name can be associated with the class during execution
time , and it is also called as Late Binding.

46.   How many instances can be created for an abstract class?


Zero instances will be created for an abstract class.

47.   Which keyword can be used for overloading?


Operator keyword is used for overloading.
48.   What is the default access specifier in a class definition?
Private access specifier is used in a class definition.

49.   Which OOPS concept is used as reuse mechanism?


Inheritance is the OOPS concept that can be used as reuse mechanism.

50.   Which OOPS concept exposes only necessary information to the calling functions?
Data Hiding / Abstraction

Operating System Interview Questions and Answers

1. What's OPERATING SYSTEM?


An Operating System, or OS, is a software program that enables the computer
hardware to communicate and operate with the computer software. Without a
computer Operating System, a computer would be useless.

2. OPERATING SYSTEM TYPES


As computers have progressed and developed so have the types of operating
systems. Below is a basic list of the different types of operating systems and a
few examples of Operating Systems that fall into each of the categories. Many
computer Operating Systems will fall into more than one of the below
categories.

GUI - Short for Graphical User Interface, a GUI Operating System contains
graphics and icons and is commonly navigated by using a computer mouse.
See our GUI dictionary definition for a complete definition. Below are some
examples of GUI Operating Systems.

System 7.x
Windows 98
Windows CE

Multi-user - A multi-user Operating System allows for multiple users to use


the same computer at the same time and/or different times. See our multi-user
dictionary definition for a complete definition for a complete definition.
Below are some examples of multi-user Operating Systems.

Linux
Unix
Windows 2000
Windows XP
Mac OS X

Multiprocessing - An Operating System capable of supporting and utilizing


more than one computer processor. Below are some examples of
multiprocessing Operating Systems.
Linux
Unix
Windows 2000
Windows XP
Mac OS X

Multitasking - An Operating system that is capable of allowing multiple


software processes to run at the same time. Below are some examples of
multitasking Operating Systems.

Unix
Windows 2000
Windows XP
Mac OS X

Multithreading - Operating systems that allow different parts of a software


program to run concurrently. Operating systems that would fall into this
category are:

Linux
Unix
Windows 2000
Windows XP
Mac OS X

3. What are the basic functions of an operating system?

Operating system controls and coordinates the use of the hardware among the
various applications programs for various uses. Operating system acts as resource
allocator and manager. Since there are many possibly conflicting requests for
resources the operating system must decide which requests are allocated resources
to operating the computer system efficiently and fairly. Also operating system is
control program which controls the user programs to prevent errors and improper
use of the computer. It is especially concerned with the operation and control of
I/O devices.

4-What is CPU Scheduler?


- Selects from among the processes in memory that are ready to execute, and
allocates the CPU to one of them. CPU scheduling decisions may take place when
a process: 1.Switches from running to waiting state. 2.Switches from running to
ready state. 3.Switches from waiting to ready. 4.Terminates. Scheduling under 1
and 4 is non-preemptive. All other scheduling is preemptive.
Data Structure Interview Question and Answers :

1- What is data structure?  


The logical and mathematical model of a particular organization of data is called data
structure.
There are two types of data structure

1. Linear
2. Nonlinear

////////////////////////////////////////////////////////////

2- What is a linked list?  

A linked list is a linear collection of data elements, called nodes, where the linear order is given
by pointers. Each node has two parts first part contain the information of the element second part
contains the address of the next node in the list.

///////////////////////////////////////////////////////////////

3- What is a queue?   A queue is an ordered collection of items from which items may be deleted
at one end (front end) and items inserted at the other end (rear end). It obeys FIFO rule there is
no limit to the number of elements a queue contains.

4- What are the goals of Data Structure?  

It must rich enough in structure to reflect the actual relationship of data in real world. The
structure should be simple enough for efficient processing of data.

/////////////////////////////////////////////////////////////////////////////

5- What is the difference between a Stack and an Array?  

Stack

 Stack is a dynamic object whose size is constantly changing as items are pushed and
popped .
 Stack may contain different data types.
 Stack is declared as a structure containing an array to hold the element of the stack, and
an integer to indicate the current stack top within the array.
 Stack is a ordered collection of items.
Array

 Array is an ordered collection of items.


 Array is a static object.
 It contains same data types.
 Array can be home of a stack i.e. array can be declared large enough for maximum size
of the stack.

//////////////////////////////////////////////////////////////////////////

6-what is binary tree?  

A binary tree is a tree data structure in which each node has at most two child nodes, usually
distinguished as left and right.

‫”" لو انت خريج تجاره عربى وسألك فى االنترفيو المصطلحات انجلش قوله انا كنت تجاره عربى ومادرستش الممصطلحات] دى انجلش‬

Good Refernces

1- http://www.a2zinterviews.com/
2- http://www.w3schools.com/sql/default.asp
3- http://www.erptips.com/

Good Luck for all of you Guys 

‫الحمد هلل رب العالمين‬

‫بالتوفيق ليكم جمعيا باذن هللا‬

You might also like