Welcome, Guest: Join Nairaland / LOGIN! / Trending / Recent / New
Stats: 2,773,858 members, 6,606,332 topics. Date: Saturday, 27 November 2021 at 09:12 PM

Computer Science/programming Challenging Questions - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Computer Science/programming Challenging Questions (11122 Views)

What's The Most In-demand Field Of Computer Science/programming? / How To Get Your First Data Science/programming Job / For Computer Science Students (2) (3) (4)

(1) (2) (3) (Reply) (Go Down)

Computer Science/programming Challenging Questions by airsaylongcon: 3:04am On Feb 29, 2016
after a 30 page brutal war with seunthomas, a legend on the programing section (no disrespect implied or intended) I have observed that loads of programmers here are very good at what they do. However there seems to be a dearth in "academic" knowledge of the fundamentals of our profession. To this end I would like to use this thread to gauge our knowledge of the key fundamentals of computing. I have access to a set of questions that left me gasping for air when I tried to solve them. I would like to share these questions with other geek heads here for us to try and solve them while explaining our solutions. Perhaps we can develop the ability to solve "academic" computing questions which are crucial as multinational software Corporations throw these kind of questions to their recruits. All of thee questions are multiple choice questions and while I do have the answers, I do not have explanations of how the answers were arrived at. So the key task here is not the just to mention the answer but to explain the reasoning behind your choice.

If I get 20 views or 5 responses then I will start posting questions and I will really be glad to rub minds with y'all super geeks

1 Like

Re: Computer Science/programming Challenging Questions by WhiZTiM(m): 4:06am On Feb 29, 2016
*driver, park me here!* ... *books space* ...
Watching the coders....
Re: Computer Science/programming Challenging Questions by Naijaepic: 7:10am On Feb 29, 2016
OK. I am here
Re: Computer Science/programming Challenging Questions by seunthomas: 7:15am On Feb 29, 2016
Well since this is not about arguments, then fire away. Are we allowed to think outside the box? Cos most times programming questions are restrictive and tend not to look at all possibilities.....
Re: Computer Science/programming Challenging Questions by Nobody: 7:44am On Feb 29, 2016
*Spreads mat*
Re: Computer Science/programming Challenging Questions by adexsimply(m): 8:12am On Feb 29, 2016
Oya, continue
Re: Computer Science/programming Challenging Questions by FincoApps(m): 8:59am On Feb 29, 2016
airsaylongcon, I think you have enough people following this thread now so can you start smiley)
Re: Computer Science/programming Challenging Questions by Nobody: 9:07am On Feb 29, 2016
For the record, I did not study computer science, picked up my skills from the "streets". So i generally find this kind of thread interesting.
Re: Computer Science/programming Challenging Questions by thewebcraft(m): 9:42am On Feb 29, 2016
smiley
Re: Computer Science/programming Challenging Questions by Nobody: 10:02am On Feb 29, 2016
This dude must be out of data or something, just called your passengers into the bus and disappeared.
Re: Computer Science/programming Challenging Questions by Onyiibazz: 10:19am On Feb 29, 2016
Ok, let me park here
Re: Computer Science/programming Challenging Questions by Drniyi4u(m): 10:27am On Feb 29, 2016
....following
Re: Computer Science/programming Challenging Questions by airsaylongcon: 11:51am On Feb 29, 2016
Waoh! I'm sorry guys I've been stuck with a lot of work at my desk this morning. I will have a lunch break at 1pm then I can start firing missiles. Please endure with me
Re: Computer Science/programming Challenging Questions by airsaylongcon: 12:08pm On Feb 29, 2016
OK warm up with this. Remember that these are exam questions meant to be answered in approximately 2 minutes. Without the use of a compiler or stuff like that

Consider the following function
double p (double b, unsigned int e)
{
if (e==0)
return 1.0;
else
if (even(e))
return p(b*b, e/2);
else
return p(b*b, e/2)*b;
}

How many multiplication are executed as a result of the call p(5.0, 12). Divisions SHOULD NOT be included in this total
Re: Computer Science/programming Challenging Questions by asalimpo(m): 2:54pm On Feb 29, 2016
By my calculation: 6.

My working.
12 divide repeatedly by 2 gives:
12,6,3,1,0. Including the first argument,12.
The first 2 even numbers generates 1 multiplication each, thats 2 .
The odd number 3,generates 2 multiplications.
1 generates 2.
0 generates no multiplication.
Total=6.

3 Likes

Re: Computer Science/programming Challenging Questions by Nobody: 5:50pm On Feb 29, 2016
My brain has encountered a cyclic redundancy plus stackoverflow error. . . .

1 Like

Re: Computer Science/programming Challenging Questions by airsaylongcon: 7:28pm On Feb 29, 2016
asalimpo:
By my calculation: 6.

My working.
12 divide repeatedly by 2 gives:
12,6,3,1,0. Including the first argument,12.
The first 2 even numbers generates 1 multiplication each, thats 2 .
The odd number 3,generates 2 multiplications.
1 generates 2.
0 generates no multiplication.
Total=6.


The options available are 12,9,8,6,5
Re: Computer Science/programming Challenging Questions by danidee10(m): 9:56pm On Feb 29, 2016
@airsaylongcon drop something hotter....I'll never stress myself figuring this out.....when I can just disobey you and increment a counter

Drop something that we can't solve easily even if we use a compiling compiler grin
Re: Computer Science/programming Challenging Questions by airsaylongcon: 10:51pm On Feb 29, 2016
This one is deep. Old school Pascal programming.

var a, b, c :integer;
read (c) ;
a:=1;
b:=1;
while a <10 do
begin
b=b*a;
a=a+1;
If a = c then exit
end


For the fragment of code above, which of the following statements about variables a and b must be true after execution of the fragment?

A) (b=(c-1)!) AND (a>=c)
B) (b=9!) AND (a=10)
C) (b=10!) AND (a=10)
D) ((b=10!) AND (a=10)) OR ((b=(c-1)!) AND (a=c))
E) ((b=9!) AND (a>=10)) OR ((b=(c-1)!) AND (a=c))
Re: Computer Science/programming Challenging Questions by asalimpo(m): 11:04pm On Feb 29, 2016
Whatabout those who dont use archaic /unpopular languages?
The language syntax alone will be a barrier to understanding the problem.

@danidee
Not every1 will cheat. Some want to learn.
@op
keep it graduated,from simplest to hardest. So that posters can attempt,correct and learn.

1 Like

Re: Computer Science/programming Challenging Questions by Nobody: 11:08pm On Feb 29, 2016
O boy, make una dey dilute these codes small small now, there are NOOBS and OLD-PEOPLE (like me) here.
My brain is running on 4GB SDRAM, with 1GB primary hard-drive - how can I possibly comprehend stuffs like: ((b=9!) AND (a>=10)) OR ((b=(c-1)!) AND (a=c))?
Re: Computer Science/programming Challenging Questions by asalimpo(m): 11:20pm On Feb 29, 2016
dhtml18:
O boy, make una dey dilute these codes small small now, there are NOOBS and OLD-PEOPLE (like me) here.
My brain is running on 4GB SDRAM, with 1GB primary hard-drive - how can I possibly comprehend stuffs like: ((b=9!) AND (a>=10)) OR ((b=(c-1)!) AND (a=c))?
this no be code matter at all. That's maths, factorials. I pity, the candidates that had to compute these under 2 minutes!

1 Like

Re: Computer Science/programming Challenging Questions by airsaylongcon: 11:25pm On Feb 29, 2016
asalimpo:

Whatabout those who dont use archaic /unpopular languages?
The language syntax alone will be a barrier to understanding the problem.


@danidee
Not every1 will cheat. Some want to learn.
@op
keep it graduated,from simplest to hardest. So that posters can attempt,correct and learn.

All of them look hard to me O. But I will try and pick and mix.

As regards the language, I can "translate" it into a more modern language
Re: Computer Science/programming Challenging Questions by airsaylongcon: 11:40pm On Feb 29, 2016
Okay so here's the translation in C++

int a, b, c;
cin>>c ;
a=1;
b=1;
while a <10 do
{
b=b*a;
a=a+1;
If a == c then exit
}

For the fragment of code above, which of the following statements about variables a and b must be true after execution of the fragment?

A) (b=(c-1)!) AND (a>=c)
B) (b=9!) AND (a=10)
C) (b=10!) AND (a=10)
D) ((b=10!) AND (a=10)) OR ((b=(c-1)!) AND (a=c))
E) ((b=9!) AND (a>=10)) OR ((b=(c-1)!) AND (a=c))
Re: Computer Science/programming Challenging Questions by airsaylongcon: 11:44pm On Feb 29, 2016
dhtml18:
O boy, make una dey dilute these codes small small now, there are NOOBS and OLD-PEOPLE (like me) here.
My brain is running on 4GB SDRAM, with 1GB primary hard-drive - how can I possibly comprehend stuffs like: ((b=9!) AND (a>=10)) OR ((b=(c-1)!) AND (a=c))?

All those na SYMBOLOGY now. Just basic AND & OR in programming mixed with factorial.
Re: Computer Science/programming Challenging Questions by Nobody: 7:08am On Mar 01, 2016
^^Basic keh? our own (dhtml18 and the noobs) don finish for here cry cry cry cry cry cry cry cry
Wait, has anyone seen guru1 and seunthomas? They are supposed to be participating on this thread now?
Re: Computer Science/programming Challenging Questions by seunthomas: 7:49am On Mar 01, 2016
Still waiting for the real questions..
Re: Computer Science/programming Challenging Questions by airsaylongcon: 8:22am On Mar 01, 2016
And these are fake questions?
Re: Computer Science/programming Challenging Questions by asalimpo(m): 8:57am On Mar 01, 2016
In java.
 

int a,b,c;
b=1; a=1;
c = Integer.parseInt(scanner.read());
//scanner is instance of //java.util.Scanner
while(a<10)
{
b*=a;
a++;
if(a==c) break;
}
Re: Computer Science/programming Challenging Questions by asalimpo(m): 9:34am On Mar 01, 2016
undecided cry

1 Like

Re: Computer Science/programming Challenging Questions by asalimpo(m): 9:37am On Mar 01, 2016
my choice is E. Will defend or edit later.

1 Like

Re: Computer Science/programming Challenging Questions by Nobody: 12:48pm On Mar 01, 2016
seunthomas:
Still waiting for the real questions..
And here he is, i love this dude, he does not dissapoint,
o yeah, @op, where are the real questions? All those factorials above are just to scare NOOBS (like me).
The phd grandmaster is now here to tackle all the "real questions" ASAP.

(1) (2) (3) (Reply)

C++ Beginner Discussion Room: Drop Your Codes / Wht Is CSS Very Complicating...!!!!!!!!!! / Data Scientists In Nigeria, Lets Talk

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2021 Oluwaseun Osewa. All rights reserved. See How To Advertise. 101
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.