Friday, February 25, 2011

Top X Sql Too Unix Interview Questions For Programmers

The SQL in addition to UNIX are 2 of the most essential skills for whatsoever programmer. It doesn't affair whether y'all are applying for the chore equally Java developer or C++ developer, Python developer or Ruby programmer, SQL in addition to UNIX e'er have got about role to play inwards your career. It's fifty-fifty essential for people who have got less to produce alongside programming similar application back upwards guys, draw concern analysts, projection managers, in addition to dependent area affair experts.  Hence, it's imperative for whatsoever programmer or information technology professional person to laid upwards both SQL in addition to UNIX well before going for whatsoever chore interview. This becomes fifty-fifty to a greater extent than of import if y'all are going for a back upwards engineer role instead of for a evolution role because than the importance of SQL, Database, in addition to Linux science increases equally compared to the programming linguistic communication y'all know.

Since the psyche chore of back upwards professionals is to aspect after the production environment, which often runs on Linux, it's crucial for them to have got a goodness noesis of both the Linux operating arrangement in addition to the ascendance line.

They should know what they are doing because wrong exercise of grep or rm ascendance tin lead downwards the whole production system. That's why they are extensively questioned in addition to tested inwards their UNIX skills.

Same is truthful for SQL because most of the real-world arrangement uses a relational database for backend similar Oracle, MySQL or Microsoft SQL Server in addition to back upwards professionals often demand to run queries, study stored physical care for or write procedures to generate reports.

Just similar UNIX command, a careless SQL query too has the potential to lead downwards your production arrangement to halt, in addition to y'all should e'er produce due diligence before running whatsoever query against alive environs similar testing them inwards UAT or QA environs before running them inwards Production.

This unmarried thing has saved my life a span of times, in addition to I have got jolted a span of points y'all should accept tending of patch running queries on production or alive database; y'all tin unwrap those tips here.

Because of these reasons, SQL in addition to UNIX acquire essential skills for whatsoever software back upwards professional. If y'all intend y'all lack SQL in addition to Linux skills, thence I propose y'all kickoff buy the farm through a comprehensive course of study like The Complete SQL Bootcamp and Linux Command Line Basics before appearing whatsoever interviews. These courses are slap-up to create total whatsoever gaps y'all have got inwards your understanding.






Linux Interview Questions for Programmers

This listing contains about of the questions which I intend really of import from a Java back upwards perspective, in addition to many of them are genuinely asked inwards existent interviews. If y'all are going for whatsoever Java back upwards role, y'all tin await about SQL in addition to Linux questions along alongside Core Java questions.

I encourage y'all to buy the farm through this listing to acquire an thought of what to await inwards a existent Java back upwards interview.

Btw, this is the instant component of my listing of interview questions for Java information technology back upwards professionals. In the first part, I have got shared xxx essential Java in addition to JEE questions, in addition to inwards this part,  I'll portion 17 SQL in addition to UNIX questions from diverse Java Support Interviews.


Anyway, hither are about of the often asked SQL in addition to UNIX questions from Programming Job interviews:


1) What volition plough over when a TCP/IP customer stops consuming messages from Server, but it's connected? Assume the Server is continuously sending messages. (answer)
The message volition travel stored on sending buffer at the sender goal because it volition halt receiving the ack from the receiver. If the server hold continues to force messages, the sending buffer volition overflow, throw an mistake to halt the server.


2) What guarantees are provided past times TCP/IP?   (answer)
The TCP/IP provides the guaranteed delivery, but apart that it too includes ordering guarantee, i.e., messages volition travel delivered to the customer inwards the same social club they are sent from the sender.

This is ane of the of import reasons to consider TCP/IP for ordered messages, e.g., orders in addition to trades inwards the fiscal world.

Btw, if y'all desire to larn to a greater extent than virtually TCP protocol, y'all tin run into this here to unwrap about goodness majority to larn to a greater extent than virtually TCP/IP protocol from the application developer's perspective.


3) How produce y'all unwrap the PID of a physical care for listening on port 8080? (answer)
If the physical care for is running on a Linux operating system, thence it's pretty straightforward; but exercise the netstat ascendance to unwrap the PID of the process, netstat -p shows the PID. Once y'all got the physical care for id, y'all tin exercise the ps ascendance to run into the physical care for itself.

Btw, If y'all are non familiar alongside netstat, ps, or key Linux commands, thence I propose y'all kickoff buy the farm through answer)
This is ane of the mutual situations Java programmers face. In Linux, y'all tin exercise the unwrap ascendance to search all big files. The unwrap -size options listing the file alongside their sizes.


8) How produce y'all unwrap the heap dump files inwards Linux?  (answer)
The heap dump files are to a greater extent than often than non inwards the cast of java_pid.hprof, thence y'all tin easily search them using unwrap ascendance inwards Linux equally shown below:

$ unwrap . -name *.hprof -print


9) How produce y'all unwrap the files currently used past times your Java process?  (answer)
You tin exercise the lsof command to unwrap all the files, including sockets, past times your Java physical care for inwards Linux.  The lsof command stands for listing opened upwards files, in addition to since everything inwards UNIX is file, it tin listing both normal files equally good equally opened upwards socket connection past times whatsoever process.

$ lsof -c java

volition listing all files opened past times the coffee command, and,

$ lsof -p 22342

volition listing all files opened past times physical care for id 22342.

For a more in-depth discussion on using lsof command and its diverse open, I propose y'all buy the farm through the Linux Command Line Basics course on Udemy. It covers all basic Linux commands alongside real-world examples.

 The SQL in addition to UNIX are 2 of the most essential skills for whatsoever programmer Top 10 SQL in addition to UNIX Interview Questions for Programmers





10) How produce y'all unwrap the ports currently used past times a Java process?  (answer)
You tin exercise the netstat or lsof ascendance to unwrap all the ports currently used past times a Java process, but for that, y'all demand the physical care for id of your Java process. You tin unwrap the PID using ps in addition to grep command, equally shown below:

$ ps -ef | grep coffee | grep myprocess

Once y'all unwrap the PID of your Java process, y'all tin exercise the netstat command to unwrap the ports currently used this Java physical care for equally shown inwards the next example:

$ netstat -nap | grep PID

If netstat is non available on your Linux machine y'all tin too exercise the lsof ascendance to unwrap all the ports used past times a Java physical care for equally shown below:

$ lsof -i

If y'all desire to larn to a greater extent than virtually lsof command, a "Swiss Army Knife for programmers," y'all tin banking enterprise tally out my before post, 10 ways to exercise the lsof ascendance inwards Linux.




11) Can y'all refer 10 Linux commands y'all exercise daily?  (answer)
This is easy, right? You tin refer whatsoever Linux commands y'all use, but brand certain y'all give a diversity of commands, e.g. commands to search, networking commands, physical care for management commands, CPU in addition to retention profiling commands, etc.

Anyway, hither is my listing of about basic Linux commands:
  1. ls
  2. top
  3. ps
  4. find
  5. grep
  6. netstat
  7. df
  8. lsof
  9. kill
  10. sort
  11. chmod
  12. du
  13. curl


If y'all dearest books in addition to desire to larn to a greater extent than virtually basic UNIX commands, thence please see  The Linux Command Line: H5N1 Complete Introduction, a consummate guide to Linux commands.


 The SQL in addition to UNIX are 2 of the most essential skills for whatsoever programmer Top 10 SQL in addition to UNIX Interview Questions for Programmers



If y'all prefer online courses thence banking enterprise tally out the 2 courses I have got to propose to y'all before, I to a greater extent than often than non start alongside a course of study in addition to thence read a majority for a to a greater extent than in-depth understanding.


SQL Interview Questions for Programmers

Now that y'all have got seen about of the often asked Linux/UNIX command-line questions from programming chore interviews, let's hash out about SQL in addition to Database interview questions. This listing includes questions on SQL query in addition to database fundamentals.


1) How produce y'all unwrap the instant highest salary inwards the employee table? (answer)
There are many ways to unwrap the instant highest salary inwards the employee table, e.g. y'all tin either exercise the co-related subquery, or y'all tin exercise a ranking component like row_number() and rank().

The enquiry tin travel fifty-fifty to a greater extent than tricky past times adding duplicates, e.g. 2 employees alongside the same salary. In that case, y'all tin select betwixt the ranking component to satisfy the requirement.

I have got already written a detailed weblog post service virtually this topic, delight see here for a span of illustration of finding the instant highest salary inwards the employee table.

 The SQL in addition to UNIX are 2 of the most essential skills for whatsoever programmer Top 10 SQL in addition to UNIX Interview Questions for Programmers



2) How produce y'all unwrap the duplicate rows inwards a table?  (answer)
Again, similar the previous question, at that topographic point are several ways to unwrap the duplicate rows inwards table, e.g. y'all tin exercise a ranking component similar row_number which assign row publish depending upon the value y'all ask, in addition to for same values similar inwards the illustration of duplicate rows, the row publish volition travel same.

You tin too the group by clause to unwrap duplicates e.g.

select emp_name, count(*) from employee group by emp_name having count(*) > 1

This ane of the classic ways to unwrap the duplicate rows inwards a table, in addition to it volition piece of work inwards almost all databases similar Oracle, SQL Server, or MySQL.



14) How produce y'all take the duplicate rows from the table?  (answer)
This is the follow-up previous enquiry in addition to much tougher than the previous one, particularly if y'all are non familiar alongside the ranking functions similar row_number.

If y'all exclusively know virtually the GROUP BY clause, thence y'all volition grapple to take duplicate rows because if y'all take past times emp_id, both rows volition travel removed. Here y'all must exercise the row_number() function, the duplicate rows volition have row publish > 1 like

select emp_name, row_number() over (order by emp_name desc) row_number from Employee

This volition impress something similar below.

John        1
Heroku    1
David      1
David      2

Here instant David is duplicate, in addition to y'all tin easily take it past times giving status similar delete from tabular array where row_number> 1.

Though, if y'all are non familiar alongside window functions similar rank in addition to row_number(), I propose y'all buy the farm through an online course of study like Microsoft SQL for Beginners. This volition non exclusively assist y'all to empathize basic SQL commands but too furnish about insight on how to exercise them effectively inwards your twenty-four hr menses to twenty-four hr menses work.

 The SQL in addition to UNIX are 2 of the most essential skills for whatsoever programmer Top 10 SQL in addition to UNIX Interview Questions for Programmers



3) What is the divergence betwixt clustered in addition to non-clustered index?  (answer)
This is ane of the often asked database questions, the psyche divergence betwixt 2 is that at that topographic point tin travel exclusively ane clustered index on a tabular array patch y'all tin have got to a greater extent than than ane non-clustered index. The clustered index too defines how the information is physically stored on the disk.


4) How produce y'all unwrap all records modified betwixt 2 dates inwards SQL?  (answer)
This is ane of the tricky SQL questions. It looks simple, but when y'all buy the farm in addition to write the SQL query, y'all volition unwrap that it's non working equally expected. For example, many programmers volition exercise the "between" SQL clause to unwrap all the rows modified betwixt 2 dates e.g.

select * from Orders where order_date between '20160901' and '20160930'

This volition piece of work good inwards most cases, but if at that topographic point is an social club where order_date is midnight of 1st October, thence it volition too travel picked. You tin travel to a greater extent than precise past times using the logical operator, equally shown below:

select * from Orders where order_date >='20160901' and order_date < '20160930'


5) What is the divergence between count(field) and count(*) in SQL?  (answer)
The exclusively divergence between count(field) and count(*) is that the old doesn't count null values patch afterward does. For example, if y'all have got an emp_name column on your tabular array in addition to it contains 10 valid values in addition to iii null values, then count(emp_name) will render 10 patch count(*) volition render xiii rows.

That's all virtually SQL in addition to UNIX questions for Programmers in addition to Software Engineers. As I said, these 2 technologies are very, really of import for whatsoever job, in addition to goodness ascendance on these 2 goes a long means to secure the job. They are too classic technologies, i.e. they don't obsolete every span of years, in addition to they volition rest pop for several years to come.

I have got interviewed a lot of back upwards guys, particular for Java applications, in addition to I e'er have got focused on their center Java in addition to back upwards skills along alongside SQL in addition to UNIX, in addition to fortunately, the people who have got come upwards out of those interviews have got done really good on their job.


Other Interview Questions for Programmers

Along alongside these questions, y'all should too banking enterprise tally the next interview questions shared before to produce good on your back upwards chore interviews.

Thanks for reading this article thence far. If y'all similar this tutorial, thence delight portion it alongside your friends in addition to colleagues. If y'all have got whatsoever question, doubtfulness or seeking an reply for something, delight drib a comment, in addition to I'll elbow grease to unwrap an reply for you.

P. S. - If y'all desire to larn Linux in addition to SQL inwards depth in addition to looking for about awesome resources thence y'all tin too banking enterprise tally this listing of best Linux in addition to SQL courses for programmers. It contains both gratis in addition to paid courses to larn online. 

No comments:

Post a Comment