Answer the question
In order to leave comments, you need to log in
Books for learning fundamentals and logic?
Hello! Now I went to an interview to get an internship. Initially, they knew that I did not know Python, but only read it for a week.
We decided to set tasks 2. They wanted to see how I would solve them.
1) Two hands on the clock. One for 12, the other is unknown. They are 45 degrees apart. Find what time it is.
2) Given a matrix. It has 4 columns and 4 rows. Numbers are unique. Suggest an algorithm for finding the number 55.
I said something hesitantly and the interview was actually finished.
And just walking down the street to work, I realized that for the clock you need to determine angles of 90 degrees, mark the time, then 45 degrees and then 15.
And for the matrix, you can find all numbers that are multiples of 5 and display the largest in the range from 1 to 60. For example.
What was it?) excitement and brain loss or what? Insecure knowledge? No base? Tell me what to read on:
1) Algorithms
2) Discrete mathematics
3) What else?
Answer the question
In order to leave comments, you need to log in
what is the answer to the first question? Oo
I only see 4 states. but none of these states can exist. cannot be 13.5 hours 00 minutes or 22.5 hours 00 minutes. or 12 hours 7.5 minutes or 11 hours 52.5 minutes. because nowhere can the hand be exactly at 12 o'clock
I think you won't mind if I leave links to books: =)
forcoder.ru/about-coding/obektno-orientirovannoe-p...
forcoder.ru/about-coding/teoriya-i-praktika-yazyko...
forcoder.ru/ about-coding/informatika-uchebnik-dlya...
These books I read while studying at a technical school gave a good mastery of algorithms, logic and the basics of OOP.
The first task is the school and the thinker. No algorithms here will help you if you do not see that there are 4 solutions and how to find them.
For the first task, it was similar in the training interviews of the hexlet. In this case, everything is generally simple, 12 can be either hourly or minute, 45 degrees clockwise and counterclockwise. We take the clock in our hands and note all 4 situations. On the second I do not understand why you decide so? In any case, this will be worse than comparing each element of the matrix with 55. In the worst case, there will be N (in our case 16) operations. Have you accurately formulated the problem? For algorithms, read coremen, for Anderson's discrete mathematics. But for these two tasks, neither one nor the other is needed.
Both tasks were on the logic, because. you were asked to find answers to simple questions.
You flunked the interview because thought about how you will pass it, and did not deal with solving problems.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question