Round 1:Online Test Python Coding
Round 2:
================================================================================
#
# Problem Description
# Let's assume you are given a window size of W and an array of integers S and that you can only see the W numbers of S in the
window frame. Each time we slide the window over by one frame (from the left), we want you to output the maximum value within the window.
# Print each element with white space in-between.
# Test case
# Each test case has only 1 line, and the first character is W, followed by array S. So below the input is W = 2 and S = [2,1,2,-1,3].
# Limits
# • The length of S is always larger than or equal to W.
# Examples
# input
# 2 2 1 2 -1 3
# output
# 2 2 2 3
inp = input().rstrip().split() W = int(inp[0]) S = inp[1:] window = [] i = 0 while i <= len(S): window = S[i:W+i] if not window: break if len(window) == W: res = max(window)[0] print(res, end = ' ') i += 1
We need to create a DB design for a company. The company has multiple departments like HR, Engineering, Sales, etc. and employees work in these departments. The system will allow us to manage employees and their project assignments. An employee can be assigned to one or more projects and a project may have multiple employees working on it.
Please create basic tables and fields.
Table Department(deptid, deptname), PK = deptid
Table Employee(EMPID, EMPNAME, deptid) , pk=empid, FK=deptid
Table assignments(empid, projectid)
Table Poject(PorjectId,ProjectName), pk=projectid
One of the most important logs contained within /var/log is syslog. This particular log file logs everything except auth-related messages.
less /var/log/syslog # Check log line by line, use space to see page scroll
tail -f /var/log/syslog # for running log
The dmesg command prints the kernel ring buffer. By default, the command will display all messages from the kernel ring buffer.
dmesg | less
This article is contributed by Amitabh. If you like dEexams.com and would like to contribute, you can write your article here or mail your article to admin@deexams.com . See your article appearing on the dEexams.com main page and help others to learn.