Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Site Related Forums
 The Yak Corral
 interview question

Author  Topic 

ace333
Starting Member

11 Posts

Posted - 2005-09-20 : 13:23:55
What initial values of a and c are required such that the final values of a and b are:


a = 32
b = 4



int a,b,c

a = ?
b = 0
c = ?

for( b=0; a<12; b++ )
{
a = (a+a) * c;
}


Kristen
Test

22859 Posts

Posted - 2005-09-20 : 13:36:04
What's the point of an interview question like that?

Hang on ... is "a" salary and "c" benefits?

Kristen
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-09-20 : 13:41:07
i like the for...
b increases but is never used.
nice and optimized algorithm


Go with the flow & have fun! Else fight the flow
Go to Top of Page

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-09-20 : 13:45:01
(a,c) - (-4,-1)
edit:
also (a,c) - (.5,2)

Corey

Co-worker on The Wizard of Oz "...those three midgets that came out and danced, the freaked me out when I was little. But they are ok now."
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-09-20 : 13:47:56
"b increases but is never used"

Amazing isn't it!

It reminds me of what Senior Management do. CC it.

Which is, of course, a euphemism for Complete Crapola!

Kristen
Go to Top of Page

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-09-20 : 14:00:58
Kristen - you mean senior managers do something!!!



steve

Facts are meaningless. You could use facts to prove anything that's even remotely true!
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-09-20 : 14:03:10
"you mean senior managers do something"

I do </yawn>
<edit><yawn> I do </yawn></edit>

Kristen
Go to Top of Page

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2005-09-20 : 15:17:30
quote:
Originally posted by Kristen

"you mean senior managers do something"

I do </yawn>




Kristen, is that a demonstration of what you do: write badly formed XML?
Go to Top of Page

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-09-20 : 16:17:00
no... he sleeps

Corey

Co-worker on The Wizard of Oz "...those three midgets that came out and danced, the freaked me out when I was little. But they are ok now."
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-09-21 : 00:06:33
this is more of a school problem than an interview question

--------------------
keeping it simple...
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-21 : 02:04:22
quote:
Originally posted by Kristen

"you mean senior managers do something"

I do </yawn>

Kristen


Because you are exceptional


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-09-21 : 03:12:29
Kristen you can't be a senior manager - you appear to have a sense of humour - unless of course you're really a bot



steve

Facts are meaningless. You could use facts to prove anything that's even remotely true!
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-09-21 : 05:00:07
"unless of course you're really a bot"

My bot has goe back and fixed itself :)

Kristen
Go to Top of Page
   

- Advertisement -