UST Global Technical Interview Questions and Answers

|   71903

UST Global Technical interview Questions with Answer

Technical interview Section Basic questions about C,C++ basic .It include following common interview Questions

Your favorite subject?

your favorite programming language?

Why did you Select particular subject?

What is C language?


The C programming language is a standardized programming language developed in the early 1970s by Ken Thompson and Dennis Ritchie for use on the UNIX operating system. It has since spread to many other operating systems, and is one of the most widely used programming languages. C is prized for its efficiency, and is the most popular programming language for writing system software, though it is also used for writing applications. ... 

Can you Mention some Application of C/C++?

Google-Some of the Google applications are also written in C++, including Google file system and Google Chromium.

Symbian OS- is also developed using C++. This is one of the most widespread OS’s for cellular phones. 

Apple – OS X -Few parts of apple OS X are written in C++ programming language. Also few application for iPod are written in C++.

Microsoft-Most of the big applications like Windows 95, 98, Me, 200 and XP are also written in C++. Also Microsoft Office, Internet Explorer and Visual Studio are written in Visual C++.

What are the different storage classes in C ?
There are four types of storage classes in C. They are extern, register, auto and static

What is an object?
Object is a software bundle of variables and related methods. Objects have state and behavior

What is a class?
Class is a user-defined data type in C++. It can be created to solve a particular kind of problem. After creation the user need not know the specifics of the working of a class.

1. What is a modifier?

A modifier, also called a modifying function is a member function that changes the value of at least one data member. In other words, an operation that modifies the state of an object. Modifiers are also 
known as ‘mutators’.

5. Define namespace.

It is a feature in C++ to minimize name collisions in the global name space. This namespace keyword assigns a distinct name to a library that allows other libraries to use the same identifier names without creating any name collisions. Furthermore, the compiler uses the namespace signature for differentiating the definitions.
What is data structure?

A data structure is a way of organizing data that considers not only the items stored, but also their relationship to each other. Advance knowledge about the relationship between data items allows designing of efficient algorithms for the manipulation of data

Can you list out the areas in which data structures are applied extensively?

Compiler Design,

Operating System,

Database Management System,

Statistical analysis package,

Numerical Analysis,

Graphics,

Artificial Intelligence,

Simulation


What is the difference between C and C++?

C follows the procedural programming paradigm 

C++ is a multi-paradigm language (procedural as well as object oriented)

In C language focus on procedure and steps.

C++ focuses on the data rather than the process

In C data hiding and data security is not possible. 

In C++Data hiding and data security is present.

C uses Top-Down approach

C++ uses Bottom-Up approach

C is a function driven programming language

C++ is a object driven programming language

C does not support overloading concept

C++ supports overloading concepts like operator overloading and function overloading

C does not support namespaces concept

C++ supports Namespaces concept.

C not support exception handling

C++ supports Exception Handling

C is structured programming language

C++ is object oriented programming language.

C does not support inheritance, reusability, polymorphism, data abstraction

C++ supports inheritance, reusability, polymorphism, data abstraction.

C language only support Early binding

C++ supports both Early and Late binding

C uses standard input, output functions like scanf and printf.

C++ uses input function cin and output function is cout.


What is the advantage of OOP?

**Simplicity

**modularity:

**modifiability

**extensibility

**maintainability

**re-usability

simplicity: software objects model real world objects, so the complexity is reduced and the program structure is very clear;

modularity: each object forms a separate entity whose internal workings are decoupled from
other parts of the system;

modifiability: it is easy to make minor changes in the data representation or the procedures in an OO program. Changes inside a class do not affect any other part of a program, since the only public interface that the external world has to a class is through the use of methods;

extensibility: adding new features or responding to changing operating environments can be solved by introducing a few new objects and modifying some existing ones;

maintainability: objects can be maintained separately, making locating and fixing problems
easier;

re-usability: objects can be reused in different programs.

How do you do dynamic memory allocation in C applications? 

In C, malloc, calloc and realloc are used to allocate memory dynamically. In C++, new(),is usually used to allocate objects.

List advantages and disadvantages of dynamic memory allocation vs. static memory allocation.?

Advantages:

Memory is allocated on an as-needed basis. This helps remove the inefficiencies inherent to static memory allocation (when the amount of memory needed is not known at compile time and one has to make a guess).

Disadvantages:
Dynamic memory allocation is slower than static memory allocation. This is because dynamic memory allocation happens in the heap area.
Dynamic memory needs to be carefully deleted after use. They are created in non-contiguous area of memory segment.
Dynamic memory allocation causes contention between threads, so it degrades performance when it happens in a thread.
Memory fragmentation.

What is Java?
Java is an object-oriented programming language developed initially by James Gosling and colleagues at Sun Microsystems. The language, initially called Oak (named after the oak trees outside Gosling's office),was intended to replace C++, although the feature set better resembles that of Objective C. Java should not be confused with JavaScript, which shares only the name and a similar C-like syntax. Sun Microsystems currently maintains and updates Java regularly. 

Can you have virtual functions in Java?

Yes, all functions in Java are virtual by default. This is actually a pseudo trick question because the word "virtual" is not part of the naming convention in Java (as it is in C++, C-sharp and VB.NET),so this 
would be a foreign concept for someone who has only coded in Java. Virtual functions or virtual methods are functions or methods that will be redefined in derived classes. 
What is a transient variable in Java?

A transient variable is a variable that may not be serialized. If you don't want some field to be serialized, you can mark that field transient or static.

What is thread?
A thread is an independent path of execution in a system.

What is multi-threading?
Multi-threading means various threads that run in a system. 

What is a dangling pointer?

pointers that do not point to a valid object of the appropriate type. Dangling pointers arise when an object is deleted or deallocated, without modifying the value of the pointer, so that the pointer still points to the memory location of the deallocated memory. As the system may reallocate the previously freed memory to another process, if the original program then dereferences the (now) dangling pointer, unpredictable behavior may result, as the memory may now contain completely different data. This is especially the case if the program writes data to memory pointed by a dangling pointer, as silent corruption of unrelated data may result, leading to subtle bugs that can be extremely difficult to find, or cause segmentation faults (*NIX) or general protection faults (Windows). 

What are the advantages and disadvantages of B-star trees over Binary trees.?

The major difference between B-tree and binary tres is that B-tree is a external data structure and binary tree is a main memory data structure. The computational complexity of binary tree is counted by the number of comparison operations at each node, while the computational complexity of B-tree is determined by the disk I/O, that is, the number of node that will be loaded from disk to main memory. The comparision of the different values in one node is not counted.

What will be printed as the result of the operation below:
main()
{
int x=20,y=35;
x=y++ + x++;
y= ++y + ++x;
printf(“%d%dn”,x,y);
}
Answer : 5794

What will be printed as the result of the operation below:
main()
{
int x=5;
printf(“%d,%d,%dn”,x,x< <2,x>>2);}

Answer: 5,20,1

What will be printed as the result of the operation below:
#define swap(a,b) a=a+b;b=a-b;a=a-b;void main()
{
int x=5, y=10;
swap (x,y);
printf(“%d %dn”,x,y);
swap2(x,y);
printf(“%d %dn”,x,y);
}

int swap2(int a, int b)
{
int temp;
temp=a;
b=a;
a=temp;
return 0;
}
Answer: 10, 5
10, 5

 

feedback