$filename = $_GET['file']; $content = file_get_contents("/var/www/files/" . $filename); echo $content;
PHP
What databases have you used in your stack?
How often have you faced code optimization tasks?
Approach to code refactoring? Do you use auxiliary tools?
class Cache { private static $data = []; public function set($key, $value) { self::$data[$key] = $value; } public function get($key) { return self::$data[$key] ?? null; } } $cacheA = new Cache(); $cacheA->set('user', 'Alice'); $cacheB = new Cache(); echo $cacheB->get('user'); // ?
Tell us about your work experience, technology stack, and projects.
What is the output of the following code? <?php function format(&$item) { $item = strtoupper($item) . '.'; return $item; } $shopping = array("fish", "bread", "eggs", "jelly", "apples"); array_walk($shopping, "format"); $shopping = sort($shopping); echo $shopping[1]; A "BREAD." B nothing (no output) C "apples" D "fish" E "APPLES."
How do you assess your SQL level? How do you find bottlenecks and optimize queries?
What key projects can you highlight at your current workplace? What are you proud of?
Are there testers in the team?
What will this code output when using cache in Laravel? (question about two different cache instances)
Which message brokers have you worked with — RabbitMQ, Kafka?
What are your salary expectations and willingness to work?
What are interfaces, abstract classes, and traits — what are they and what is the difference?
Tell about your team work experience: process from task receipt to deployment, Git flow, testing, documentation.
Tell about the team structure at your last workplace and the processes (code review, etc.).
What is a deadlock and how can it be avoided?
Which version of Symfony have you worked with?
Tell us about the use of caching (Redis, Cache Lock) — why it was used, how it helped, especially in high-load projects.
How is the facade pattern in Laravel implemented, which appears as static calls but works as regular objects?