r/learnpython • • 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.

412 Upvotes

83 comments sorted by

View all comments

7

u/MyCousinVinny101 Apr 10 '19

Any tips on learning linux? Wouldn’t even know where to begin if im being honest

7

u/CompSciSelfLearning Apr 10 '19

If you have a usb drive. Create a live bootable USB to use on your existing PC or Laptop or both. You can install to dual boot or just use the live usb.

Then just use it.

1

u/MyCousinVinny101 Apr 11 '19

Thanks! Any way I could really mess up my PC doing this though? I watched a youtube tutorial on this and some of the comments were a bit discouraging in that they ran into some issues

2

u/CompSciSelfLearning Apr 11 '19

A live USB will not mess with your machine at all. You can also use a virtual machine install. It will be slower but again no risk to your machine.

1

u/MyCousinVinny101 Apr 11 '19

Ok thanks again!

3

u/CompSciSelfLearning Apr 11 '19

Using the live USB is no risk. Partitioning and installing can risk your data. Don't partition until you've backed up your data and make a Windows recovery USB.

1

u/MyCousinVinny101 Apr 13 '19

What size USB drive do I need?

1

u/sje46 Apr 11 '19

I highly recommend dual booting. Don't do a VM or run off a live image.

You can fuck up your hard drive during the installation process. But that's easy to avoid. Use the GUI install, follow along a guide. If you're really that nervous, back up all your data. But it's easy. Only an idiot will fuck it up.

Once you have it installed, learn enough to do the bare minimum you need. Don't rush with Linux. Use it as your primary os. Use Windows only when you need to. Go at your own pace.

I did this ten years ago and haven't touched Windows in years. I don't even work in IT. Linux has everything I need.

Vms and live disks are a mistake!

1

u/jorvaor Apr 20 '19

I have tried both ways. I have a laptop with three different OS (Ubuntu, Vista and Windows 7). I have another one with Windows in which I have a couple of virtual machines with linuxes.

Both ways worked well for me. The virtual machine way is quicker and easier. Having Linux in its own partition is more satisfactory but fiddlier and slightly riskier.

6

u/joelgsus Apr 10 '19
  • Download VirtualBox,

  • install it.

  • Download Ubuntu image.

  • run it with virtualbox.

1

u/MyCousinVinny101 Apr 11 '19

Thank you, so this does not require a usb install?

1

u/joelgsus Apr 11 '19

No. Just google how to install Ubuntu on virtual box and watch some YouTube videos

1

u/Ran4 Apr 19 '19

No, virtualbox is a regular program you can run inside of windows. In it, you create and run a "virtual computer".

Do note that you may need to activate VT-X in your bios settings. Google how to do so, it's not that hard.

2

u/heisenberg149 Apr 11 '19

In addition to what everyone else has mentioned, I went over the Linux Journey over the last couple weeks. It's great that everyone said to get a distro (I personally like Fedora's KDE spin) and try it out, but no one told you what to really do with it to start to learn Linux aside from the surface stuff. I found the info on there really helpful, I'd been using Linux on and off since '08 but never needed to dig any deeper than a few commands and general web browsing, homework, etc.

3

u/cantredditforshit Apr 10 '19

Get a Raspberry Pi and a MicroSD for like $50 total. Install NOOBS on the MicroSD, throw it in the Pi, hook up a monitor/USB mouse + keyboard and you're set to start exploring a Linux environment.

Basic navigation of the filesystem commands are probably your best start; cd, ls, etc. Editing/viewing files: cat, nano. Maybe you'll want to set up the SSH server on it so you can just SSH to it from your desktop/laptop without having to plug in a monitor, mouse and keyboard. And then from there you just keep exploring. Come up with a project and make it happen.

17

u/CnidariaScyphozoa Apr 10 '19

I mean you could do that and PIs are fun... But why wouldn't you just spin up a vm for a whopping $0?

1

u/FluffyBunnyOK Apr 10 '19

You can attach hardware to the rpi. Temperature sensors, oled displays etc which is much more fun than just a web server VM.