Programming Concepts

  Home  Computer Programming  Programming Concepts


“Conceptual frequently Asked Questions by expert members with experience in Programming Concepts. So get preparation for the Conceptual job interview questions”



112 Programming Concepts Questions And Answers

21⟩ What is multithreading?

Multithreading is the ability of a program or an operating system process to manage its use by more than one user at a time and to even manage multiple requests by the same user without having to have multiple copies of the programming running in the computer. Central processing units have hardware support to efficiently execute multiple threads. These are distinguished from multiprocessing systems (such as multi-core systems) in that the threads have to share the resources of a single core: the computing units, the CPU caches and the translation lookaside buffer (TLB).

 164 views

22⟩ Explain what is the difference between Process and thread with real time examples?

1.Threads share the address space of the process that created it; processes have their own address.

2.Threads have direct access to the data segment of its process; processes have their own copy of the data segment of the parent process.

3.Threads can directly communicate with other threads of its process; processes must use interprocess communication to communicate with sibling processes.

4.Threads have almost no overhead; processes have considerable overhead.

5.New threads are easily created; new processes require duplication of the parent process.

6.Threads can exercise considerable control over threads of the same process; processes can only exercise control over child processes.

7.Changes to the main thread (cancellation, priority change, etc.) may affect the behavior of the other threads of the process; changes to the parent process does not affect child processes.

 169 views

23⟩ Write an O(log2(N)) algorithm to find X^N?

int computeXn(int x, int n)

{

if(n == 2)

{

return x*x;

}

else if(n % 2 == 0)

{

int y = computeXn(x, n/2);

return y*y;

}

else if(n % 2 == 1)

{

int y = computeXn(x, n/2);

return y*y*x;

}

}

 159 views

25⟩ What is the Hierarchy levels in data warehousing concepts level?

In-accurate data is often termed as dirty data and has been characterized as missing data, wrong data and compound data with different representations.

Ex. :- customer dimension in which the same person can appear multiple times probably not with exactly the same spellings or other attributes.

 171 views

26⟩ What is dirty dimension?

If a Record occurs more than one time in a table by the difference of a non-key attribute then such a dimension is called Dirty Dimemsion.

 196 views

27⟩ What are the advantages & disadvantages of vertical cluster & horizontal cluster? Which is the best? Why?

In horizontally clustered environment, cluster-enabled application is deployed on multiple physical machines. Each machine is available for requests. Horizontal clusters offers protection over hardware failure, increases efficiency, provides load balancing and process failover. However, since there are many number of physical machines involved the installation and maintenance cost increases proportionally.

In Vertical clustering, multiple application server instances are hosted on the same physical machine. This type of clustering provides increased efficiency, load balancing and process failover. However, if hardware fails then there may not be ready alternative.

 196 views

28⟩ How to increase transfer rate of an hard disk?

See if any among these helps to increase Hard disk transfer rate...

- Try using RAID setup

- In Device Manager under ATA/ATAPI Controllers verify if the hard disk is running in UDMA mode.

- Update motherboard chipset drivers

- Under Properties of the drive, Hardware Tab -> Properties of the hard disk:

Enable write caching

Enable advanced performance

 174 views

30⟩ Explain CDROM access is random or semi random or sequential?

CDROM access is sequential..

Magnetic sequential access memory is typically used for secondary storage in general-purpose computers due to their higher density at lower cost compared to RAM, as well as resistance to wear and non-volatility. Examples of SAM devices still in use include hard disks, CD-ROMs and magnetic tapes. Historically, drum memory has also been used.

 182 views

32⟩ Why dont we give a & before reading a string in C language?scanf("%s",str); why is it not scanf("%s",&str);

We don't give an & before reading a string. This is so because a string is a character array. For an array, be it integer or character or any other array, declared as int a[10] or char str[20], the name 'a' or 'str' stores the base address of the array, that is the address of the memory location where the array is starting. The scanf statement requires the address of the location to store the value input by the user. Since str already stores the address of the memory location we do not need to add the & before it.

 209 views

34⟩ Give the complete difference between database, relational database and object database?

A database is an organized collection of information. It is structured so you can jump to the information by using a key, and find related infromation by navigating a path. A sequential (flat) file is not considered a database.

A relational database contains one-to-many relationships.

A networked database contains one-to-many and many-to-many relationships.

 213 views

37⟩ What is multitasking?

Two or more process run concurrently called MultiTasking. There are two types of multitasking. 1) Process-based 2) Thread-based.

Process-based multitasking allows your computer to run two or more programs concurrently. Thread-based multitasing means single program can perform two or more task simultaneously.

 189 views

38⟩ How to implement "Queue" functionality by using "2 Stacks"?

1. Take 2 empty stacks.

2. Fill the 1st stack with some items (eg: input 100, 101, 102, 103)

3. Now read the items from 1st stack in LIFO order and write to 2nd stack.

(By this the 2nd stack will get the items in the order .. 103, 102, 101, 100)

4. Now read the items from 2nd stack in LIFO order i.e. the output will be

100, 101, 102, 103.

(this is the queue order FIFO with respect to the actual items entered in 1st

stack.)

 193 views