Sobes.tech

ERP Consultant

// mutates the current state -> setPhotos([...photos, photo]); // does not see the change // mutates the variable // no key

Junior
328

How is GitFlow model structured in your projects? What branches are used?

Junior
316

What to do if a folder does not have read access during recursive traversal?

Junior
284

What is the difference between stocks and bonds?

Junior
230

package com.example.photogallery.controller; import com.example.photogallery.model.Photo; import com.example.photogallery.service.PhotoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import java.util.ArrayList; import java.util.List; @RestController @RequestMapping("/api/photos") public class PhotoController { @Autowired private PhotoService photoService; private List<Photo> photos = new ArrayList<>(); private static Integer totalCount = 0; @GetMapping public List<Photo> getAllPhotos() { return photos; } @PostMapping("/upload") public String uploadPhoto(@RequestParam("file") MultipartFile file) { try { Photo photo = new Photo(); photo.setFileName(file.getOriginalFilename()); photo.setFileSize(file.getSize()); photo.setContentType(file.getContentType()); photos.add(photo); totalCount++; photoService.savePhoto(photo); return "Photo uploaded successfully"; } catch (Exception e) { return "Error uploading photo"; } } @GetMapping("/count") public Integer getCount() { return totalCount; } @DeleteMapping("/{id}") public void deletePhoto(@PathVariable Long id) { for (Photo photo : photos) { if (photo.getId().equals(id)) { photos.remove(photo); totalCount--; photoService.deletePhoto(id); break; } } } @GetMapping("/search") public List<Photo> searchPhotos(@RequestParam(required = false) String query) { if (query.isEmpty()) { return photos; } List<Photo> results = new ArrayList<>(); for (int i = 0; i < photos.size(); i++) { if (photos.get(i).getFileName().contains(query)) { results.add(photos.get(i)); } } return results; } }

Junior
214

Share your experience and role in recent projects, technology stack.

Junior
212

If two services want to write the same record to the database simultaneously, what will happen?

Junior
203

One of the services in the request chain stopped responding. How will you troubleshoot step by step?

Junior
196

What is a futures contract as a financial instrument?

Junior
194

Write a function FindFilesByExtension that recursively searches for files in a directory and returns a slice of absolute file paths ([]string) that meet the following conditions: file extension == targetExtension (case-insensitive) file size > minSizeKB The function should traverse all nested subdirectories. Example directory structure: /projects/ ├── doc.pdf (2048 KB) ├── report.docx (512 KB) ├── src/ │ ├── Main.go (2 KB) │ ├── Utils.go (5 KB) └── images/ └── photo.jpg (3072 KB) Check examples: files1, _ := FindFilesByExtension("/projects", "pdf", 1000) // files1 == []string{"/projects/doc.pdf"} files2, _ := FindFilesByExtension("/projects", "go", 3) // files2 == []string{"/projects/src/Utils.go"} files3, _ := FindFilesByExtension("/projects", "jpg", 2000) // files3 == []string{"/projects/images/photo.jpg"}

Junior
191

Naming conventions in Go — how should abbreviations be written?

Junior
183

If we find a directory during a recursive traversal, which path do we use?

Junior
182

What anti-patterns in microservice architecture do you know?

Junior
170