^ *Exactly,* Things are the *same all around the globe *in terms of hiring procedure for programming positions. However I don't understand *this is India *part? Kindly reply only *when you think you are contributing something to the community.*
Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Thu, Dec 13, 2012 at 10:27 AM, rahul <rahulr...@gmail.com> wrote: > @don , becoz this is India...and shit happens everywhere.... > > > On Wed, Dec 12, 2012 at 11:48 PM, Don <dondod...@gmail.com> wrote: > >> I dislike interview questions which place arbitrary restrictions on >> the solver. >> It may be a good puzzle, but it's not a good interview question. >> >> "Print the numbers 1 to 100 without using a loop." >> >> Why would you want to do that? >> >> "Divide a number by 5 without using the divide operator." >> >> Again, why? Interview questions shouldn't be about silly little >> tricks, but about showing that you can do a real-world job. >> >> Don >> >> On Dec 11, 10:23 pm, saurabh singh <saurab...@gmail.com> wrote: >> > I would have replied back with I am doing it with C programming language >> > only. the read function that we use is not an actual system call. It >> > is a *wrapper >> > to a system call*. Any other function that we use usually ends up in >> > calling some system call. The actual system call is called by low level >> > routines. >> > If he still disagreed I would have given him this solution: >> > >> > #include<stdio.h> >> > int main() >> > { >> > int ch; >> > while((ch=getchar())!=-1) putchar(ch); >> > return 0; >> > >> > } >> > >> > Would have run this as *./a.out < file_to_read* >> > * >> > * >> > If he still disagreed I would have walked out :P >> > >> > Saurabh Singh >> > B.Tech (Computer Science) >> > MNNIT >> > blog:geekinessthecoolway.blogspot.com >> > >> > On Tue, Dec 11, 2012 at 11:23 PM, manish untwal < >> manishuntw...@gmail.com>wrote: >> > >> > >> > >> > >> > >> > >> > >> > > i answered with the...system call too..but he said...do it in C >> > > programming language only don't use...system call here!! >> > >> > > On Tue, Dec 11, 2012 at 10:32 PM, saurabh singh <saurab...@gmail.com >> >wrote: >> > >> > >> stdin is a file pointer. >> > >> freopen returns a file pointer.. >> > >> I suggest using read system call. >> > >> > >> For the second question it would be simply >> > >> (len)!/((frequency_0)!*(frequency_1)!*(frequency_2)!.......) >> > >> > >> However this will also contains permutations which begin with 0. So >> > >> subtract the number of permutations that begin with 0 from this >> number. >> > >> > >> Since any factorial in the denominator part will be less than or >> equal to >> > >> (len)! we can calculate and store them while calculating len! Hence >> the >> > >> overall operation will take O(len) time which would be O(log n) >> where n is >> > >> the number. >> > >> > >> Saurabh Singh >> > >> B.Tech (Computer Science) >> > >> MNNIT >> > >> blog:geekinessthecoolway.blogspot.com >> > >> > >> On Tue, Dec 11, 2012 at 11:02 AM, amrit harry < >> dabbcomput...@gmail.com>wrote: >> > >> > >>> 1st: >> > >> > >>> freopen("filename","r",stdin); >> > >> > >>> while(scanf("%s",str)!=-1) >> > >>> { >> > >>> printf("%s\n",str); >> > >>> } >> > >> > >>> On Sun, Dec 9, 2012 at 3:22 PM, manish untwal < >> manishuntw...@gmail.com>wrote: >> > >> > >>>> I gave this interview in August this year, two of the question i >> was >> > >>>> not able to answer properly >> > >>>> 1) how to print the content of file in C without using the file >> pointer. >> > >>>> 2) count the total number of permutation of a number in order O(n) >> > >> > >>>> -- >> > >> > >>> -- >> > >>> Thanks & Regards >> > >>> Amritpal singh >> > >> > >>> -- >> > >> > >> -- >> > >> > > -- >> > > With regards, >> > > Manish kumar untwal >> > > Indian Institute of Information Technology >> > > Allahabad (2009-2013 batch) >> > >> > > -- >> >> -- >> >> >> > -- > > > --