Top 10 Linux Job Interview Questions

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey what's going on guys in this video we're going to cover the top ten Linux interview questions these are the most common Linux system administration job interview questions that you'll find out in the wild so these are what you'll get in your first phone screen generally they'll obviously be maybe more specific interviews after this it also depends on the position you're actually interviewing for any given position might involve lots of other tech - while this covers the majority of like the types of things that are asked during junior Linux admin interviews you may also want to know sort of the similar types of questions for databases tcp/ip and networking programming or a specific programming language there may also be infrastructure or architecture questions if you're doing a more mid-level or senior type position likewise you may be asked about specific applications or services you can get mad you can get sad you can have lots of opinions about this whatever this is just the reality for tech phone screens your interviewer only has a couple of minutes to figure out if you're worth more time investment so really regardless of what kind of job interview you're preparing for if it involves Linux in some capacity should be really comfortable with these basic things if you haven't yet make sure to check out my basic Linux system administration playlist because it covers sort of a lot of the theory and a lot of how Linux works behind what we're going to talk about as a last piece of caution or word of advice do not just memorize these things because even if you make it through the first phone screen they're going to be pretty pissed if it turns out that you actually don't understand what you're doing after you make it through by memorizing answers to these basic questions use these questions as a jumping-off point for further exploration okay so let's jump right in the first question you should immediately know the answer to is how would you check the kernel version of the currently running system that you're on the answer is you name you name prints out system information specifically the - a the a flag you named a will give you everything it's got so so you've got your hostname OS kernel release kernel version architecture etc there's a couple small permutations of this that you can use so kernel version kernel release if you're looking for just those specific chunks of information but that's unique so if someone asks you how do you check the kernel version of the system or even what operating system is running this is a fairly quick way to find out another favorite question is how would you go about checking what your current IP address is and this may come in a couple permutations like oh what's the current address on you know the easy road of ice or what's your current ipv6 address or what have you it's a couple ways to do the social you sort of the old in the new way the old ways if config interface configuration I've got a bunch of little devices here don't worry about that this is the loopback device and this is our Ethernet device you can see our ipv4 address is here along with broadcast and subnet mask our ipv6 address information can be found here now someone asks you for a specific interface in general you should be using the the newer IP tools command so IP a derp we want the address show that gives you everything so all of your devices or you can give another argument the device name so IP add or show 0 as you can see that gives you all the info for Ethernet 0 including ipv4 and cider notation how would you check for free disk space other versions of this question or you know how would you check how much disk space is left or what percentage of disk space you're using don't get tripped up by different ways of asking these DF is your friend DF all file systems human readable formatting so DF space - aah this will give you a readout of all of your file systems including virtual file systems you can see our hard drive partitions are here and our root partition is mounted on SDA one and you can see it's five point eight gigs of capacity we've used five gigs of that so we've got about a half a gig left we're using 91% so DF remember that disk free managing services is a completely normal part of being a linux decide man or working with Linux in general so don't be surprised if someone asks you how would you see if a service is running or how would you start or stop us a service or how would you reload a service on any newer system most major Linux distributions have switched to system D however on an older system you would have said either service I'll use at you dev just as the service name this might be nginx or my sequel or what have you service name goes here service you'd have status checks status of a service start stop etc are also arguments you can put at the end so service service name and then what you want to do to it on a newer system D system so something that is not running this five minute or upstart or another init system you would use system CTL this is so this is the new version quote unquote if that's all you remember systemctl status service now I want an old system I'm not using system D so this is a command not found but the important thing is it's systemctl status service name you'll notice that this is actually reversed the order of the service or unit name argument system D calls this a unit instead of a service but that's pretty much all you need to know it takes the same start/stop and able to save will reload etc you can see I've got some some files and directories here how would you check the total size of everything inside of a given directory I'm going to say do Sh code will check the code directory disk u s-- d u this is going to go and tally that up so you can see I've got a team eggs worth of stuff in my code directory nice and easy a little bit more networking focused how would you check for open ports let's say this question can be asked in a couple different ways check listening network sockets open ports I could say TC services that are listening on TCP or UDP ports or sockets so this question can come in a couple different versions but if you hear you know network socket listening ports TCP and UDP services start thinking netstat because that's that is what shows you that stuff so by default it gives you basically a uselessly big output it's meant to be filtered down with with other Linux and UNIX tools so you'll probably want to run something like netstat I like tu so critique the nud p LP and listening token just remember that and it's pretty good shorthand for like most times when you need this obviously man netstat will get you the manual page pronounced at more on that in a second so this shows you the address and port that different things are listening on I'm actually going to run this command as route because we're you're gonna you'll see in a second you can see on the right this PID or program name is actually blank for everything because we're not route only route can see that so please say su do that so executed is route you can see we now have all that extra information okay so from left to right what type of service is it well it's TCP IP v4 TCP IP v6 UDP UDP AVP IP v6 excuse me get a little excited here the local address that it's listening on the zero zero zero zero means all public addresses port 80 foreign addresses is it listening and the process ID and name of the process so it actually sort of looks up the process name from the kid that owns this socket so you can see nginx our web server is listening on port 80 and anyone on our local network that can get to our machine can check out what we're hosting on our web server one 27001 is our local machine here so this is actually not accessible from outside of our machine again for more on that just learn a little bit more about networking but this netstat dash tul pn is extremely useful and again remember to run it as route with canvas it just gives you that extra okay who is actually listening on that port is very interesting to know how would you check CPU usage of a given process should run PS ax then grep for your process name this is a pipe if you're not familiar with pipes or highly suggest that you watch some of my basic shell videos it's like a building block of linux and you should not be a sysadmin if that doesn't make sense to you so PS ox pipe it into grep and look for nginx you can see these are all the processes right now the process table to have nginx in the name and you can get some process information this way the user it's running as you can see the master process is running as root the worker processes running as dub-dub-dub data etc etc you kind of need to know how to parse this read up on PS another way of doing this is top you'll find top just about everywhere so this is updated by default I think every second or two seconds this gives you a lot more information top you can see by default it's ordered descending order by CPU time percentage of CPU that it's using so this will be updated with your most CPU intensive processes although you can change what it's so goodbye likewise it also gives you a bunch of other stats about memory swapping use load averages etc nice alternative to this although you won't find it installed by default is H top that's interesting to you I like this you can search it easily with like the slash key search for some process gives you a nice little graphical representation of the cores it sees memory swap etc nice and intuitive so that's how you sort of check what's going on with processes what users own a process would what a process is running as and things like CPU memory usage etc how would you mount some kind of mute volume let's say a new hard drive partition that you've just plugged in let's say a USB stick how would you mount that in your system well Linux will generally have a directory called mount on root and that is sort of the the canonical place to mount things so to mount a new volume you would say mount is the command and then the absolute path to the volume so if it's a device like let's see it's a hard drive partition SDA - it's the second partition on the SD a hard drive you could say mount address and then the mount point I just wanted to mount it on mount MNT this would be the command likewise checking for existing mounts is just the mount command without any arguments so you can see here's what's mounted and the mount options it's got you also get the filesystem type so x4 got a butter if s here on last little trick on mount just because it's fast if you automatically need to mount a volume at boot what file would you look in the answer is e TC FS tad we take a quick look at that file you can see this is our disk partitions that we want so this is SD a one and it's UUID unique user ID of unique device ID and our swap part sj5 its unique ID so that we can find that at Bhutan when I generally make changes to config files that are not part of a larger system like just on my desktop so not as part of a business configuration management setup I like to just leave my name in there just so I can quickly grep for files that have this string in them so that I can see everything that I've changed on the system you know that isn't in some kind of configuration management or automatic provisioning script finally the very very most important thing man pages you will get asked how you look stuff up how do you find answers to questions your first answer to this should be it's a command I look at the man pages the manual pages so man command gets you there so for example man PS you want to know all the options you could pass to PS it's kind of a big command here are all the interesting things you can do with it generally man pages have a sort of name of the command basic synopsis the way you call it so the syntax for calling it a description of the command sort of many many very dense tutorial usually and some examples bsds are a lot better than most Linux distros for this but you hope to find an example section at the bottom in this case you've got an example section here although this is often missing depending on what the command is and then a listing of all the options in detail see this is a very old and well-documented command other than man Google server fault Stack Overflow these are good answers in an interview you should know multiple ways of finding answers to questions if you haven't read it yet I will link it here with the how to ask smart questions or how to ask questions the smart way article is required reading for anybody in tech so I hope that's been useful if you want more of these either more for Linux for higher-level Linux questions or for other sort of skill silos like databases networking programming infrastructure cloud stuff applications and services I'd be happy to make more of these videos so they're helpful leave a comment with stuff you'd like to see covered subscribe for more if you haven't already check out the basic sysadmin skills playlist because there's just a whole lot of background stuff you need to know in there so good luck on your job hunt and in your interviews and maybe we'll run across each other in real life sometime thanks for watching guys
Info
Channel: tutoriaLinux
Views: 2,025,691
Rating: 4.896379 out of 5
Keywords: computer, Linux, tutorial, system administration, sysadmin, command-line, programming, job interview, questions, practice questions, linux basics, linux command line, linux tutorial, linux tutorial for beginners, linux job interview, job interview questions, tech job interview, job interview study, linux job, tech job, programming job interview, programming interview, programming interview study, linux interview, linux interview study, getting an IT job
Id: l0QGLMwR-lY
Channel Id: undefined
Length: 16min 3sec (963 seconds)
Published: Thu Jun 30 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.