Monday 24 December 2012

Binary addition & Binary Subtraction

Binary addition:


The rules for binary addition are the same as those for any positional number system. One adds the digits column-wise from the right. If the sum is greater than B–1 for base B, a carry into the next column is generated. In the case of binary numbers, a sum greater than one generates a carry. Here is the binary addition table:

Saturday 22 December 2012

List six major steps that you would take in setting up a database for a particular enterprise.

Answer: Six major steps in setting up a database for a particular enterprise are:

  •  Define the high level requirements of the enterprise (this step generates a document known as the system requirements specification.)

  •  Define a model containing all appropriate types of data and data relationships.

Tuesday 18 December 2012

Signed and Unsigned numbers

In mathematics, negative numbers in any base are represented in the usual way, by prefixing them with a "−" sign. However, on a computer, there are various ways of representing a number's sign. Now we discuss the following methods for representing signed numbers in a computer.

Sign-and-magnitude


The first approach for representing a number's sign

Sunday 16 December 2012

List five responsibilities of a database management system.

Q) List five responsibilities of a database management system. For each responsibility, explain the problems that would arise if the responsibility were not discharged.

Answer: A general purpose database manager (DBM) has five responsibilities:

a. interaction with the file manager.


b. integrity enforcement.


c. security enforcement.


d. backup and recovery.


e. concurrency control.


If these responsibilities were not met by a given DBM

Saturday 15 December 2012

List four significant differences between a file-processing system and a DBMS.

Answer: Some main differences between a database management system and a file-processing system are:

  • Both systems contain a collection of data and a set of programs which access that data. A database management system coordinates both the physical and the logical access to the data, whereas a file-processing system coordinates only the physical

Friday 14 December 2012

A.P History for APPSC Exams

Political History of the Satavahanas


The vague, disputed and uncorroborated doubtful evidences form the basis for the history of the Satavahanas. The Jain sources mention Satavahana as the first king in the family. The Kathasaritsagara also contains a story about Satavahana. The Kondapur coins bear the legend 'Sadvahana'. On scriptal grounds this Satavahana is placed close to (either before or contemporaneous with) Simuka, the first

Tuesday 27 November 2012

[latexpage]

$ a\xrightarrow{\text{This is very long text}}b $

Monday 26 November 2012

Later Satavahana Chronology

The correctness of 271 B.C. as the starting point of the Satavahana rule under Simuka, may be verified and established from the known dates of Kshatrapas and other foreign kings. The foreign powers such as the Sakas and the Pahlavas in the closing years of the 1st Century B.C. and in the beginning years of the 1st century A.D. became powerful and established their sway in Malwa, Surashtra and other western areas. It was mainly on account of these foreign onslaughts, the power of the Satavahanas for sometime had to register a shart decline, subsequent to the reign of Pulomavi. The king who once

Wednesday 21 November 2012

Indian Economy for competitive exams

PLANNINGS


Economic Planning:



  • Economic Planning means “It is an outline or broad statement of schemes on programs designed to realize certain pre-determined economic objectives, in a particular order of priorities, according to a strategy within a specified period of time is called Economic Planning.” If the government fallows the plans for the development of economy is called plan policy.

  • USSR (Russia) was the first country introduced planning in the world in 1920.

C Program to determine a file’s attributes.

How to determine a file’s attributes?


The file attributes are stored in the find_t.attrib structure member. This structure member is a single character, and each file attribute is represented by a single bit. Here is a list of the valid DOS file attributes:

Saturday 17 November 2012

SOLAR SYSTEM

SOLAR SYSTEM



  •      The solar system comprises of the sun and eight planets revolving round the sun, many satellites revolving around their respective planets, thousands of comets and billions of meteoroids.

  •      Planets (in the increasing order of their distance from the Sun)


1.       Mercury
2.      Venus
3.      Earth
4.      Mars
5.      Jupiter

Tuesday 6 November 2012

Geography for Competitive Exams

ORIGIN OF THE EARTH


Earth formed from a small part of the sun, it originated as a hot gaseous mass, which on cooling, turned first into a liquid and then into solid mass.

Gaseous Hypothesis Theory – Kant

Nebural Hypothesis Theory – Laplace

Tidal Hypothesis Theory – Jeans and Jeffreys

  •      The denser matter forms the central part of the earth and the

Friday 2 November 2012

Chronology of the Satavahanas

Of the many complicated problems that the Andhras have presented, the most important one is the problem of their chronology. Divergent views have been expressed by different scholars about the beginning of the Andhra Satavahana rule, but so far no unanimous conclusion has yet been arrived at by the historian on this point of issue.

The foundation of the dynasty, which is known by its tribal name Andhra in the Puranas and by its family name Satavahana in the

Sunday 28 October 2012

Home Land of the Satavahanas

A subject of controversy regarding the Satavahanas is their homeland or origin. There are conflicting theories and contradictory opinions regarding this. Earlier scholars like D.R. Bhandarkar conjectured that the land of the Andhras must have at the early period consisted of certain parts of the Central Provinces together with the Visakhapatnam district and may have also included the Godavari and Krishna districts. The eastern Deccan was not called

Friday 26 October 2012

Tips to use Samsung Galaxy Tab

Any new electronic device, especially something as sophisticated as the Galaxy Tab, requires a bit of hand-holding.

Charging the battery:


The first thing that I recommend you do with your Galaxy Tab is give it a full charge. Obey these steps:

Tuesday 23 October 2012

Fundamental Rights and Its Explanation

ప్రాథమిక హక్కులు వివరణ

భారత రాజ్యాంగంలోని మూడవ అధ్యాయం ( 12 నుంచి 35 ప్రకరణలు ) మొత్తం 24 ప్రకరణలు ప్రాథమిక హక్కులను ప్రస్తావిస్తుంది. 1978, 44వ రాజ్యంగ సవరణలో ఆస్తి హక్కును (31 వ ప్రకరణ ) ప్రాథమిక హక్కుల అధ్యాయం నుంచి తొలగించిన తరవాత, ప్రస్తుతం ఆరు ప్రాథమిక హక్కులు ఉన్నాయి. అవి :

  1. సమానత్వ హక్కు ( 14 నుంచి 18వ ప్రకరణ వరకు )

  2. స్వేచ్ఛా హక్కు ( 19 నుంచి 22వ ప్రకరణ వరకు )

  3. పీడన నిరోధక హక్కు ( 23 , 24 ప్రకరణలు )

  4. మత స్వేచ్ఛ హక్కు ( 25 నుంచి 28వ ప్రకరణ వరకు )

  5. విద్యా, సాంస్కృతిక హక్కులు ( 29, 30 ప్రకరణలు )

  6. రాజ్యాంగ పరిరక్షణ హక్కు ( 32వ ప్రకరణ )


ప్రాథమిక హక్కులపై ప్రత్యేకంగా పేర్కొనబడిన ప్రకరణలు 14 నుంచి 32. తొలగించిన 31వ ప్రకరణను

Sunday 21 October 2012

The Satavahanas

Identity of the Satavahanas


The Pauranic genealogies refer to the kings of 'Andhra-Jati'. Some Puranas style them as Andhrabhrityas. The Nanaghat and Nasik cave inscriptions and coins discovered in the Deccan mention the names of several kings of 'Satavahana-Kula'. On the basis of certain names, and their order of succession common to various kings mentioned in the two sources, some scholars identified the Satavahanas of the epigraphical records and coins with the Andhras of the Puranas. However the Puranas never use the term

Thursday 18 October 2012

How can cache different version of same page using ASP.NET cache object ?

Output cache functionality is achieved by using “OutputCache” attribute on ASP.NET page header. Below is the syntax

<%@ OutputCache Duration="20" Location="Server" VaryByParam="state" VaryByCustom="minorversion" VaryByHeader="Accept-Language"%>




  • VaryByParam :- Caches different version depending on

Aryanization of the Andhra Country and its Condition in the Pre-Mauryan and Mauryan Periods.

The historical period in Andhra starts with the famous Satavahanas. Prior to their emergence into power, during the 6th and 5th centuries B.C., northern India was under the settled government of the Sisunaga and Haryanka rulers. The two famous reformist faiths. Buddhism and Jainism came to be founded during the same period. In Andhra, the Nagas who were definitely of a non-Aryan stock were having their republican states. Some other semi-civilised races also

Wednesday 17 October 2012

C Program to sort filenames in a directory?

How do you sort filenames in a directory?


The below example shows how to get a list of files one at a time. The example uses the _dos_findfirst() and _dos_findnext() functions to walk through the directory structure. As each filename is found, it is printed to the screen.

When you are sorting the filenames in a directory, the one-at- a-time approach does not work. You need some way to store the filenames and then sort them when all filenames have been

Thursday 11 October 2012

Fundamental Rights and Its Nature

ప్రాథమిక హక్కులు – స్వభావం

        భారత రాజ్యాంగ సభ సలహాదారు బి.ఎన్.రావు రూపొందించిన ముసాయిదా ప్రకారం భారత రాజ్యాంగంలో రెండు రకాల హక్కులున్నాయి. వాటిని ప్రాథమిక హక్కులు (Fundamental Rights) గా, రాజ్యవిధాన ఆధేశ సూత్రాలు (Directive Principles of State Policy) గా పేర్కొనడం జరిగింది. భారత రాజ్యాంగ రచనను ఒక సామాజిక విప్లవంగా వర్ణించిన గ్రాన్విల్ ఆస్టిన్ ఈ రెండు రకాల హక్కులు భారతదేశంలో స్వేచ్ఛాయుత సామాజిక వికాసానికి అవసరమని పేర్కొన్నారు.  సమానత్వం, స్వేచ్ఛ, మతం తదితరాంశాలను ప్రాథమిక హక్కులుగా గుర్తించి వాటిని న్యాయ రక్షణకు అర్హమైనవిగా గుర్తించడం జరిగింది. ఉచిత ప్రాథమిక విద్య, పనిహక్కు, ప్రజారోగ్యం తదితర హక్కులను ఆదేశసూత్రాలు (Directive Principles) గా

Tuesday 2 October 2012

History of the Andhras

Sources of History of Andhras till 1565 A.D.


'History as a subject of study is more or less completely at the mercy of its sources'. It is a fact that we have no ancient or medieval literature created in Andhra which can be classified as truly historical. So it is but natural one has to depend heavily on 'Primary source material of incidental nature, created not for the purpose of communicating the history of contemporary times chronologically set forth, but to record events and impressions for political, legal and religious purposes like the epigraphs of medieval times, the quasi-historical literary works and so forth'.

Just like ancient Indian history, the history of the Andhras is still in

Tuesday 28 August 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 15

Predict the output or error(s) for the following:


1)

main()

{

int i=_l_abc(10);


printf("%d\n",--i);


}

int _l_abc(int i)

{

 return(i++);


}

Answer:

9


Explanation:

Tuesday 14 August 2012

Thursday 10 May 2012

APPSC Groups Study material(Indian History)

INDUS VALLEY CIVILIZATION



  •      It is also known as Harappan Civilization

  •      It was discovered by Sir.Daya Ram Sahni in 1921.

  •      IVC extended in an area of 1.3 million square kms from,




  • Ÿ  Sutkagendar (Baluchistan) – West

  • Ÿ  Alamgirpur (U.P.) – East

  • Ÿ  Manda (Jammu) – North

  • Ÿ  Diamabad (Maharashtra) – South

  • Ÿ  (Mnemonic – SAMAD)




  •      The Indus Valley Civilization had its beginnings in Chalcolithic Age and had its maturity phase in Bronze Age.

  •      When Indus Valley Civilization was discovered in 1921, Sir. John Marshall was the head of Archeological Survey of India.


Features of IVC

Tuesday 8 May 2012

APPSC Groups Study material(Indian History)

THE STONE AGE – EARLY MAN


The evolution of earth shows 4 stages. The fourth stage is called Quaternary which is divided into Pleistocene (most recent) and Holocene (present).

The History of Earth is divided into 3 Eras,


  1. Palaeozoic Era

  2. Mesozoic Era

  3. Cenozoic Era



The period before the Palaeozoic Era is called PRE-CAMBRIAN TIME.

Various Eras and Periods


1)      Pre-Cambrian Time

Monday 12 March 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 14

Predict the output or error(s) for the following:


1)

struct point

{

 int x;


 int y;


 };

struct point origin,*pp;

main()

{

pp=&origin;


printf("origin is(%d%d)\n",(*pp).x,(*pp).y);


printf("origin is (%d%d)\n",pp->x,pp->y);


}

Answer:

origin is(0,0)


origin is(0,0)


Explanation:

Saturday 10 March 2012

How do you list a file’s date and time?

A file’s date and time are stored in the find_t structure returned from the _dos_findfirst() and _dos_findnext() functions.

The date and time stamp of the file is stored in the find_t.wr_date and find_t.wr_time structure members. The file date is stored in a two-byte unsigned integer as shown here:

Because DOS stores a file’s seconds in two-second intervals, only the

Friday 9 March 2012

Sun Certified Java Programmer (SCJP) Questions

Question 1

The following code will give

1:    class Test

2:    {

3:         void show()

4:         {

5:             System.out.println("non-static method in Test");

6:         }

7:    }

8:    public class Q3 extends Test

9:    {

10:      static void show()

11:      {

12:          System.out.println("Overridden non-static method in Q3");

13:      }

14:

15:      public static void main(String[] args)

16:      {

17:          Q3 a = new Q3();

18:      }

19:   }

 

A) Compilation error at line 3.

B) Compilation error at line 10.

C) No compilation error, but runtime exception at line 3.

D) No compilation error, but runtime exception at line 10.

Answer : B

Explanation :

Thursday 8 March 2012

RAID


  • Redundant Array of Independent Disks

  • Redundant Array of Inexpensive Disks

  • 6 levels in common use

  • Not a hierarchy

  • Set of physical disks viewed as single logical drive by O/S

  • Data distributed across physical drives

  • Can use redundant capacity to store parity information


RAID 0



  • No redundancy

  • Data striped across all disks

Wednesday 7 March 2012

What are different types of caching using cache object of ASP.NET?

You can use two types of output caching to cache information that is to be transmitted to and displayed in a Web browser:

Page Output Caching


Page output caching adds the response of page to cache object. Later when page is requested page is displayed from cache rather than creating the page object and displaying it. Page output caching is good if the site is fairly static.



Page Fragment Caching

Tuesday 6 March 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 13

Predict the output or error(s) for the following:


1)

#include<stdio.h>

main()

{

  int a[2][2][2] = { {10,2,3,4}, {5,6,7,8}  };


  int *p,*q;


  p=&a[2][2][2];


  *q=***a;


  printf("%d..%d",*p,*q);


}

Answer:

garbagevalue..1


Explanation:

Monday 5 March 2012

How do you list files in a directory?

Unfortunately, there is no built-in function provided in the C language such as dir_list() that would easily provide you with a list of all files in a particular directory. By utilizing some of C’s built-in directory functions, however, you can write your own dir_list() function.

First of all, the include file dos.h defines a structure named find_t, which represents the structure of the DOS file entry block. This

Sunday 4 March 2012

Sun Certified Java Programmer (SCJP) Questions

Question 1

What will happen if you compile/run this code?

1: public class Q1 extends Thread

2: {

3:    public void run()

4:    {

5:       System.out.println("Before start method");

6:       this.stop();

7:       System.out.println("After stop method");

8:    }

9:

10:   public static void main(String[] args)

11:   {

12:      Q1 a = new Q1();

13:      a.start();

14:   }

15: }

 

A) Compilation error at line 7.

B) Runtime exception at line 7.

C) Prints "Before start method" and "After stop method".

D) Prints "Before start method" only.

Answer : D

Explanation :

Saturday 3 March 2012

Data Organization and Formatting


  • Concentric rings or tracks


—   Gaps between tracks


—   Reduce gap to increase capacity


—   Same number of bits per track (variable packing density)


—   Constant angular velocity




  • Tracks divided into sectors

  • Minimum block size is one sector

Friday 2 March 2012

What are dependencies in cache and types of dependencies ?

When you add an item to the cache, you can define dependency relationships that can force that item to be removed from the cache under specific activities of dependencies. Example if the cache object is dependent on file and when the file data changes you want the cache object to be update. Following are the supported dependency :-

  • File dependency :- Allows you to invalidate a specific cache item when a disk based file or files change.

Thursday 1 March 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 12

Predict the output or error(s) for the following:


1)

int i=10;

main()

{

extern int i;


{


int i=20;


{


const volatile unsigned i=30;


printf("%d",i);


}


printf("%d",i);


}


printf("%d",i);


}

Answer:

30,20,10


Explanation:

Wednesday 29 February 2012

What is the difference between text and binary modes?

Streams can be classified into two types: text streams and binary streams. Text streams are interpreted, with a maximum length of 255 characters. With text streams, carriage return/line feed combinations are translated to the newline \n character and vice versa. Binary streams are uninterpreted and are treated one byte at a time with no translation of characters. Typically, a text stream would be used for reading and writing standard text files, printing

Tuesday 28 February 2012

Sun Certified Java Programmer (SCJP) Questions

Which is the most suitable Java collection class for storing various companies and their stock prices? It is required that the class should support synchronization inherently.


Choices:

  • A. Hashtable

  • B. HashMap

  • C. LinkedHashMap

  • D. HashSet

  • E. TreeMap


Correct choice:

  • A


Explanation:

Monday 27 February 2012

Types of External Memory


  • Magnetic Disk


—   RAID


—   Removable




  • Optical


—   CD-ROM


—   CD-Recordable (CD-R)


—   CD-R/W


—   DVD




  • Magnetic Tape


Magnetic Disk



  • Disk substrate coated with magnetizable material (iron

Sunday 26 February 2012

What are the different phase/steps of acquiring a proxy object in Webservice ?

Following are the different steps needed to get a proxy object of a webservice at the client side :-

  • Client communicates to UDI node for WebService either through browser or UDDI's public web service.

  • UDII responds with a list of webservice.

  • Every service listed by webservice has a URI pointing to DISCO or WSDL document.

Saturday 25 February 2012

Friday 24 February 2012

How can you restore a redirected standard stream?

The preceding example showed how you can redirect a standard stream from within your program. But what if later in your program you wanted to restore the standard stream to its original state? By using the standard C library functions named dup() and fdopen(), you can restore a standard stream such as stdout to its original state.

The dup() function duplicates a file handle. You can use the dup() function to save the file handle corresponding to the stdout standard

Thursday 23 February 2012

The Collections framework

List classes


A List is an ordered collection, which allows positional access and search.

The classes implementing List are ordered by index position. An ArrayList enables fast iteration and constant speed positional access. A Vector is similar to ArrayList, only slower because it is synchronized. LinkedList allows fast insertion and deletion at the beginning or end. It is commonly used for implementing stacks and queues. For instance:

Wednesday 22 February 2012

Virtual Memory


  • Demand paging


—   Do not require all pages of a process in memory


—   Bring in pages as required




  • Page fault


—   Required page is not in memory


—   Operating System must swap in required page


—   May need to swap out a page to make space

Tuesday 21 February 2012

What are the steps to create a webservice and consume it ?

Note :- For this question this post will make a attempt by creating a simple webservice and explaining steps to acheive it. A simple webservice will be created which takes two number and gives addition result of the two number. Definitely the interviewer will not expect such a detail answer but this book will explain you in detail so that you are on right track during interview.


This webservice will add two numbers and give to the calling client. All the below steps are according to VS2008 beta editor :-

  • First create a website by clicking on File -- New WebSite.

Monday 20 February 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 10

Predict the output or error(s) for the following:


1)

main()

{

char *str1="abcd";


char str2[]="abcd";


printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd"));


}

Answer:

2 5 5


Explanation:

Sunday 19 February 2012

If errno contains a nonzero number, is there an error?

The global variable errno is used by many standard C library functions to pass back to your program an error code that denotes specifically which error occurred. However, your program should not check the value of errno to determine whether an error occurred.

Usually, the standard C library function you are calling returns with a return code which denotes that an error has occurred and that the

Friday 17 February 2012

The Collections framework

Collections and collections interfaces


Collections are objects used to group together and manipulate multiple data elements. They can dynamically grow and shrink, which is their advantage over arrays. Collections provide methods to add objects to a collection, remove objects from it, check if an object is

Thursday 16 February 2012

Replacement Algorithms


  • Least Recently used (LRU)

  • e.g. in 2 way set associative

    • Which of the 2 block is lru?



  • First in first out (FIFO)

    • replace block that has been in cache longest



  • Least frequently used (LFU)

Wednesday 15 February 2012

What is a Web Service ?

Web Services are business logic components which provide functionality via the Internet using standard protocols such as HTTP.

Web Services uses Simple Object Access Protocol (SOAP) in order to expose the business functionality.SOAP defines a standardized format in XML which can be exchanged between two entities over

Tuesday 14 February 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 9

Predict the output or error(s) for the following:


1)

main()

{

char *cptr,c;


void *vptr,v;


c=10;  v=0;


cptr=&c; vptr=&v;


printf("%c%v",c,v);


}

Answer:

Compiler error (at line number 4): size of v is Unknown.


Explanation:

Monday 13 February 2012

What is hashing?

To hash means to grind up, and that’s essentially what hashing is all about. The heart of a hashing algorithm is a hash function that takes your nice, neat data and grinds it into some random-looking integer.

The idea behind hashing is that some data either has no inherent ordering (such as images) or is expensive to compare (such as images). If the data has no inherent ordering, you can’t perform comparison searches. If the data is expensive to compare, the

How many objects will be eligible for garbage collection after line 7?

public class TutorialGC
{

public static void main(String [] args)
{


Object a = new Integer(100);   // Line1
Object b = new Long(100);       // Line2
Object c = new String(“100″);  // Line3
a = null;                                        // Line4
a = c;                                             // Line5
c = b;                                             // Line6
b = a;                                             // Line7
// Rest of the code here


}


}

Choices:



  • A. 0

  • B. 1

  • C. 2

  • D. 3

  • E. Code does not compile


Correct choice:



  • B


Explanation:

Sunday 12 February 2012

Cache


  • Small amount of fast memory

  • Sits between normal main memory and CPU

  • May be located on CPU chip or module



Cache operation



  • CPU requests contents of memory location

  • Check cache for this data

Saturday 11 February 2012

What will be the result of an attempt to compile and run the following program?

class Test
{

public static void main(String args[])
{


String s1 = "abc";
String s2 = "abc";
s1 += "xyz";
s2.concat("pqr");
s1.toUpperCase();
System.out.println(s1 + s2);


}


}

Choices:

  • A. "abcxyzabc"

  • B. "abcxyzabcpqr"

  • C. "ABCXYZabcpqr"

  • D. "ABCXYZabc"

  • E. Code does not compile


Correct choice:

  •  A


Explanation:

Friday 10 February 2012

What is marshaling and what are different kinds of marshaling ?

Marshaling is used when an object is converted so that it can be sent across the network or across application domains. Unmarshaling creates an object from the marshaled data.
There are two ways to do marshaling :-

  • Marshal-by-value (MBV) :- In this the object is serialized into the channel, and a copy of the object is created on the other side

Thursday 9 February 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 8

Predict the output or error(s) for the following:


1)

int i,j;

for(i=0;i<=10;i++)

{

j+=5;


assert(i<5);


}

Answer:

Runtime error: Abnormal program termination.


assert failed (i<5), <file name>,<line number>


Explanation:

Wednesday 8 February 2012

What is the quickest searching method to use?

A binary search, such as bsearch() performs, is much faster than a linear search. A hashing algorithm can provide even faster searching. One particularly interesting and fast method for searching is to keep the data in a “digital trie.” A digital trie offers the prospect of being able to search for an item in essentially a constant amount of time, independent of how many items are in the data set.

A digital trie combines aspects of binary searching, radix searching, and hashing. The term “digital trie” refers to the data structure used to hold the items to be searched. It is a multilevel data structure that

Tuesday 7 February 2012

Memory Hierarchy


  • Registers


—   In CPU




  • Internal or Main memory


—   May include one or more levels of cache


—   “RAM”




  • External memory

Monday 6 February 2012

Wrapper classes

Wrapper classes correspond to the primitive data types in the Java language. These classes represent the primitive values as objects. All the wrapper classes except Character have two constructors -- one that takes the primitive value and another that takes the String representation of the value. For instance:

Integer i1 = new Integer(50);
Integer i2 = new Integer("50");


The Character class constructor takes a char type element as an

Sunday 5 February 2012

Which config file has all the supported channels/protocol ?

Machine.config file has all the supported channels and formatter supported by .NET remoting.Machine.config file can be found at “C:\WINDOWS\Microsoft.NET\Framework\vXXXXX\CONFIG” path. Find <system.runtime.remoting> element in the Machine.config file which has the channels and the formatters. Below is a figure shown which can give a clear idea of how the file looks like.

Note :- Interviewer will not ask you to name all channels and

Saturday 4 February 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 7

Predict the output or error(s) for the following:


1)

main ( )

{

 static char *s[ ]  = {“black”, “white”, “yellow”, “violet”};


 char **ptr[ ] = {s+3, s+2, s+1, s}, ***p;


 p = ptr;


 **++p;


 printf(“%s”,*--*++p + 3);


}

Answer:

ck


Explanation:

Friday 3 February 2012

What is the easiest searching method to use?

Just as qsort() was the easiest sorting method, because it is part of the standard library, bsearch() is the easiest searching method to use.

Following is the prototype for bsearch():

void *bsearch(const void *key, const void *buf, size_t num, size_t size, int (*comp)(const void *, const void *));


The bsearch() function performs a binary search on an array of sorted data elements. A binary search is another “divide and conquer” algorithm. The key is compared with the middle element of

Thursday 2 February 2012

Read Only Memory (ROM)


  • Permanent storage


—   Nonvolatile




  • Microprogramming (see later)

  • Library subroutines

  • Systems programs (BIOS)

  • Function tables


Types of ROM



  • Written during manufacture


—   Very expensive for small runs




  • Programmable (once)

Wednesday 1 February 2012

String and StringBuffer

Immutability of String objects


As you know, Strings are objects in Java code. These objects, however, are immutable. That is, their value, once assigned, can never be changed. For instance:

String msg = "Hello";
msg += " World";


Here the original String "Hello" is not changed. Instead, a new String is created with the value "Hello World" and assigned to the variable

Monday 30 January 2012

What are LeaseTime, SponsorshipTime, RenewonCallTime and LeaseManagerPollTime?

This is a very important question from practical implementation point of view. Companies who have specific requirement for Remoting projects will expect this question to be answered.


In normal .NET environment objects lifetime is managed by garbage collector. But in remoting environment remote clients can access objects which are out of control of garbage collector. Garbage collector boundary is limited to a single PC on which framework is

Sunday 29 January 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 6

Predict the output or error(s) for the following:


1)

main( )

{

 void *vp;


 char ch = ‘g’, *cp = “goofy”;


 int j = 20;


 vp = &ch;


 printf(“%c”, *(char *)vp);


 vp = &j;


 printf(“%d”,*(int *)vp);


 vp = cp;


 printf(“%s”,(char *)vp + 3);


}

Answer:

g20fy


Explanation:

Saturday 28 January 2012

How can I sort things that are too large to bring into memory?

A sorting program that sorts items that are on secondary storage (disk or tape) rather than primary storage (memory) is called an external sort. Exactly how to sort large data depends on what is meant by “too large to fit in memory.” If the items to be sorted are themselves too large to fit in memory (such as images), but there aren’t many items, you can keep in memory only the sort key and a

Friday 27 January 2012

Thursday 26 January 2012

Fundamental classes in the java.lang package

Using the Math class


The Math class is final and all the methods defined in the Math class are static, which means you cannot inherit from the Math class and override these methods. Also, the Math class has a private constructor, so you cannot instantiate it.

The Math class has the following methods: ceil(), floor(), max(),

Wednesday 25 January 2012

In CAO model for client objects to be created by “NEW” keyword what should we do?

Remoting Clients and Remoting Server can communicate because they share a common contract by implementing Shared Interface or Base Class (As seen in previous examples). But according to OOP’s concept we can not create a object of interface or Base Classes (Abstract Class). Shipping the server object to client is not a good design practice. In CAO model we can use SOAPSUDS utility to generate Metadata DLL from server which can be shipped to client, clients can then use this DLL for creating object on server. Run the

Tuesday 24 January 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 5

Predict the output or error(s) for the following:


1)

main( )

{

 static int  a[ ]   = {0,1,2,3,4};


 int  *p[ ] = {a,a+1,a+2,a+3,a+4};


 int  **ptr =  p;


 ptr++;


 printf(“\n %d  %d  %d”, ptr-p, *ptr-a, **ptr);


 *ptr++;


 printf(“\n %d  %d  %d”, ptr-p, *ptr-a, **ptr);


 *++ptr;


 printf(“\n %d  %d  %d”, ptr-p, *ptr-a, **ptr);


 ++*ptr;


printf(“\n %d  %d  %d”, ptr-p, *ptr-a, **ptr);


}

Answer:

111


222


333


344


Explanation:

Monday 23 January 2012

The Radix Sort

The radix sort shown below takes a list of integers and puts each element on a smaller list, depending on the value of its least significant byte. Then the small lists are concatenated, and the process is repeated for each more significant byte until the list is sorted. The radix sort is simpler to implement on fixed-length data such as ints, but it is illustrated here using strings.

Two functions perform the radix sort. The function radixSort() performs one pass through the data, performing a partial sort. Line

Sunday 22 January 2012

Pipelining


  • Fetch instruction

  • Decode instruction

  • Calculate operands (i.e. EAs)

  • Fetch operands

  • Execute instructions

  • Write result

  • Overlap these operations


Two Stage Instruction Pipeline


Pentium 4 Cache



  • Pentium (all versions) – two on chip L1 caches


—   Data & instructions

Saturday 21 January 2012

Sun Certified Java Programmer (SCJP) Questions

Which of the following statements is not true about threads ?


Choices:



  • A. If the start() method is invoked twice on the same Thread object, an exception is thrown at runtime.

  • B. The order in which threads were started might differ from the order in which they actually run.

  • C. If the run() method is directly invoked on a Thread object, an

Friday 20 January 2012

Describe in detail Basic of SAO architecture of Remoting?

For these types of questions interviewer expects small and sweet answers. He is basically looking at what you know about the specific subject. For these type of question this post will provide detail code which is not necessary to be said during interview. Only the basic steps and overall brief are enough to convince that you have knowledge about the subject. Even though this question has detail code and answer say only what is needed in interview.


Remoting has at least three sections :-

  • Common Interface which will be shared between them.

  • Server.

  • Client.


Solution Explorer of Remoting Project


Above is the figure which shows the three important project

Thursday 19 January 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 4

Predict the output or error(s) for the following:


1)

main( )

{

int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}};


printf(“%u %u %u %d \n”,a,*a,**a,***a);


printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1);


}

Answer:

100, 100, 100, 2


114, 104, 102, 3


Explanation:

Tuesday 17 January 2012

The Merge Sort

The merge sort is a “divide and conquer” sort as well. It works by considering the data to be sorted as a sequence of already-sorted lists (in the worst case, each list is one element long). Adjacent sorted lists are merged into larger sorted lists until there is a single sorted list containing all the elements. The merge sort is good at sorting lists and other data structures that are not in arrays, and it can be used to sort things that don’t fit into memory. It also can be implemented as a stable sort. The merge sort was suggested by John von Neumann in 1945!

Below example shows an implementation of the merge sort algorithm. To make things more interesting, the strings will be put into a linked list structure rather than an array. In fact, the algorithm works better on data that is organized as lists, because elements in an array cannot be merged in place (some extra storage is required).

There are four functions that together implement merge sort. The function split() takes a list of strings and turns it into a list of lists of

Sunday 15 January 2012

Instruction Cycle with Indirect

Indirect Cycle



  • May require memory access to fetch operands

  • Indirect addressing requires more memory accesses

  • Can be thought of as additional instruction subcycle


Instruction Cycle with Indirect



Instruction Cycle State Diagram

Saturday 14 January 2012

Threads in Java – 2

Thread states


Threads can be in one of the following states:

New. After the thread is instantiated, the thread is in the New state until the start()method is invoked. In this state, the thread is not considered alive.

Runnable. A thread comes into the runnable state when the start() method is invoked on it. It can also enter the runnable state from the running state or blocked state. The thread is considered alive when it is in this state.

Running. A thread moves from the runnable state into the running state when the thread scheduler chooses it to be the currently running thread.

Alive, but not runnable. A thread can be alive but not in a runnable state for a variety

What is an application domain ?

Previously “PROCESS” where used as security boundaries. One process has its own virtual memory and does not over lap the other process virtual memory; due to this one process can not crash the other process. So any problem or error in one process does not affect the other process. In .NET they went one step ahead introducing application domains. In application domains multiple applications can run in same process with out influencing each other. If one of the application domains throws error it does not affect the other application domains. To invoke method in a object running in different application domain .NET remoting is used.

 One process can have multiple Application domains



What is .NET Remoting ?


.NET remoting is replacement of DCOM. Using .NET remoting you can make remote object

Thursday 12 January 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 3

Predict the output or error(s) for the following:


1)

#include<stdio.h>

main()

{

struct xx


{


int x=3;


char name[]="hello";


};


struct xx *s=malloc(sizeof(struct xx));


printf("%d",s->x);


printf("%s",s->name);


}

Answer:

Compiler Error


Explanation:

Tuesday 10 January 2012

CPU Structure


  • CPU must:


—   Fetch instructions


—   Interpret instructions


—   Fetch data


—   Process data


—   Write data



CPU With Systems Bus


CPU Internal Structure

Monday 9 January 2012

Threads in Java - 1

Creating threads


Threads are objects in the Java language. A thread can be defined by extending the java.lang.Thread class or by implementing the java.lang.Runnable interface. The run() method should be overridden and should have the code that will be executed by the new thread. This method must be public with a void return type and should not take any arguments.

Extending thread


If we need to inherit the behavior of the Thread class, we can have a subclass of it. In this case, the disadvantage is that you cannot extend

Sunday 8 January 2012

What is the quickest sorting method to use?

The answer depends on what you mean by quickest. For most sorting problems, it just doesn’t matter how quick the sort is because it is done infrequently or other operations take significantly more time anyway. Even in cases in which sorting speed is of the essence, there is no one answer. It depends on not only the size and nature of the data, but also the likely order. No algorithm is best in all cases.

There are three sorting methods in this author’s “toolbox” that are all very fast and that are useful in different situations. Those methods are quick sort, merge sort, and radix sort.

The Quick Sort


The quick sort algorithm is of the “divide and conquer” type. That means it works by reducing a sorting problem into several easier sorting problems and solving each of them. A “dividing” value is chosen from the input data, and the data is partitioned into three sets: elements that belong before the dividing value, the value itself, and elements that come after the dividing value. The partitioning is

Saturday 7 January 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 2

Predict the output or error(s) for the following:


1)

#include<stdio.h>

main()

{

  char s[]={'a','b','c','\n','c','\0'};


  char *p,*str,*str1;


  p=&s[3];


  str=p;


  str1=s;


  printf("%d",++*p + ++*str1-32);


}

Answer:

M


Explanation:

Friday 6 January 2012

DotNet Frequently Asked Questions on Threading – 3

What are wait handles ?


Wait handles sends signals of a thread status from one thread to other thread. There are three kind of wait modes :-

  • WaitOne.

  • WaitAny.

  • WaitAll.


When a thread wants to release a Wait handle it can call Set method. You can use Mutex (mutually exclusive) objects to avail for the following modes. Mutex objects are synchronization objects that can only be owned by a single thread at a time. Threads request ownership of the mutex object when they require exclusive access to a resource. Because only one thread can own a mutex object at any time, other threads must wait for ownership of a mutex object before using the resource.

The WaitOne method causes a calling thread to wait for ownership of

Thursday 5 January 2012

Addressing Modes


  • Immediate

  • Direct

  • Indirect

  • Register

  • Register Indirect

  • Displacement (Indexed)

  • Stack


Immediate Addressing



  • Operand is part of instruction

  • Operand = address field

  • e.g. ADD 5


—   Add 5 to contents of accumulator


—   5 is operand




  • No memory reference to fetch data

  • Fast

  • Limited range


Direct Addressing



  • Address field contains address of operand

  • Effective address (EA) = address field (A)

Wednesday 4 January 2012

Sun Certified Java Programmer (SCJP) Questions

Which of the choices below can legally be inserted at the "insert code here" position in the following code?


class Parent
{


public void print(int i)


{
}


}


public class Child extends Parent
{


public static void main(String argv[])
{
}


// insert code here


}


Choices:

A. public void print(int i, byte b) throws Exception {}


B. public void print(int i, long i) throws Exception {}


C. public void print(long i) {}


D. public void print(int i) throws Exception {}


E. public int print(int i)


Correct choices:

A, B, and C


Explanation:

Tuesday 3 January 2012

What is the easiest sorting method to use?

The answer is the standard library function qsort(). It’s the easiest sort by far for several reasons:

It is already written.
It is already debugged.
It has been optimized as much as possible (usually).


The algorithm used by qsort() is generally the quick sort algorithm, developed by C. A. R. Hoare in 1962.

Here is the prototype for qsort():

void qsort(void *buf, size_t num, size_t size,

int (*comp)(const void *ele1, const void *ele2));


The qsort() function takes a pointer to an array of user-defined data (buf). The array has num elements in it, and each element is size bytes long. Decisions about sort order are made by calling comp,

Monday 2 January 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc - 1

Predict the output or error(s) for the following:


1)

main()

{

static char names[5][20]={"pascal","ada","cobol","fortran","perl"};


int i;


char *t;


t=names[3];


names[3]=names[4];


names[4]=t;


for (i=0;i<=4;i++)


printf("%s",names[i]);


}

Answer:

Compiler error: Lvalue required in function main


Explanation:

Sunday 1 January 2012

DotNet Frequently Asked Questions on Threading - 2

What are Daemon threads and how can a thread be created as Daemon?


Daemon thread's run in background and stop automatically when nothing is running program. Example of a Daemon thread is "Garbage collector". Garbage collector runs until some .NET code is running or else its idle.
You can make a thread Daemon by
Thread.Isbackground=true

When working with shared data in threading how do you implement synchronization ?


There are certain situtations that you need to be careful with when using threads. If two threads (e.g. the main and any worker threads) try to access the same variable at the same time, you'll have a problem. This can be very difficult to debug because they may not always do it at exactly the same time. To avoid the problem, you can