3.3 KiB
Test tasks
**
Сollections**
You need to write a collection class (which can be used in a foreach construct). The class inherits the iterator interface, that is, it necessarily implements methods:
- __construct(array $items),
- prev,
- next,
- current,
- rewind (method rewind returns a pointer to the first element of the collection).
Add an array [1,2,3,4,5,6,7,8,9,10] to the collection.
In the loop, run through the collection and calculate the sum of the elements.
Students & classes
There are tables:
| id | First name | Last name |
| 1 | Bob | Biden |
| 2 | Joey | Johnsen |
| 3 | Mike | Buffollo |
Classes:
| id | title |
| 1 | A |
| 2 | B |
Students_Classes
| id | class_id | student_id |
| 1 | 1 | 1 |
| 2 | 1 | 2 |
| 3 | 2 | 3 |
You need to write a SQL query that displays the id of the class, its name and the number of students in the class, that is:
| id | title | student_count |
API Development
Task: Create a simple REST API endpoint in PHP that returns a JSON response with a list of users from the users table.
Additional Test tasks
Basic Node.js Knowledge
Create a Node.js application that serves a simple webpage. The webpage should display a list of users fetched from a JSON file.
Basic Understanding of Server Software (Apache, Nginx)
Write a basic configuration for an Nginx server with https redirect that serves a PHP application.
Basic Understanding of Linux Servers
This task will assess your fundamental knowledge of Linux server management, including basic command-line operations, file system navigation, user management, and basic network configuration. Give the list of bash commands for each subtask.
Task Instructions:
- Connecting to a Linux Server:
- Use SSH to connect to a remote Linux server. Assume the server's IP address is
192.168.1.10and the SSH port is the default one.
- Use SSH to connect to a remote Linux server. Assume the server's IP address is
- File System Navigation:
- Once connected, navigate to the
/var/logdirectory. - List all files and directories within
/var/logand save the output to a file namedlog_list.txtin your home directory.
- Once connected, navigate to the
- User Management:
- Create a new user named
testuserwithout a home directory.
- Create a new user named
- File Permissions:
- Create a directory named
testdirin your home directory. - Change the permissions of
testdirto allow read, write, and execute access only to the owner.
- Create a directory named
- Basic Network Configuration:
- Display the current network configuration, including IP addresses and network interfaces.
- Package Management:
- Update the package list on the server and install the
curlpackage.
- Update the package list on the server and install the