nitin1 15 Master Poster

wow. you are great bigpaw. yes, i know about AMZ environment. atmosphere is not that good at AMZ. but only problem was that i was not getting job. so i am depressed with that only. i dnt want AMZ, adobe etc, i want decent job with decent salary. true, worthful words you just said.

nitin1 15 Master Poster

actually, this is an interview question of a company which deals with adds on mobile phones. can anyone give me hint on this ? what can be the answer of this ? it is therotical question though.thanks.

nitin1 15 Master Poster

yes , i know. but he is saying same thing which you are saying but in a very rude manner. but the way u have said is not rude at all. (it is my opinion, may be i am wrong in this). atleast we must filter these words when anyone try to write these words. for ex dick and all... anyways thanks for your reply :)

nitin1 15 Master Poster

i have searched how to back up registry and all.. can you explain me little bit ? thnaks sir in advance.

nitin1 15 Master Poster

awesome suggestions. @mike comment is quite nice. @diafol sir, yes, you are right. but, i didn't know all these things as that was my first interview. in 4 companies, i have given 11 interviews till now. i am getting experienced and am trying to include all these things which you all have taught me. thanks mike, james sir and all others.

can you please tell me what should i ask them when they say me "any questions for me ? ", so what should i ask them ? can we discuss some 4-5 questions here ? i don't wana commit these mistakes again in future. thanks alot.

nitin1 15 Master Poster

@reverend Jim, i know you are a retired person, that's why i respect u alot. that doesn't mean u will become rude with me. okay ? if you are interested in giving answers, then atleast refrain urself from making these abusive and rude comments. P.S atleast try to see the topic of this thread first, then make these types of rude and careless comments. when i have said that hitler thing, i have said sorry, because i know i was wrong. atlast, i am not a dick.. you are a big dick. ok ? thanks. (atleast see the scenario, then make comments. i don't know how you live in a society!). and i will prefer to die rather than making you as my therapist. thanks now.

nitin1 15 Master Poster

@iamthwee.. can you elaborate more so that i can imporve ? please ?

nitin1 15 Master Poster

how are they better at selling themselves ? what does that exactly means ? :(

nitin1 15 Master Poster

actually, problems is the persons who are placed in DE shaw, they are dumbos. they have nt studied C, C++ never. just 10-15 days and some codes which they grab and what is the reasult ? they are placed and am not placed there. my status: i have solved more than 200 problems on codechef, 200 problms on SPOJ, 40 contests on codeforces and more than 50 questions on hackerrank. and result ? am rejected in last round of 3 companies. directi-top 4, DE shaw-top 6 and AMAZON: top 8. this is my status. what the hell the problem is ? my mates are gettimg placed who has never done coding in their 3 years. :(

nitin1 15 Master Poster

"Since you seem to hold me in some regard, what does that say about your expectations? ;)"... it didn't get this line.. can you explain it ?

actually today, again , DE shaw has rejetced me in last round. now AMAZON, DESHAW and directi , these 3 comapnies has taken me up till last rounds and then throw me away like hell....:'( what to do ? :(

nitin1 15 Master Poster

actually, i am demotivated with the rejections. i have got 3 rejections yet in directi (second-last round), AMZON(last round) and facebook (first round). how to make myself confident ? can you all help me in this also. this is totally different from computer science, but i think you all have gone through this time at some point of your life. if you can, help me somehow. am weak and demotivated. :(

nitin1 15 Master Poster

okay! i am using windows 7 ultimate 32 bit OS and MS office 2007 , i am using.

nitin1 15 Master Poster

when i click my any microsoft office's product then it start geetting installing. it is installed from 4-5 years and was wroking fine. it happened 10 days before. now i cant open my word, excel or any other file. when i try to unsitall it , it says "this product intallation is corrupted, try to install with the CD or DVD". this is when i try to uninstall it. when i install it, it says "you have error while installing it. ". i am strucked. i cant unistall, i cant install it again and i cant use it. what to do ? for the time being, tell me some temporray source where i can edit my word files and do my work properly. thanks.

nitin1 15 Master Poster

but i was shoot out from the AMAZON last round which had only 8 students, because i have asked interviewer something bad. he said "any questions ?". I said "sir, what exactly are you looking for while hiring us ? ". (i was a very general question). he said "we want hard working, innovative and sincere students and what he has done in 3 years of college life". i said "but it may happen that a person can do bad in interview but may be he has done alot in 3 years and he is creative and all, then how do you handle those cases?". he said "generally i doesnt happen, but if happen , then we will defenitely hire him because we want overall performnace." after 3 hours, they told me "sorry". after 1 day, i met one of the interviewer co-incidentally, he told me that his "senior" has said no to you because u asked some bad things to him otheriwse all 4 rounds response ws awesome for you.

P.S what do you think ? i am very depressed with this. i have asked casually and without any intension of saying something bad. i was quite excited to know about them and all. :(

nitin1 15 Master Poster

for each process , why i am giving so much virtual space ? if i dont need that much space then ?

and if i have so much space for 1 process, then i need too much memory for only 3 or 4 processes . right ? clearify this to me please.

nitin1 15 Master Poster

can we discuss the things like : what should we do , how should we behave , what not to do , what to do , how to feel comfortable in interview ? can we discuss these things ? what not to ask interviewers ?

nitin1 15 Master Poster

yeah!! sir i have read that link. sir when we say i have 2^32 virtual address space for a process , then what exacylt this means ? that means for each process , i can have 2^32 memory refereces ? can i have so much big virtual memory ? can you clearify this first, then i will talk about locality topic with you. thanks for your response. :-)

nitin1 15 Master Poster

can you please explain me what exactly it is ? i have read from my book, wiki link and 1 more link. i got some basic things, can you tell me how exactly this helps process and OS ? how this thing help us to implement cache ? i think this thing is the reason why we are able to use cache. please clear this concept. thanks alot.

nitin1 15 Master Poster

wow.... 101% same statement by me.... awesome.... :-) exactly same... actually, he gave a big smile after this. so i thought it is wrong that why he is smiling. :p yoo!! and these concepts are only because of daniweb. no issues.

nitin1 15 Master Poster
int ** foo(int row)
{
     int *arr[100];

     for(int i=0;i<10;i++)
     {
           arr[i]=malloc(sizeof(int)*10);
     }

     int **p=(int**)arr;

     return p;
}

what is the problem with this code snippet ? it is not a homework. it is my interview question.

nitin1 15 Master Poster

Declare an array of function pointers that return a pointer to a func that in turn return a pointer to a char array.

can you helpme in this . i have doubt in the last thing. if at the last it is "return a pointer to char", then i can write it , but that pointer to a char array confusing me alot. thanks

char*(*(*a[])())()

what to include so as to include pointer to char array, but not pointer to char. thanks.

nitin1 15 Master Poster
int A::* point_i = &A::i;

what does this statement is trying to do ? please elborate. what is *point_i is here ? and what all is this statement means ? thanks.

nitin1 15 Master Poster

@sepp2k you have made it so simple. i got it. i am explaining, tell me i am right or wrong. at first fork(), one process--> this make it 2 processes. now next statement is food for 2 processes now. now that 2 will be divided into 4. so like this last statement will be executed by 8 process which will make them 16 processes. so that if-else statements will be executed 16 times. out of which 8 are parent and 8 are children. so 8 are non-zero, 8 are zeros. so 8 times solaris will be printed.

am i right 100% ? if i am wrong at any point, please correct me. secodnly, explain me why is it neccasary to fflush the streams ? thanks.

thanks to all for your valuable responses.

nitin1 15 Master Poster

but if i want to know without running it ? then what will be my approach to it ?

nitin1 15 Master Poster

nopes,..... this is a well-defined question. we have to tell everything without running anywhere with proper and well-reasoned answer. if i run , code 1 is faster, still why ? thanks.

nitin1 15 Master Poster

no! nothing is given. muliple chices are there:

a) code 1
b) code 2
c) code 1 = code 2
d) none of these

nitin1 15 Master Poster
#include
main()
{
     int ret;
     ret=fork();ret=fork();ret=fork();ret=fork();
     if(!ret)
         printf("sun");
     else
         printf("solaris");
}

how many times sun will be printed and how many times solaris will be printed ? and reason also. i know the fundamentals of fork() but still not able to catch the o/p here. thanks.

alaa sam commented: nice question it made revisit a lot of concepts , i thinks its fully answered now +3
nitin1 15 Master Poster
Code 1 :
        for(i=0; i<1000; i++)
                for(j=0; j<100; j++)
                        x = y;

Code 2 :
        for(i=0; i<100; i++)
                for(j=0; j<1000; j++)
                        x = y;

thanks.

nitin1 15 Master Poster

@deceptikon awesome! your answers for 1,2,3,7 are really very very good. I will speak these lines now indeed. ;)

in answer 4, can you elborate more that answer ? what can be the needs he can mention when i will ask that question to him ?

in answer 6th, "getting angry" only means getting angry. for ex: when do you get irritated while working ? when do you get impatient ?. what is that moment ? which moment can make you angry ?

in answer 5th, what else ? can we add something more to it ?

:-) A BIG THANKS #respect !!

nitin1 15 Master Poster

@both yeah... i am getting what u trying to say. i think confidence MUST be there whether i am preprared very well or not. because that is the key to success. If we have started this thing and also you are also very well experienced persons, can you please tell me how to answer these questions say

1. Why amazon ?
2. what will you do if you get offer from google after getting offer from us ?
3.what are your weakness ?
4.how can you contribute to amazon ?
5. what do you expect from amazon/microsoft/....etc..?
6. on what point do u get angry ?
7. why should we take you if another candidate with same potential as you is standing in front of us and we have to take only one (no further rounds)?
nitin1 15 Master Poster

but, if i am average technical person, then how can they know if i am good at all these things which jorge mentioned ? they will take my interview for atmost 1 hour or 1.5 hour(wprst case). for this time, anyone can pretend something fake. it is thing which we know after spending some time with that person. do u think 1 hour is sifficient ?

nitin1 15 Master Poster

actually, i am quite tensed these days. all companies are going to shower next month. i am preparing since last 2 months. C, C++, DS, ALgos, DBMS, OS, OOP, networking, projects etc which i have done and which am still doing. but lacking confidence. feeling as if i will not be able to get into any one of them. thanks

nitin1 15 Master Poster

iamthwee then can you give me some link ?

nitin1 15 Master Poster

respect, respect respect sir!! a bow to you.

actually, i have 6 7 days left for preparaing all these stuff. having book in my hand will take too much time of mine. 3rd book i have seen in my college library 2-3 weeks ago. so what should i do ? you tell me. :( i have to do apti, puzzles, (LL,arrays, trees), OS, DBMS, netwroking, OOPS, some unix commands (to pretend that i know something about unix.) now tell me. :-(

nitin1 15 Master Poster
class A {
public:
protected:
  int i;
};


class B : public A {
  friend void f(A*, B*);
  void g(A*);
};

void f(A* pa, B* pb) {
//  pa->i = 1;
  pb->i = 2;

//  int A::* point_i = &A::i;
  int A::* point_i2 = &B::i;
}

void B::g(A* pa) {
//  pa->i = 1;
  i = 2;

//  int A::* point_i = &A::i;
  int A::* point_i2 = &B::i;
}

void h(A* pa, B* pb) {
//  pa->i = 1;
//  pb->i = 2;
}

int main() { }



class A {
public:
protected:
  int i;
};


class B : public A {
  friend void f(A*, B*);
  void g(A*);
};

void f(A* pa, B* pb) {
//  pa->i = 1;
  pb->i = 2;

//  int A::* point_i = &A::i;
  int A::* point_i2 = &B::i;
}

void B::g(A* pa) {
//  pa->i = 1;
  i = 2;

//  int A::* point_i = &A::i;
  int A::* point_i2 = &B::i;
}

void h(A* pa, B* pb) {
//  pa->i = 1;
//  pb->i = 2;
}

int main() { }

why line 25 is a error here ? please explain in detail. thanks. firstly, explain me line 25.i am learning inheritance. thanks.

nitin1 15 Master Poster

yes ddanbe.. i am talking about OOP... object orinted programming . like inheritance , polymorphism (in C++ basis).

@rubberman. which book you will recommend now ? as you say, i will have that knowledge first. so ?

nitin1 15 Master Poster

I want practical knowledge. that book has bookish type knowledge. @sourtik

nitin1 15 Master Poster

actually, I was reading C++ from some time , but here i want to learn and imprve my OOPS concepts. IF you have some good links or some e-books or some good book name , please help me here. i have learnt from wiki, my one C book in which some 4-5 pages were given on oops. thanks alot in advance.

nitin1 15 Master Poster

my algo :

1.Construct a max(min) heap from first element of all array,
2. extract a max(min) value from the heap and write to output
3. get one more element from array which the value extracted step 2 was in.
4. repeat until heap is not empty

can anyone tell me complexity of this ? according to me it is mnlogm where m is no of arrays and n is no of elements in each array. thanks.

secodnly, can we do better than this ? i have m sorted arrays and n elements in each array. i have another array of m*n elements space. so how can i merge it in most efficient way ? thanks. one of algo is given above , can we think of better ? thanks.

nitin1 15 Master Poster

hmm...

firstly procedure is :

va_list ap;
va_start(fmt,ap);
then you can extract the variable agruments one by one using the va_arg(ap,type)

. simple!

If, you want to use va_list again for the same variable arguments, then end it first. how ? using va_end(ap); . now what ? now again repeat my procedure which i have given above. that's set. thanks. :-)

nitin1 15 Master Poster

@ancient dragon.. that one will use the too much space. because my text can be of miliions of characters of even more. so doing this is not good way. thanks for this , but can we think of anything more better ?

nitin1 15 Master Poster

I was looking for the find and replace algorithm which editor softwares are using. for ex: notepad. when i search something and then when i replace it , how exactly it works. I am aware of rabin-karp and KMP algos. but i am wondering if they are most efficient ? and how do they replace it ? Seraching is okay, may be KMP can be applied, but replacing has some cases like when replaced words is of greater length and when it is of smaller length. Can you explain or give some link to it ? how will you shift whole text after that word in efficient way. thanks.

nitin1 15 Master Poster

sir, malloc guarntess that memory allocated is contigous right ? that's why this code will solve my problem ? if contigous memory is not there, then it will return NULL which you have checked also.
correct me please. thanks.

nitin1 15 Master Poster

true!! that's what i have thought when read this question. yeah..i think that this question needs more info. And, that is big oh, not little oh. i am aware of both of them but here it is big oh. if it is little oh, then will it make any difference ? i hope "no".

secodnly, sir, can you clear my one thing that O(f(n)+g(n)) = O(max(f(n),g(n))) ? is it true ? ANd , O((fn)*(g(n)) = O(max(fn,gn)) ? can i say this thing ?

My thinking : I think first one is correct and second one is wrong.I am not sure though. thanks a lot.

nitin1 15 Master Poster

An algorithm runs a given input size n.If n is 4096,the run time is 512 ms .If n is 16384 the run time is 2048 ms .what is the complexity of the algorithm in big-o notaion ?
a)o(n^1/2)
b)o(n)
c)o(nlogn)
d)o(n^2)
o() is big-oh!

is it logical ? I have seen this on some website. can we guess the answer or this is some non-sense ? please explain. thanks.

nitin1 15 Master Poster

thanks rahul. but i am talking about the implementaion part. i already know all these things. thanks for reply.

nitin1 15 Master Poster

sir, but if question is like this :

i have little confusion: if a[3][3] is defined and you are given a[0][2] address(32114) and you are asked address of a[1][0] , isn't it 32118 (on 32-bit compiler) ? if not, then what should i answer to this question ? thanks in advance sir.

nitin1 15 Master Poster

can you please tell me how rand () is implemented ? i know it is library implementaion dependent. but still can you tell me the way in which it is mostly implemented ? i have searched on google, but didn't get anything which make me clear about my question. i want to know algo or which code snippet are they using and how srand() helps that function ? thanks.

nitin1 15 Master Poster

that girl looks really nice!! i must say.. better than here's weather... :-)

nitin1 15 Master Poster

cofee with icecream... butter scotch and cold cofee with high caffine... :-)