Backend - Senior

0/20 preguntas respondidas 0%
Candidate information
Accepted formats: PDF, DOC, DOCX. Maximum 5MB

Knowledge questions

Question 1 of 20: This Eloquent code has a performance problem: `$posts = Post::all(); foreach ($posts as $post) { echo $post->author->name; }`. What is the issue?
Question 2 of 20: This Laravel middleware does not work: `public function handle($request, Closure $next) { if (!$request->user()->isAdmin()) { abort(403); } $next($request); }`. What is missing?
Question 3 of 20: How does the Symfony DI Container work and what are tagged services?
Question 4 of 20: This asyncio code has a race condition: `counter = 0; async def increment(): global counter; temp = counter; await asyncio.sleep(0); counter = temp + 1`. With 100 concurrent tasks, what happens?
Question 5 of 20: FastAPI endpoint returns 422: `@app.post("/users") async def create(user: UserCreate): ...` with body `{"name": "John", "age": "twenty"}` and `class UserCreate(BaseModel): name: str; age: int`. Why?
Question 6 of 20: When to use asyncio vs threading vs multiprocessing in Python?
Question 7 of 20: Memory leak in Express: `app.post("/upload", (req, res) => { const data = req.body; processLater(() => { analyze(data); }); res.send("ok"); });` where `processLater` stores in a global array. Why?
Question 8 of 20: How to scale a Node.js application?
Question 9 of 20: Deadlock in Go: `func main() { ch := make(chan int); ch <- 42; fmt.Println(<-ch) }`. Why?
Question 10 of 20: What is idiomatic error handling in Go and when to use panic vs error returns?
Question 11 of 20: This query is slow: `SELECT * FROM orders WHERE total > (SELECT AVG(total) FROM orders WHERE user_id = orders.user_id)`. How to optimize?
Question 12 of 20: What are SQL transaction isolation levels and what problems does each prevent?
Question 13 of 20: How to model a many-to-many relationship in MongoDB? Embedding vs referencing?
Question 14 of 20: Race condition in cache-aside with Redis: Thread A reads cache (miss), Thread B updates DB and invalidates cache, Thread A writes stale data to cache. How to prevent?
Question 15 of 20: How to implement a distributed rate limiter with Redis? Sliding window vs token bucket?
Question 16 of 20: What are the advantages and disadvantages of Event Sourcing vs traditional CRUD?
Question 17 of 20: How to implement a distributed Saga for a payment flow? Orchestration vs choreography?
Question 18 of 20: From OWASP Top 10, what are 5 common vulnerabilities and how to prevent them?
Question 19 of 20: What is the difference between unit, integration, and e2e tests, and what is the testing pyramid?
Question 20 of 20: This code has a bottleneck: `async function exportUsers() { const users = await db.query("SELECT * FROM users"); return JSON.stringify(users); }` with 10K+ records. What is the problem?

Coding challenge

Design and implement a real-time notification system combining REST API with WebSockets, message queue with Redis pub/sub, and retry with exponential backoff. Include integration tests and document architectural decisions.

Requirements

  1. REST API to manage subscriptions and query notification history
  2. WebSocket server for real-time delivery with automatic reconnection
  3. Message queue with Redis pub/sub to decouple producers and consumers
  4. Retry with exponential backoff for failed deliveries (max 5 attempts)
  5. Integration tests covering the full flow (send → queue → delivery)

Examples

Input: POST /api/notifications { "userId": "123", "type": "order_update", "payload": { "orderId": "456", "status": "shipped" } }
Output: Notification queued in Redis, delivered via WebSocket to connected user, with delivery confirmation

Accepted technologies

  • Node.js + Socket.io/ws
  • Python + FastAPI + websockets
  • Go + gorilla/websocket
  • TypeScript + NestJS
  • Elixir + Phoenix Channels

Solution submission

Supported platforms: GitHub, GitLab, Bitbucket Enter a valid repository URL (https://github.com, gitlab.com, or bitbucket.org followed by owner/repository)