Solve the below logic problem in any of the programming languages C#, Javascript, .NET, Python or Pseudocode (it's a pilot test project and bigger project will be awarded based on quality of code and correctness of answer):
1. How do you want to get the result of multiplication by 15 without using * (multiply operation) and + (plus operations).
2. Suppose server S want to download real time video from one of existing media servers A, B, C, D. However the server S still doesn't know which media server is available and can provide the highest speed transfer.
Please write a simple code to make the server S chooses the fastest server using below function:
a. int get_speed(ServerID);
This function is used to get the transfer speed from Server[ServerID] to server S on HTTP protocol. The return value of this function is integer value. For example: get_speed(A) return 15, it means the transfer speed is 15 Kbps.
b. bool connect(server);
This function is to check the availability of the media server using RMTP (Real Time Message Protocol). This function will return true if the media server have the video source that can be streamed by server S. For example: connect(A) return true, it means server S can stream video from server A.
Hint:
get_speed(serverID) function only check the transfer speed of the media server using normal HTTP. It doesn't guarantee the media server is available. Example: Media Server A may provide the highest transfer speed, however there is no video source available in media server A. So in this case, server B may connect to other server.
Hi Sir/Madam.
I'm expert in Python programming and I can help You with those 2 problems. One question for problem 1, forbiden is only using operators * and + (sum and multiply as functions also)?
Best regards,
Fejs.
Hello,
i am a web designer and developer (asp.net) from india and also new on freelancer and i want to work on a large scale as well working with you so give me a chance to prove myself and my work i assure that you will not be disappoint.
I suppose your project needs more of an analytical thinker than an expert coder. I am an engineering student and I always bump into logical problems that needs to be solved in a quick and efficient way. Writing algorithms for such tasks is my major plus; other than that I can provide all the needs of the project in JavaScript and I am also good with C#. I am not comfortable with Ruby yet, but I am working on it. I don't know whether I should put the code for the little puzzles you gave here or not; so I'm leaving the first answer: X/(1/Y) gives X*Y; put 15 instead of X or Y, your choice. Looking forward to work with you and please feel free to contact me whenever it is needed.
i am a passionate developer, hope you may know that passionate people work with great interest, with great interest comes best output so i think i am the best for you to choose.
Hi,
I am new to the freelancing market but have more then 10 years of Python experience under various commercial and academic projects.
I will be a bit lazy answering your questions in Python:
1.
def times_fifteen(input):
return float(input)/(1./15.)
(I do realize this is not an exact solution if you are looking for numerical precision, that can be achieved by direct binary manipulation)
2.
fastest = max([ get_speed(ServerID)*connect(ServerID) for ServerID in [A, B, C, D]])
Best Regards,
Iliya Iliev