shamuntoha Posted December 1, 2008 Share Posted December 1, 2008 php interview asked few questions. i failed to answer it in 1 minute. does anyone know it? Q.1 what is the x and y value ? x+y = 3 x-y = 4 Q.2 what is the result? {1, 2, 3, 4, 6} Quote Link to comment https://forums.phpfreaks.com/topic/134991-php/ Share on other sites More sharing options...
Mchl Posted December 1, 2008 Share Posted December 1, 2008 Q1. That's elementary math being taught to kids 8 or 9 years old. And what's Q2 about? Quote Link to comment https://forums.phpfreaks.com/topic/134991-php/#findComment-703036 Share on other sites More sharing options...
haku Posted December 2, 2008 Share Posted December 2, 2008 Never seen anything like question 2. I wouldn't even know what to do with it. But I could do number 1 in my head. Quote Link to comment https://forums.phpfreaks.com/topic/134991-php/#findComment-703720 Share on other sites More sharing options...
Mchl Posted December 2, 2008 Share Posted December 2, 2008 The second one is strange. It looks like part of the task is missing. Quote Link to comment https://forums.phpfreaks.com/topic/134991-php/#findComment-704155 Share on other sites More sharing options...
lowrider.v.7.0 Posted December 2, 2008 Share Posted December 2, 2008 Both questions are completely weird........... Q 1 ..... in both equations the value of x and y cannot be same ? If some one does get it please let me know Q 2 ..Looks like a set of numbers........without any motive.........senseless completely ;D Quote Link to comment https://forums.phpfreaks.com/topic/134991-php/#findComment-704172 Share on other sites More sharing options...
Mchl Posted December 2, 2008 Share Posted December 2, 2008 Q 1 ..... in both equations the value of x and y cannot be same ? If some one does get it please let me know Oh yes they can... come on... that's ridiculously easy. Quote Link to comment https://forums.phpfreaks.com/topic/134991-php/#findComment-704186 Share on other sites More sharing options...
corbin Posted December 2, 2008 Share Posted December 2, 2008 php interview asked few questions. i failed to answer it in 1 minute. does anyone know it? Q.1 what is the x and y value ? x+y = 3 x-y = 4 Q.2 what is the result? {1, 2, 3, 4, 6} I've always heard Q1 called a "system of equations." Like others have said, that one is quite easy. Ones with 3+ variables and exponents (above 1, of course) are a bitch (not hard, just time consuming). The basic concept is this: a + b = c b - c = e If you can find the value of one of the variables in terms of the others, you can get it to something solvable: b = -a + c So: b - c = e is equiv to -a + c - c = e, so -a = b. (You would of course need a constant in there before you could solve for real numbers.) So, to solve your question 1, it would be: x+y = 3 x-y = 4 x = -y + 3 -y + 3 - y = 4 -2y = 1 y = -1/2 x = 1/2 + 3 x = 3.5 Then, to check 3.5 + (-.5) = 3, 3.5 - (-1/2) = 4 Quote Link to comment https://forums.phpfreaks.com/topic/134991-php/#findComment-704406 Share on other sites More sharing options...
haku Posted December 3, 2008 Share Posted December 3, 2008 Or to shorten that into words: Solve for either X or Y in one equation. Substitute that value in the first equation, and solve for the other one. Take the answer from that and substitute it into the original equation and solve for the first variable. Quote Link to comment https://forums.phpfreaks.com/topic/134991-php/#findComment-704512 Share on other sites More sharing options...
corbin Posted December 3, 2008 Share Posted December 3, 2008 Eh yeah. I just had nothing better to do... Get kinda overboard on posts sometimes ;p. Quote Link to comment https://forums.phpfreaks.com/topic/134991-php/#findComment-704593 Share on other sites More sharing options...
haku Posted December 3, 2008 Share Posted December 3, 2008 No worries - I thought both go well in combination with each other. Some people work better with number explanations, some work better with word explanations. Quote Link to comment https://forums.phpfreaks.com/topic/134991-php/#findComment-704595 Share on other sites More sharing options...
dclamp Posted December 3, 2008 Share Posted December 3, 2008 Q.2 what is the result? {1, 2, 3, 4, 6} result is some one who cant count to 6. Quote Link to comment https://forums.phpfreaks.com/topic/134991-php/#findComment-704629 Share on other sites More sharing options...
corbin Posted December 3, 2008 Share Posted December 3, 2008 Whoa I just noticed something! There's no 5. Didn't see that before. But still, wtf? It's just a set of numbers. Quote Link to comment https://forums.phpfreaks.com/topic/134991-php/#findComment-704632 Share on other sites More sharing options...
pyrodude Posted December 6, 2008 Share Posted December 6, 2008 Similar to corbin, I solved #1 by solving for 1 of the variables, except I did it by adding the equations (since the y's cancel eachother out) x + y = 3 x - y = 4 --------- 2x = 7 --------- x = 3.5 then plug the 3.5 in for x and voila. It shaved a little time off for me (and/or a little paper if you were writing it out) but it would only work if one of the variables cancelled out. Quote Link to comment https://forums.phpfreaks.com/topic/134991-php/#findComment-708063 Share on other sites More sharing options...
Mchl Posted December 6, 2008 Share Posted December 6, 2008 I've actually created main matrix for this set of equations | 1 1 | W = | 1 -1 | And also Cramer's matrices for each variable | 3 1 | Wx = | 4 -1 | | 1 3 | Wy = | 1 4 | Then I calculated determinants for each of them det(W) = -2 != 0 det(Wx) = -7 det(Wy) = 1 And calculated both variables using Cramer's rule x = det(Wx)/det(W) = 3.5 y = det(Wy)/det(W) = -0.5 Now. Who solved this using graphical method? Quote Link to comment https://forums.phpfreaks.com/topic/134991-php/#findComment-708070 Share on other sites More sharing options...
Vermillion Posted December 7, 2008 Share Posted December 7, 2008 ... Do they actually ask you to resolve those systems with two variables? I have been learning PHP on my own time and in school we don't know any programming languages whatsoever, so I have never taken such test. Why do you need to take a PHP test? Quote Link to comment https://forums.phpfreaks.com/topic/134991-php/#findComment-708290 Share on other sites More sharing options...
Mchl Posted December 7, 2008 Share Posted December 7, 2008 I suppose that when you want to hire a programmer, you wan't to hire one that knows basic maths. Quote Link to comment https://forums.phpfreaks.com/topic/134991-php/#findComment-708399 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.