Q1. How do you make a Bash script fail fast and clean up with trap?
Robust scripts fail fast and release resources. ```bash #!/usr/bin/env bash set -euo pipefail cleanup() { rm -f "$tmp"; echo "cleaned" >&2; } tmp=$(mktemp) trap cleanup E...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (5 available).
Robust scripts fail fast and release resources. ```bash #!/usr/bin/env bash set -euo pipefail cleanup() { rm -f "$tmp"; echo "cleaned" >&2; } tmp=$(mktemp) trap cleanup E...
Group them by intent and be consistent: - 2xx success: 200 OK, 201 Created (with `Location`), 202 Accepted for async work, 204 No Content after DELETE. - 3xx: 301/308 for...
Swift uses `throws` functions and `try` for recoverable errors. Errors conform to the `Error` protocol, usually as enums. ```swift enum NetworkError: Error { case badStat...
`Option` models presence with `Some` and `None`, replacing null. `Result` models success or failure with `Ok` and `Err`, and is how Rust does recoverable errors. ```rust ...
Use one consistent, machine-readable shape. A widely adopted choice is RFC 7807 `application/problem+json`: ```json { "type": "https://example.com/problems/insufficient-f...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.