r/learnpython • u/Dexteroid • Apr 10 '19
My recent interview experience on Python.
Role: Automation Test Developer.
Questions asked:
1: Basics of Linux, few tricky commands, what are inodes, setting up networking etc etc.
2: Python:
Given a file, write a function which accepts a version
number, date and returns pass or fail.
EDIT:
the file structure is basically a test result log file which contains lines of information.
Each line has a version and date, tests run and results.
I was supposed to return results which are pass fail based on the version number and date given.:)
Reverse a sentence without using slicing.
List comprehension basics. What I did right: I wrote enough code solving pythonic interview problems, and I was comfortable writing the code in the interview.
what I did wrong: Focused too much on interview type problems, like Coin change, linked list etc etc. Should have also focused on some real use cases of python. For example, how to test a code with different inputs, how to parse few lines from a file, how to schedule a cron job etc etc.
TLDR; Don't just bust your head trying to solve interview challenges from cracking the coding interview. Also learn to make some real world programs.
14
u/cipher315 Apr 10 '19
Glad you emphasized this stuff. It's all generally true. For a python job, we are not looking at your ability to write more low-level solutions, See classic interview problems OP mentioned. If you were going to be working on low-level stuff Python is probably the wrong language, you want something like C C++ GO ect. A lot of your python jobs will be about taking files/ data objects, normally JSON or XML, searching for and extracting relevant data and then doing something with it.
For example, a JSON with the key email which is a list of dictionaries these dictionaries have a boolean key critical. For all email objects where critical is true create a custom object that extracts some but not all the email objects keys. append this to a new list. then append the list to a file along with today's data. There will also probably be some formatting requirements. I end up writing this sort of JSON manipulation all the time.