Why Did You Fail Your Software Technical Interview?
Why Did You Fail Your Software Technical Interview?
Recently, I faced a series of challenges during a software technical interview at a Japanese company focused on digitizing documents and offering ‘paperless’ solutions. The position seemed promising since I had been working with JavaScript and the PDF format on a daily basis. However, my approach to the interview did not align with their expectations, leading to a lackluster outcome.
The Interview Question
Twenty minutes into the interview, the interviewer posed a simple task: write a JavaScript function to multiply even numbers in a given list by 100 while leaving other numbers unchanged.
The list of numbers was provided as:
numbers [1, 2, 3, 4]
Myproblem here is to showcase the following output:
numbers [1, 200, 3, 400]
My Approach
Initially, I opted for a straightforward, readable code that would be easily understandable by any developer, regardless of their background experience in JavaScript. This approach prioritizes clarity over brevity:
returnNumbers [] for each number in the original list... n { t if the number is even, multiply it by 100 and push it into the return list t if n % 2 0 { t returnNumbers.push(n * 100) } else { t returnNumbers.push(n) } }
The code is simple, uses common terms like for each, if, else, and could be understood by developers with varying levels of experience in coding.
The Interviewers' Perspective
Unfortunately, the interviewers were not satisfied with my approach. They questioned if I could think of a more “JavaScript-ish” way to solve the problem. This highlighted a gap in my experience with functional programming and specific JavaScript constructs.
The Preferred Solution
They presented a one-liner solution using JavaScript's functional programming features:
returnNumbers (v > v % 2 0 ? v * 100 : v)
This solution is more concise, at only three lines, and does not declare an empty list explicitly. However, this approach relies on the map method and the ternary operator, which are not common in all programming languages and might not be familiar to someone with a background in other programming paradigms, such as Python.
Analysis of the Preferred Solution
The preferred solution has several advantages and disadvantages:
Advantages: The code is more concise. It is more memory-efficient because it avoids creating a new array initially. It adheres to functional programming principles, a trend often favored by modern JavaScript frameworks and libraries. Disadvantages: Limited familiarity: The map function and ternary operator are not universally recognized, especially in non-functional programming backgrounds. Clarity: While concise, this solution may be less comprehensible to co-workers who are not familiar with these language-specific constructs.Reflection and Outcome
The experience taught me an important lesson about adaptability in coding interviews. Different companies have different expectations, and technical interviews can be a reflection of the company's culture and preferred coding style.
Despite the setback, I gained a broader perspective on software engineering. Six months later, I successfully secured a React.js frontend developer position with a better salary, offering a more positive outcome. This shows that technical interviews often reflect the company rather than your skill or knowledge. The key is to adapt, learn, and present solutions that are understandable and effective within the context of the interview.
Conclusion
Technical interviews are a critical aspect of the software engineering job application process. While the path to employment can be challenging, it is essential to stay resilient and adapt to the unique requirements of each interview. By learning from these experiences and continuously improving your skills, you can increase your chances of securing the right role for your career.
-
Successfully Applying for Jobs Abroad Without Previous EU/US Work Experience
Successfully Applying for Jobs Abroad Without Previous EU/US Work Experience App
-
The Reasons Behind the Rampant Collaborations in the Music Industry
The Reasons Behind the Rampant Collaborations in the Music Industry Collaboratio