What questions to ask at the interview

    Each developer from time to time searches for work and passes interviews. Someone wants to try something new, get a bigger salary or get into the company that he always dreamed of. This event did not pass me by.

    Having visited many companies, I decided to share observations on how the recruitment of specialists most often takes place, including a technical interview and just talking with potential colleagues. And then offer your ideas for improving the generally accepted process.

    So that in the end the interview does not look for the applicant as:


    First of all, the article will be useful to anyone who is looking for work in the iOS development environment or is somehow connected with a set of IT specialists: conducts technical interviews or any others.

    And welcome to cat.

    Introduction


    I want to note that I consider myself a person of result. Any actions, including self-education, should be aimed at achieving a specific goal or solving a specific problem. When I had an interview in my company, I always tried to ask something useful in practice, to understand how the applicant will behave in the “hostilities”, what he will do to implement this or that module, or how he will deal with a certain bug.

    So, I was struck by the fact that out of more than a dozen quite large organizations I visited, with offices in the center, voluminous secretaries, curling irons and other attributes of a pathos office, absolutely everyone asks only for stuff.

    Unrefined 100% theory without any connection with practice. No one asked how I think, approach the tasks, how I would catch non-standard crashes, look for reasons for poor performance in the application and solve other everyday problems that the developer faces every day. Everyone was interested only in the difference between ARC and MRC and the varied dullness that was never needed in my life. For example: how does the structure of the xib file differ from the structure of the storyboard file. It is the file. Such a useful thing. Every day I poke around in xml.

    This does not mean that they sent me everywhere and I came to whine on Habr. In most cases, everything went well, except with a few exceptions. And if somewhere I ran into a frank knowledge gap, then by the next interview he had already been successfully mastered. And sometimes even a simple conversation with the future leadership compensated for a technical interview that was not very successful (in my opinion).

    This article could become an ordinary whining about the imperfection of the world, but I decided to put out the maximum benefit and make a list of questions on which you can really assess the real usefulness of the candidate, and not just the level of his theoretical knowledge. Since on any topic of interest you can formulate a practical task.

    Questions


    I’ll give an example of questions that, in my opinion, better reveal a bunch of developer skills than just head-on: “How does memory management work in iOS?”. It is important not only to solve the problem on the fly, but also to be able to find / come up with this solution if you do not know how to do it.

    1. How would you make up such a screen? What bottlenecks are there and how would you solve them?

      Incoming information:
      There is a Product object, which consists of some general information that is in the header, and an array of Parameters. Each parameter is a string field name and value. Value is the most common string, where each value is separated by a vertical bar from the other. For example: “VM 505 | BWM ZIGZAG 3 | SOLID REKT 101. " Each value should be on a new line as in the 'OEM Specification'.

      Note: The
      dividing line between name and value reaches the first word. If the strip is made as a normal view, and the value field is as a label, the strip will end at the longest word, and not at the first.

      Level : middle and above.
      Decision
      First of all, you should hear the developer’s train of thought. Most people are stuck on this task and overlook many details.

      In my opinion, the best option is to ask the designer to redo it.
      If you solve the problem technically, then I would draw a line from the tail of one label to the tail of another. So that the line goes exactly beyond the label with value. Then we add the attribute with background color to the label. As a result, the background color will paint over the view under it.

      Another option is to sort the words by length and put the longest one up, and align the line at the beginning of the label value.

      Try to find more solutions.

    2. What happens after launching the application?

      func application(_ application: UIApplication, didFinishLaunchingWithOptions...) -> Bool {
          DispatchQueue.global().async {
              Timer.scheduledTimer(timeInterval: 0.4, target: self, selector: #selector(self.tickTimer), userInfo: nil, repeats: true)
          }
          return true
      }
      func tickTimer() {
          print("Tick-Tack")
      }
      

      I’m usually not a supporter of tasks in the style of: “What is the problem in the code in the picture?”, But too often a misunderstanding of the principles of the timer and runloops that result in extremely unpleasant and elusive bugs pops up.

      The question can be reformulated into a task: 'We need to make a repeatable timer, which is called every minute in the background. The aiming accuracy of ticks is not important, quite a certain frequency. How to do it?'

      Level : junior and above.
      Decision
      Nothing will happen. Ranlup is not cocked, as they say. And there will be a small memory leak, but this is for gourmets.

      If you need to make a timer in the background, then you should choose a stream with a running ranloop. Or use the ready-made solution for GCD.

    3. Received task. You need to write an application whose color scheme is configured on the server. That is, the application receives a config that contains a set of colors, the degree of rounding of the icons, and so on. What is the best way to make such an application? What will we use? What will be the limitations of this or that solution?

      Level : junior / middle and above.

      Pay attention: God forbid the candidate is silent about UIAppearance. Just cc *** mi rags to drive this, especially if it is middle and on. Here you can ask about Obj-C base classes as a small digression to theory.

      I note that the candidate does not need to tell in detail about the work of UIAppearance. He could never use it, but he must know what it is.
      Decision
      Create a color scheme class and configure all UI elements through UIAppearance. For custom views, we also implement this protocol. There is an excellent article on this subject.

    4. How to make the application update itself without the participation of the AppStore? Add new screens and logic to them, for example. What are the limitations of such a solution? Which is better in one case or another? When can there be a real need for this mechanism?

      Level : senior.
      Decision
      Tasks for senior go without a solution. Gain experience, gentlemen.

    5. There is an application with a table. During scrolling, light braking is periodically observed. Testers did not reveal a clear pattern, but the problem occurs regularly. Here and there, an unpleasant lag occurs. How to catch him? What to pay attention to?

      Level : middle and above.
      Decision
      The cause of inhibition may be:
      • Overloaded main thread.
      • Instance cells in the process. If your table consists of more than one type of cells, then if the queue is not needed, it will be created first, this requires resources. Especially when unzipping from nib.
        At one time, he even wrote a lib , which allows you to create all cells in advance so that there are no jumps when scrolling.
      • Everything concerning drawing, height calculation and reused resources. There is an amazing study that closes this point 100%.


    6. Question by Realm. There is an application with the same chat (you can use any other example), where the table has some separators in the form of a date or any other option. What is the most productive way to make the division into sections? What are the options?

      Level : middle and above.
    7. Question on CoreData. There is an application with the same chat. Messages can come from a socket in one of the background threads. It is necessary that the received message is added to the table. How will we do it? What are the options? What difficulties can you face?

      Level : junior / middle and above.
    8. There is a screen, the filling of which depends on several requests to the server. That is, the contents should only be shown when they are all completed. For example, VKontakte page. Until the user info is loaded, messages from the wall, the first stream of pictures, the progress indicator should spin. How will we build the logic?

      Level : junior and above.
      Pay attention: I want to emphasize here especially the need to understand gcd groups and synchronize tasks in Operation Queue. It will be great if the candidate still tells what the difference of this or that decision is.
      Decision
      Dispatch group, synchronized operations.

    9. There was a problem. A developer from a neighboring team came running to you and asks for help: the application began to crash in the release, but at the same time it works fine in the debug. How will we catch a mistake? What could it be?

      Level : middle and above.

      Pay attention: it is important that the candidate is focused on the result. On the fact of fixing the problem, not on finding the cause. First of all, a person should ask: “Okay, Google, and what, in fact, has changed since the moment when nothing crashed yet?”, And only then start the exciting debugging process.

      Why is it so important: there are people in the process, but there are results. Process developers simply spend company money, which is especially noticeable when catching non-trivial bugs. They (developers) will enjoy their own competence, exposing a sea of ​​breaks, reading articles about crashes and errors of the compiler, immersing themselves in the profiler for the whole day, when it was enough to just remove a dubious piece of code. This does not mean that you do not need to use a profiler and breaks. You just need to understand the purpose for which this is done.
      Decision
      First you need to calculate the departure point. Often the dubious code lies on the surface, you just have to narrow your search.
      If debugging is required, then set whole module optimization + fast and check the crash (for Swift). With a probability of 90% will be reproduced in debug. Advanced debugging does not make sense.
      You can still try to do only whole module optimization.

    10. The application has a certain module that conducts a large number of operations in a long cycle. At some point, a crash occurs, the application simply closes. Even when they left only one line output, the problem remained. The code is given for an example, in reality, operations are much more complicated and rich, the departure is faster:

      func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
          for index in 0...1000000 {
              let string = NSString(format: "test + %d", index)
              print(string)
          }
          return true
      }
      

      What could it be? How to cure it?

      Level : middle and above.

      Pay attention: understanding the principles of memory management. At least in general.
      I would say that the situation from the question is extremely rare and the task should be used only for completely folded signers, everyone else needs to know about the presence of retain / release / retain count and retain circle.
      Decision
      The point is autoreleasepool. It is treated by creating your own pool or using non-autoreleased objects.

    11. A bit of classics. You conduct a Code Review of the ward June who writes a calendar class for your application, and you find the following piece of code:

      protocol CalendarDelegateProtocol {
          func didSelect(date: Date)
      }
      public class Calendar: UIView {
          var delegate: CalendarDelegateProtocol!
          ...
          func didReceiveTouchForDate(date: Date) {
              self.delegate.didSelect(date: date)
              print("Did touch: \(date)")
          }
      }
      

      didReceiveTouchForDate - an internal calendar method that is called when a certain date is clicked. Is everything all right in your opinion?

      Pay attention: there are a lot of problems, you can dig into almost every line. The more details the applicant sees, the better.

      Level : junior and above.
      Decision
      // Избыточное слово 'Protocol'. Достаточно просто 'CalendarDelegate'
      protocol CalendarDelegateProtocol { 
          // Метод обязателен? Вряд ли. Должен быть optional.
          func didSelect(date: Date)
      }
      // Зачем public во внутреннем инструменте? Это только создаст помехи при оптимизации.
      public class Calendar: UIView {
          // Где weak? Потребуется еще отметка ':class' у протокола. 
          // delegate не должен быть force-unwrapped
          var delegate: CalendarDelegateProtocol!
          ...
          // Название не по гайдлайнйам. Для Swift 3 должно быть: didReceiveTouch(date:)
          // Явно внутренний метод должен быть приватным
          func didReceiveTouchForDate(date: Date) {
             // Вызов должен быть опциональным. 
              self.delegate.didSelect(date: date)
             // Лишний вывод. Просто мусор в логи
              print("Did touch: \(date)")
          }
      }
      


    12. Testers found a bug that pushes in the application come only on iOS 10, but not on iOS 9. How will we fix it? What could be the problem?

      Another problem from the same series: pushing comes when installing the application directly to the device, but not from Testflight / Crashlytics / HockeyApp. How to live with it?

      Pay attention: if the applicant cannot immediately answer what exactly is the problem, then you can give him a laptop and suggest finding a solution. If several browsers are installed on the laptop at once, then fine. You will understand in which search engine a person prefers to search, in Russian or English, how he formulates queries and so on.

      Level : middle and above.
      Decision
      Perhaps notifications are sent only with development certificate. More attention should be paid to how the applicant will seek a solution.

    13. There is a one-dimensional string array, the data from which is displayed in the table. In this case, the array can change from somewhere outside. How to make the data in the table updated as the array changes? For example, if an object was added to an array, a new row should appear in the table.

      Level : junior and above.
      Decision
      KVO . If you want a completely clean solution, then you can still squeal some methods.

    14. You are making an authorization screen for Skype in a storyboard using autolayout. It happened. Everything is simple - a square logo, under it a text box and a button.


      You are cool, you did everything, but here the designer says that with landscape orientation the logo should be on the right, and not on top. How will we do it?

      Level : junior and above.
      Decision

    15. You need to make a scrollView with two pictures of a certain size under each other and indents from the edge of the screen on all sides at 30px. Draw on the sheet what will be the constant.


      Note: Does the candidate understand how the content size for scrollView is determined? And if he remembers about insets, it's generally wonderful. It may be suggested that the content be scrolled over its entire size, without indentation, and the distance from the edges of the screen should be done through margins.
      Level : junior and above.

    Questions are given as an example. If it’s interesting, I’ll make it up again.

    UPD1: added solutions for most issues. If it is absent, then the task is easily googled or solved independently.

    My message is the following - use practical tasks. If not found suitable, then make them yourself. You hire not an encyclopedia, but a specialist who should do the job, and not just know everything in the world. And even more so do not keep in mind what you can find in Google in seconds. The main thing is to understand what to look for.

    As Mr. Sherlock Holmes said, only the necessary tools should be in my attic.



    Invisible evil


    But dubious questions are not the only problem. There is another factor that can scare off even a successful candidate. This is disrespectful, arrogant or arrogant attitude. And I'm not talking about hr girls or important executives. And about future colleagues.

    In many places where I was interviewed, a technical interview takes place without the presence of an observer from hr or a guide. What is generally natural, why should a person who does not understand a word in terminology lose an hour in a boring conversation in the style of a question-answer?

    But why. Many developers perceive the interview as an opportunity to assert themselves. And the test of knowledge turns into the most ordinary miraclehumiliation of the candidate, adding to the poor fellow of stress, regardless of qualification. Even if he successfully answers any questions. I have seen this kind of behavior in many places, both among my colleagues and in interviews, where I was in the role of an interviewee.

    There is a wonderful picture on xkcd on the topic of bulging noses:
    image

    But all this does not mean at all that only eccentrics go to development. No one simply teaches technical specialists how to negotiate, conduct interviews and build a respectful dialogue. And it’s not uncommon to find people who are simply enclosed, and sometimes even clogged. Management throws them into the embrasures with the words: "Check the level of this guy, whether he suits us or not."

    There are no standards, designs or requirements. Everyone conducts an interview to the extent of their understanding and attitude in the complete absence of feedback. After all, who can give this feedback? Leadership / HR and candidates. The former do not participate in the process and cannot say anything, and the candidates are certainly not up to it. If they were accepted, then everything is fine. If not, then what's the point of talking further?

    With all this I want to sayboth for companies and each fellow developer individually: pay attention not only to how you conduct the interview, but also to the manner in which you communicate with your subordinates and colleagues. The carcinogenic attitude can be shown not only to applicants.
    Ask someone to attend a couple of interviews and give you feedback. Ask the candidates themselves later how everything went, whether it was uncomfortable or something else. It's like a Code Review, there’s nothing shameful here. You will only become better as a specialist.

    Respectful communication should be the standard in the technical field.

    Conclusion


    If this article changes the situation in at least one company, then my efforts were not in vain.

    I tried to find the most useful questions. If there is a need for further replenishment of the list, then next time I will devote a separate publication to this.

    It will be great if you share your questions and tasks that you give at the interview to check on the specialists. After all, someone only needs five minutes to understand the level, and someone pickles for an hour and a half each.

    And as they say, respect each other. Regardless of the depth of your knowledge in the material - this is not a reason to look down on others. Amen.

    Only registered users can participate in the survey. Please come in.

    Have you encountered any misconduct in interviews?

    • 62.6% Yes. 166
    • 27.5% None. 73
    • 9.8% I like to do it myself. 26

    Also popular now: