Posts

Top 40 Java Interview Questions and Answers (2026 Edition)

Preparing for a Java backend interview? These are the 40 questions that come up most often — each with a crisp, interview-ready answer. Every answer links to a full deep-dive guide in this series when you want the follow-up traps and trade-offs. How to use this: read the question, say your answer out loud, then check. Interviewers score decision rules and failure modes , not definitions — for every answer, reach: when would you use this, what guarantee does it provide, and how does it fail? Modern Java 1. What is a record, and where does its "immutability" end? Answer: a record is a compact data carrier — the compiler generates the canonical constructor, accessors, equals , hashCode , and toString . Reach for it for DTOs, value objects, and tuple-like returns. But the immutability is shallow : component fields are final , yet a mutable component stays mutable — record Order(List<String> items) {} doesn't make the list immutable. That's the interview tra...

Top 20 GCP Interview Questions and Answers (2026 Edition)

Preparing for a GCP interview? These are the 20 questions that come up most often — each with a crisp, interview-ready answer. Every answer links to a full deep-dive guide in this series when you want the follow-up traps and trade-offs. How to use this: read the question, say your answer out loud, then check. Interviewers score decision rules and failure modes , not definitions — "when would you pick X, and what breaks?" Compute, Storage & Networking 1. GCE vs GKE vs Cloud Run — when do you use each? Answer: GCE when you need VM-level control (custom kernels, licensed software, lift-and-shift). GKE when you need Kubernetes orchestration at scale (autoscaling, rolling updates, custom operators). Cloud Run for serverless containers with scale-to-zero — the default to evaluate first for stateless services. Cloud Run functions (formerly Cloud Functions) for single-purpose event handlers. Deep dive → 2. What are Spot VMs, and when are they a trap? Answer: spare...

GCP IAM, Security, and SRE Interview Questions

The last mile of cloud interviews: identity, security, and keeping production alive. These are the GCP IAM, security, and SRE questions that separate "used the console" from "ran production." IAM 1. How does GCP IAM actually work — principals, roles, policies? Answer: the model has three parts: who (principals: Google accounts, service accounts, groups, domains), what (roles: collections of permissions), and where (the resource — org, folder, project, or individual resource). You attach a policy (a list of role bindings) to a resource, and allow bindings inherit downward — org → folder → project → resource. One modern nuance: deny policies also inherit downward and can block a permission even when a role grants it — effective access is not simply the union of all grants. Three role types: basic (Owner/Editor/Viewer — broad, avoid), predefined (job-function roles like roles/bigquery.dataViewer — prefer these), custom (your own permission sets). The in...

Kubernetes and GKE Interview Questions

Kubernetes questions test whether you've actually operated clusters or just read about them. These are the K8s and GKE questions interviewers ask — from core concepts to the 3 AM troubleshooting scenarios. Kubernetes Core 1. Walk me through what happens when you run kubectl apply -f deployment.yaml Answer: the interview classic — they want the control-plane flow: kubectl sends the manifest to the API server (after auth/authz); the object is persisted to etcd ; the controller manager notices the new Deployment and creates a ReplicaSet; the scheduler assigns pods to nodes; each node's kubelet pulls images and starts containers via the container runtime. Service networking is handled separately by the cluster's networking components when a Service exists. Say "desired state vs actual state — controllers continuously reconcile the difference" — that's the sentence that scores. 2. Pod, Deployment, StatefulSet, DaemonSet — when do you use each? Answer:...

GCP Data Engineering Interview Questions: BigQuery, Dataflow, Pub/Sub

Three services show up repeatedly in GCP data-engineering interviews: BigQuery for analytics, Pub/Sub for messaging, and Dataflow for managed data processing. These are the questions interviewers actually ask — each with the crisp answer and the cost or correctness trap underneath. (Real interviews can also cover Cloud Storage, Dataproc, Composer, IAM, SQL/data modeling, and system design — the framework below works for all of them.) The interview framework: for every architecture question, answer in this order — requirement → service choice → guarantee → failure mode → cost . Example: "We need events visible within one minute; at-least-once input is acceptable but duplicates aren't. I'd use Pub/Sub → Dataflow → BigQuery, dedupe on a stable event ID, monitor subscriber and Dataflow lag, DLQ malformed events, partition BigQuery by event date — and then validate whether continuous streaming cost is justified by the one-minute SLO." That beats "use Pub/Sub, Datafl...

GCP Interview Questions: Compute, Storage, and Networking Fundamentals

Cloud interviews start with fundamentals: can you pick the right compute option, the right storage, and explain how traffic flows? These are the GCP questions that come up in every cloud interview — each with the crisp answer and the follow-up trap underneath. Compute 1. GCE vs GKE vs Cloud Run vs App Engine vs Cloud Functions — when do you use each? Decision rule: do you need VM control, Kubernetes control, or just an application runtime? Answer: Compute Engine (GCE) — raw VMs. You manage the OS, patching, scaling. Use when you need full control (custom kernels, licensed software, lift-and-shift). GKE — managed Kubernetes. Use for containerized microservices at scale, when you want orchestration (autoscaling, rolling updates, service discovery) without managing the control plane. Cloud Run — serverless containers. Push a container, get an HTTPS endpoint with scale-to-zero. Use for APIs, webhooks, and event-driven services where you don't want to think about nodes. Ap...

50 Python DSA Interview Questions & Answers — Solved by Pattern

The pattern overview gives you the 10 templates. This is the other half: all 50 problems, each stated as an interview question with a complete, runnable Python solution and the complexity to say out loud. Work the questions cold, then check the answers. Companion: Top 50 Python DSA Problems by Pattern (With Solutions) — the 10 pattern templates this Q&A is built on. Learn the pattern there, drill the questions here. Pattern 1 — Two Pointers 1. Two Sum II — input array is sorted Problem: given a 1-indexed sorted array, find two numbers adding to target. Key idea: converge from both ends; move the side that's too big/small. def two_sum_ii(a, target): l, r = 0, len(a) - 1 while l < r: s = a[l] + a[r] if s == target: return [l + 1, r + 1] if s < target: l += 1 else: r -= 1 O(n) time, O(1) space. 2. Container With Most Water Problem: given heights, find two lines holding the most water....