DEV Community

Petros Demetrakopoulos

Posted on

11 weird questions I was asked in interviews

1. How much is 17x17?
The answer is 289 and of course, I answered it wrong. However, the recruiter which asked this question mentioned that he did it to “check how I think” so I believe he would like to see me thinking that 17x17 is 17^2 which is (10 + 7)^2 which expands to 10^2 + 2x10x7 + 7^2 which equals 100 + 49 + 70x2 = 289.
Pretty weird though.

2. Do you know how Shazam works?
In layman’s terms, Shazam captures a sound sample of a song and then analyses it into a table of frequencies that the song contains and how frequently these frequencies are presented in a specific song. This distribution of frequencies is unique for each song and thus a song can be uniquely identified by it. This is achieved with algorithms and methods like Discrete Fourier Transform (DFT) derived from the fields of signal processing, mathematics, and physics. You can find more about how Shazam works on this awesome blog post.

3. What was the most self-explanatory and streamlined solution you provided in a complex programming problem you faced?
As you can guess, there is no right or wrong answer to this question and it is personal and different for everyone. I answered with a solution I provided to a queue waiting problem. My team and I solved the problem in the database level of the app with SQL stored procedures and triggers.

4. What is the most important thing that your parents offered you?
This was a tricky one. I answered that one of the most important things that my parents offered me was

• Tuition in 2 very good private schools. I explained that the overall experience that these schools offered me was much more than just better teachers and better education. These 2 schools offered me many opportunities in culture, sports, science clubs, etc.
• My parents also offered me many stimuli and incentives to fill my spare time. Walks in art exhibitions, museums, performance of science experiments at home during the weekends, and of course coding were some of them.
5. What is the difference between a process and a thread?
I had to remember some basic principles from the Operating Systems course in university to answer this correctly. The difference is crucial and simple: Both threads and processes are “independent sequences of execution”. However, threads that run on the same process, run in a shared memory space while processes run in separate memory spaces. This StackOverflow answer makes it pretty clear.

6. Would it be able to create a server running in a PC monitoring all the transactions of Ethereum blockchain in real-time?
My personal experience is that the SSD in my MacBook Pro failed to sync too due to disk rate and disk space, so it is not possible to sync the entire Ethereum blockchain with a typical personal computer.

7. Why do you prefer React over Angular?
I know that React is a library and Angular is a framework and thus comparing them may seem like comparing Apples to Oranges. However I answered that I prefer React because it is more lightweight in terms of payload (in front-end development, the payload of a library or framework is something that a developer should really care about because it may be used by mobile or really slow internet connections) while it offers exactly the same functionality. I also explained that the so-called 2-way binding functionality of Angular is not really missing from React, as React accomplishes the same result using state.

The answer there was pretty simple and straightforward. Yes, in my previous job the team wrote tests, we had an organized CI/CD track that ran all the tests before the deployment. I also mentioned we used multiple git branches for the different development and deployment stages (development, staging, production, etc.)

9. What is the difference between git rebase and git merge?
Git rebase and merge are both used to integrate changes from one branch into another. Their difference lies in how this result is achieved. The main difference is that git rebase moves a branch into master as it is while merge adds a new commit (a merge commit) preserving the history and chronological order. We could say that merge preserves the commit history as rebase re-writes it. You can learn more about git rebase vs git merge in this awesome Atlassian tutorial.

10. What is the difference between UNION and UNION ALL in SQL?
UNION SQL command is used to combine the results of 2 or more SELECT statements. The difference between UNION and UNION ALL is that UNION eliminates duplicate records while UNION ALL preserves them. As you can imagine, using UNION instead of UNION ALL has a drawback in performance since the DB server must do additional work to remove duplicate rows.