Topic — Add New » Posts Last Poster Freshness
Interview Question for Software Engineer/Developer (Fresher) about C++ 4 kartik 3 days

Which function is more efficient?

int rows=20000;
int col=30000;
void func1()
{
    for(i=0;i<rows;i++) {
        for(j=0;j<col;j++)
           print(a[i][j]);
    }
}

void func2()
{
for(j=0;j<columns;j++) {
for(i=0;i<rows;i++)
print(a[i][j]);
}
}
FB HACKER CUP QUESTION 1 geekologic 1 week

You are racing on a 2D lattice grid starting from the origin (0,0) towards a goal (M,N) where M and N are positive integers such that 0 < M <= N. There is a checkpoint that's neither on the origin nor on the goal with coordinates (m,n) such that 0 <= m <= M and 0 <= n <= N. You must clear the checkpoint before you reach the goal. The shortest path takes T = M + N steps.
At each point, you can move to the four immediate neighbors at a fixed speed, but since you don't wa...

Output of C program 3 PINTUGUPTAJUIT 1 week
#include<stdio.h>

int main()
{
  int i, j;
  int arr[4][4] = { {1, 2, 3, 4},
                    {5, 6, 7, 8},
                    {9, 10, 11, 12},
                    {13, 14, 15, 16} };
  for(i = 0; i < 4; i++)
    for(j = 0; j < 4; j++)
      printf("%d ", j[i[arr]] );

  printf("\n\n");

  for(i = 0; i < 4; i++)
    for(j = 0; j < 4; j++)
      printf("%d ", i[j[arr]] );

  return 0;
}
inbuilt container for building a balanced BST in stl c++ 1 gaurav 1 week

let say we want to build a binary search tree(BST) in a c++.
we can use a map for that.
map builts the "balanced" BST in the form of red black tree.

now we want to a built a balanced BST in which we also want to modify the contents of
internal nodes while inserting a node in bst.
e.g each node has a member 'count' which is equal to number of nodes in left subtree. In this case
we need to modify internal nodes too.
In this case which inbuilt contain...

Interview Question for Software Engineer/Developer (Fresher) about C++ 1 rajeev 2 weeks

code to find out all possible paths from source to destination of a graph numbered from 1 to n

system programming (can anyone explain the output) 2 kartik 2 weeks
#include <stdio.h>
#include <ctype.h>

void fn(int x, int y);

int main(void)
{
    int a = 4;
    int b = -4;

    printf("[%s, %s, %c]\n", "\12" "3", "\123", "\123");

    printf("[a: %d, b: %d]\n", a>>-1, b>>1);

    printf("Mod variants: 5,3 [Q: %2d, R: %2d]\n", 5/3, 5%3);
    printf("Mod variants: -5,3 [Q: %2d, R: %2d]\n", -5/3, -5%3);
    printf("Mod variants: 5,-3 [Q: %2d, R: %2d]\n", 5/-3, 5%-3);
    printf("Mod variants: -5,-3 [Q: %2d, R: %2d]\n", -5/-3, -5%...
Adobe Interview Question for Software Engineer/Developer about C++ 6 2 weeks

You have a library provided by the vendor. All you have is header files and library files.
Library contains the class Shape and there is whole hierarchy tree (i mean classes which derive from this base class).
Now you want to add some function "getArea" (not originally present in the class or any of its derived class) in the class "Shape" , you dont have the source code.

Using this library, you have written a lot of code. Now you have to make some changes so that, any objec...

Adobe
Can We instantiate a zero member class? 2 kartik 3 weeks

Can anybody tell whether we can instantiate a zero member class or not??
If yes what is the size of the object

eg:
Class A{

}

A a

Is it valid to create a...if yes what is the size of object a

Remote compilation 2 kartik 3 weeks

PLZ give an idea about how i can setup a server where a C/C++ compiler compiles and debugs programs uploaded by remote users.One might have seen this in [b]Bitwise-IIT Kharagpur[/b].

volatile and constant variable 4 sreeja 3 weeks

Can a variable be qualified with both const and volatile at the same time?

extern int const volatile *port;

Is the above code allowed in C/C++ programming?

friend and inheritance in C++ 3 Deepesh 1 month

Why does the following program work? show() is not a friend of class B.

#include<iostream>
using namespace std;

class A
{
protected:
    int x;
public:
    A() { x = 0; }
    friend void show();
};

class B: public A
{
public:
    B() : y (0) {}
private:
    int y;
};

void show()
{
    B b;
    cout << "The default value of A::x = " << b.x;
}

int main()
{
    show();
    return 0;
}
Adobe Written Test Question 3 Abhijeet 1 month
main()
{
              unsigned int y = -12;
              int x = -2;
              if (x>y)
                   printf ("x is greater\n");
              if (x<y)
                   printf("y is greater\n");
}

Predict the output of the code snippet.

Answer is - x is greater.

I executed this on Linux Terminal. Can anyone please explain why x is greater even though it is -2 and y is 12?

A C++ constructor question 2 1 month

what is dummy constructor in C++?

please solve this sorting questions 4 bharat 1 month

can it be possible to sort 6 numbers with help of 9 comparison using comparision sorts only?
like numbers are 6 3 2 5 4 1 or in any order?

Adobe Interview Question for Software Engineer/Developer (Fresher) about Algorithms, Aptitiude, C++, 3 beacon 1 month

Given 2 trees A and B find if tree B is a subtree of Tree A or not. Provide the most optimized solution that you can think of.

Adobe
Adobe Interview Question for Software Engineer/Developer (Fresher) about Aptitiude, Arrays, C++, Dat 3 remo 1 month

Predic the output of the following code snippet.

main()
{
char *ch1 = "Rajesh";
char *ch2;
ch2 = (char *)malloc (20);
memset (ch2.0.20);
while (*ch2++ = *ch1++)
printf("%s\n",ch2);
}

The answer is empty output or no output. I executed this on Linux terminal but it shows a few blank lines followed by the Prompt.

Can anyone please explain what this function is trying to do and why do we get a few blank l...

Adobe
deque in c 1 1 month

can any1 post c code of deque using array ....i tried but i got sm error--->><help>

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#define size 6
int q[size];
int r1=-1;
int r2=-1;
void FEnqueue()
{ int c;
  if(r1==0)
  printf("\nYOU cannot insert in front\n");
  else
  printf("\nEnter element:\n");
  {scanf("%d",&c);
  q[++r1]=c;
  }
}
void REnqueue()
{ int c;
  if(r2==(size-1))
  printf("\nYOU cannot insert in front\n");
  else
  {printf("\...