Explain what the following statements do:
ls mydir > foo.txtls mydir > foo.txt 2>&1cat file1 file2 > file3cat file1 file2 >> file3
Explain what the following statements do:
ls mydir > foo.txtls mydir > foo.txt 2>&1cat file1 file2 > file3cat file1 file2 >> file3Write the Bash statements to:
banana-file-names.txt with the concatenated contents of every file in the current directory that starts with "banana"banana-file-content.txt with the concatenated contents of every file in the current directory that contains the word "banana"Write the Bash statements to:
Explain what each of the following Bash statements does and the overall result:
$ (date ; ps -ef | awk ‘{print $1}’ | sort | uniq | wc -l ) >> processes.log
Explain what the following Bash command does:
find . -type f -atime -7 > /tmp/recent_files
Describe two ways to concatenate strings in Perl. Contrast and compare.
Describe what the following Perl code does:
#!/usr/bin/perl
$numArgs = $#ARGV + 1;
print "$numArgs\n";
foreach $argnum (0 .. $#ARGV) {
print "$ARGV[$argnum]\n";
}
Write code to print the contents of the following array in Perl:
@fruit = ('banana', 'orange', 'apple');
In Perl, how would you allow functions to have private variables that retain their values from call to call?
What is a good way to fetch the contents of a web page in Perl, given a URL?
What is a common way of sending email from a Perl program?
What is CAP theorem? Describe how weakening consistency constraints can yield highly available distributed systems (e.g. databases). Give an example.
Describe consistent hashing and the advantages that it has over traditional hashing techniques. How can this technique help while scaling distributed systems, for example, distributed hash tables?
Imagine a scenario where your website's database can only handle 1,000 queries every second, and your traffic has grown enough to product 1,500 queries per second at peak times.
What can you do to deal with this problem in the short term? What's a long term solution to deal with ongoing growth in traffic?
What is load balancing? Describe three different types of load balancing techniques? What problems can load balancing solve? What problems can it introduce?
Describe the congestion avoidance algorithm in the TCP protocol.
Design a system to efficiently calculate the top 1MM Google search queries and create a report of these. Additionally: