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: