SDE2 Interview Questions at General
147 real SDE2 interview questions asked at General. Covers System Design, Technical, Screening, Scenario, HR rounds. Sourced from engineers who cleared the loop.
Interview Signals — What General Asks SDE2s
All SDE2 Questions Asked at General
Your AWS Lambda function runs fine in testing but times out in production on the first invocation. Why?
How do you implement dark mode in a React app that persists across refreshes, respects OS preference, and allows manual override?
You have a users table with 100M rows. You need to add a full-text search on the bio column (free text). Show how to implement this in PostgreSQL.
Your Next.js app shows 'Loading...' forever on first visit but works fine on refresh. What's happening?
You're building a WebSocket server in Node.js that needs to broadcast messages to 50,000 concurrent connections. A naive broadcast loops through all 50,000 and calls socket.send(). What's wrong with this and how do you fix it?
Explain PostgreSQL's MVCC (Multi-Version Concurrency Control). How does it enable concurrent reads and writes without blocking?
How do you securely store API keys that your application needs to call third-party services? Compare 4 approaches.
How does Terraform manage state and what happens when two developers run 'terraform apply' simultaneously?
You find a log file containing plaintext credit card numbers. What immediate steps do you take and in what order?
Design a schema for a multi-level referral system where tracking chains of 10+ levels is required, and you need to query 'who referred this user?' and 'who did this user refer?' efficiently.
Your API returns user data based on a user ID in the URL: GET /api/users/123/profile. A user changes 123 to 124 and sees someone else's profile. What vulnerability is this and how do you fix it?
Explain the difference between OLTP and OLAP databases. Why can't you use the same database for both? What are the architectural alternatives?
How does Kafka guarantee message durability? What configuration ensures messages are not lost even if a broker crashes mid-write?
You've been asked to estimate a project that you've never done before. Your manager needs a number by end of day. The project could take 2 weeks or 6 months depending on unknowns. How do you handle this?
Kafka consumer is falling behind (lag growing). Processing is in a tight loop with no I/O. How do you increase throughput?
Your Node.js app needs to tail a large log file (100GB, growing) and stream new lines to connected clients via WebSocket. How do you implement this efficiently?
You need to process Kafka messages in exactly the order they were produced for each user, but process different users in parallel. How do you configure this?
What is a data lakehouse and how does it differ from a data lake + data warehouse architecture?
Explain how you would handle authentication in a Next.js app. Compare NextAuth vs rolling your own JWT solution.
Your Kafka topic has 10 partitions. You scale your consumer group from 10 to 20 instances. What happens?
Explain Kafka's consumer group rebalancing. What triggers it and what are the performance implications?
Explain the difference between batch processing and stream processing. Can you use Spark for both?
Your data warehouse query returns the wrong totals for a report. The same query on raw data shows different numbers. How do you investigate this?
A Docker container is using 100% of its CPU allocation and throttling. The app inside is single-threaded. Adding more CPU limit doesn't help. What's the root cause?
Explain the CAP theorem in the context of choosing between Apache Kafka and a traditional database for event sourcing.
Explain how Helm works in Kubernetes. What problem does it solve that kubectl apply doesn't?
You're building a Node.js API that needs to process uploaded images: resize to 3 formats, upload to S3, and update database. How do you design this for high throughput?
You have a Spark job that runs fine on 1GB data but OOMs on 100GB. Your cluster has 20 nodes with 16GB each. How do you diagnose and fix this?
A security audit finds that your Node.js API is vulnerable to SQL injection despite using parameterized queries everywhere. How is this possible?
Your CI/CD pipeline takes 45 minutes. Developers complain. Break down how you'd systematically reduce it to under 10 minutes.
Explain the difference between a star schema and a snowflake schema in a data warehouse. Which is better for query performance?
You're asked to build a drag-and-drop kanban board in React. The board has 10 columns and potentially 1000 cards total. Describe your complete implementation approach including performance considerations.
Your MongoDB write throughput dropped 80% after enabling journaling and write concern w:majority. Explain what each does and propose a solution that maintains durability without killing performance.
You need to run a database migration before deploying your new application version in Kubernetes. How do you handle this safely?
Your data pipeline reads from Kafka, transforms data, and writes to a data warehouse. On failure, it must resume from exactly where it left off, without duplicates or missing records. How?
Design a MongoDB schema for a chat application. Messages belong to conversations. Users can be in many conversations. You need to query: all messages in a conversation (paginated), all conversations for a user (sorted by latest message).
Your team has been writing code for 6 months with no documentation. How do you introduce documentation without disrupting velocity?
Your MongoDB collection has 50 million documents. A query filtering on a nested array field is doing a full collection scan despite having an index on that field. What's likely wrong?
Your Kubernetes deployment has rollingUpdate maxUnavailable:0 and maxSurge:1. A new deployment is stuck at 1/2 pods ready and never completes. What's happening?
Your GraphQL schema evolved and you need to deprecate a field. Old clients use it. New clients use the replacement. How do you handle this?
A stakeholder wants a feature added mid-sprint that is 'absolutely critical.' How do you handle this?
Your team is debating between SQS Standard and SQS FIFO queues. List the actual tradeoffs with numbers.
Should you use GraphQL subscriptions or WebSockets directly for real-time updates in a chat application? Compare the approaches.
Your sprint backlog has 15 user stories. By day 3 of a 10-day sprint, the team realizes they've underestimated by 50%. What do you do?
Explain the difference between 'unknown' and 'any' in TypeScript. When would using 'any' be a valid technical choice rather than a code smell?
Explain how CloudFront caching works. A developer updates an S3 file but users still see the old version for 24 hours. Fix this correctly.
Your team is arguing about whether to use Context API or Redux for a mid-sized app with 15 screens. Some data is global (user auth), some is page-level. Make the architecture decision and justify it.
You have a TypeScript function that accepts a union type of 10 different shapes. You use instanceof checks that work in tests but fail in production after webpack bundling. Why?
Your EC2 instances are running at 90% CPU. Auto Scaling adds instances but they're not receiving traffic fast enough — users still see errors for 3 minutes during scale-out. How do you fix this?
You're asked to implement 'skeleton loading' for a complex page with 5 different data sources. Each section should show a skeleton while its data loads, then transition smoothly. How?
You're consuming from a Kafka topic with 50 million messages backlog. Your consumer needs to catch up without overwhelming your database. How do you design the catch-up strategy?
Design a serverless architecture for an API that: handles 10K req/sec at peak, has sub-100ms response, costs near-zero at zero traffic.
Your React app uses CSS-in-JS (Styled Components). After migrating to Next.js App Router (Server Components), styles are missing on first render. Why?
What is declaration merging in TypeScript and what problems can it solve?
Your Lambda function needs credentials to access an RDS database. A developer hardcoded the password in environment variables. What's the correct approach?
Your Elasticsearch index is 500GB but only 10GB of data is actually queried (hot data from last 7 days). Cold data from older dates slows down all searches. How do you architect this?
Explain the difference between NAT Gateway, Internet Gateway, and VPC Endpoints. When does each one make sense?
You need to build a data table with sorting, filtering, pagination, and column resizing for 100 columns and 10,000 rows. Describe your complete technical approach.
Explain the difference between a term query and a match query in Elasticsearch. When does using a match query on an exact-match field cause incorrect results?
You need to process S3 files as soon as they're uploaded. Files come in bursts of 10,000 per hour. How do you architect this?
A PM asks you to add Google Analytics and 3 other tracking scripts to your React app. You know this will hurt Core Web Vitals. How do you push back with data and propose a solution?
You're indexing 1 million documents per hour into Elasticsearch. Indexing is slow and search performance degrades during indexing. How do you fix this?
Your S3 bucket is being charged for 500TB of storage but your application only stores 100TB. Where is the rest coming from and how do you find and fix it?
Your Next.js app fetches user data in a Server Component. The data is user-specific so caching is tricky. How do you handle per-user caching without leaking data between users?
Explain TypeScript's structural typing. How does it differ from nominal typing and why does it sometimes cause unexpected behavior?
You're designing a database for an online exam system. 10,000 students take an exam simultaneously. Each student answers 50 questions. Design the schema and identify the hot spots.
Your Elasticsearch cluster has 3 nodes. One node goes down. Searches return partial results (yellow status). Why not red? What's the difference?
Explain ACID properties with a real banking transaction example. Which property does READ COMMITTED isolation level sacrifice?
Your Redis sorted set is used for a leaderboard with 10 million players. ZRANGEBYSCORE queries are slow. How do you optimize?
You store user sessions in Redis with 2-hour TTL. Users complain they're logged out after 30 minutes of browsing. What's likely wrong?
You have a Spark job that processes 1TB of data. It runs fine for 900GB but fails with OOM on the remaining 100GB. Why?
What is a star schema vs snowflake schema in data modeling? Trade-offs?
Explain partitioning strategies in Parquet files on S3. How does column pruning and predicate pushdown reduce query cost?
You have a slowly changing dimension in a data warehouse. Employee department changes over time and you need to query 'what department was this employee in on date X?' Design the table.
What are slowly changing dimensions (SCD) in data warehousing? Explain Type 1, Type 2, and Type 3.
Your RDS MySQL instance CPU hits 100% every day between 2-4 PM. Your application traffic is steady. What are the most likely causes and how do you investigate?
Explain the difference between batch and streaming data processing. When is Flink better than Spark for streaming?
You deploy a new version of your service on ECS Fargate. The deployment causes 2 minutes of 503 errors despite a rolling update configuration. What are the likely causes?
What is Apache Airflow and how does it differ from a cron job for orchestrating data pipelines?
You're using Python multiprocessing and processes need to share a large dictionary (2GB) read-only. Creating copies per process uses 20GB total. How do you share memory efficiently?
Explain the differences between a Data Warehouse, Data Lake, and Data Lakehouse architecture.
Your Python application has a function that should cache results but the @functools.lru_cache decorator is causing memory issues. Objects cached are large DataFrames. How do you implement a size-bounded cache?
Your Python service handles JSON data from multiple sources. Some send {'amount': '100.50'}, others send {'amount': 100.50}. Your code crashes intermittently when doing arithmetic. Fix this robustly.
Your Python service deployed in Docker shows 10% more memory usage after each deployment with no code changes. What do you investigate?
What is the difference between Elasticsearch index mapping types and when would you use keyword vs text field?
You're building a data pipeline in Python that processes streaming data. The pipeline has 5 stages. How do you ensure a failure in stage 3 doesn't lose data already processed by stages 1 and 2?
Your Celery worker is processing tasks but tasks take 10 minutes each and the beat scheduler keeps adding duplicates because the first hasn't finished. Fix this.
You have a Python function that runs in 30 seconds. A profiler shows 90% of time is in one NumPy operation on a 10,000 x 10,000 matrix. How do you make it faster?
You have a Python script that processes 1 million records from a database. It loads all records into a list, processes each, then writes results. Memory usage hits 16GB and the OS kills it. Fix this without changing the database schema.
What are GraphQL fragments and how do they improve client code?
Your Python code processes a 10GB JSON file. json.load() fails with MemoryError. How do you handle it?
Your GraphQL API has a deeply nested query that hits 15 database tables. How do you prevent abuse?
Your Python script takes 10 minutes to process 1 million CSV rows. Profile shows 80% time is in a string parsing function. Rewrite this function for maximum performance.
What is Python's __slots__ and when would you use it? What are the trade-offs?
Explain the difference between GraphQL queries, mutations, and subscriptions. When would you use each?
Your Django REST API has an endpoint that calls 3 external services sequentially, each taking ~500ms. Total response time is ~1.5 seconds. How do you parallelize these calls?
What is the N+1 problem in GraphQL and how do DataLoaders solve it?
A user says they can log in to your app as another user by changing a value in their session cookie. How serious is this and what's your immediate response?
You're building a multi-tenant SaaS application. How do you isolate data between tenants?
A data analyst complains that a report that runs daily takes 8 hours but used to take 30 minutes, starting 2 weeks ago. Nothing changed in the report query. What do you investigate?
Design a Node.js service that handles file uploads up to 500MB. Multiple instances run in containers. Where should uploaded files go?
Your RDS instance hits 100% CPU during peak hours. Queries are optimized. What are your scaling options?
What is AWS ECS vs EKS? When would you choose ECS over Kubernetes?
What is WebAssembly (WASM) and when would you use it in a web application?
Your Node.js service sends 10K emails per hour. Email provider rate-limits at 100/second. How do you implement this without losing emails?
Explain S3 storage classes and how to set up lifecycle policies to optimize costs.
Your Node.js API loses precision on large numbers (e.g., 9007199254740993 becomes 9007199254740992). What's happening?
What is CloudFront? How does it reduce origin load and what cache behaviors can you configure?
Explain how AWS VPC peering differs from AWS Transit Gateway. When would you choose each?
A junior developer accidentally ran DROP TABLE orders in production. The table has 50M rows and no recent backup. The last backup is from 3 days ago. What do you do?
Your S3 bucket is publicly accessible and contains sensitive data. You turned on Block Public Access but users say the data is still accessible. Why?
Your Kubernetes cluster is down. Entire production is offline. You have 15 minutes before CEO calls. What do you do?
What is the difference between AWS IAM Role and IAM User? Best practice when your EC2 instance needs S3 access?
Explain the difference between AWS Application Load Balancer and Network Load Balancer. When would you choose NLB?
Explain backfill in Airflow. Your daily pipeline is new. You need to process data for the last 30 days. How?
Your AWS Lambda functions have a shared utility layer. You update the layer and some functions get the new version, some don't. Why?
What is an Airflow XCom? What are its limitations for large data?
Explain the difference between AWS SQS Standard and FIFO queues. When would you choose each?
How do you handle secrets in Airflow? What are the risks of storing them in the DAG file or UI Variables?
How would you implement a 'undo/redo' feature in a complex React form with 20 fields?
You join a company and find the main API has no authentication on 3 endpoints that return user PII. Your manager says 'it's legacy, we'll fix it later.' What do you do?
Explain Airflow's execution_date vs scheduled_interval. A DAG scheduled daily at midnight runs at 1am. What is the execution_date?
Write a PySpark job that reads a CSV, computes the top 10 customers by total spend, and writes to Parquet.
Explain the difference between persist() and cache() in Spark. When should you persist to disk?
A designer hands you a Figma design for an animated dashboard with 20 charts updating every second from WebSocket. How do you architect the React side to prevent the entire dashboard from re-rendering on each update?
Your PySpark job fails with 'Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded' on the executor. What does this mean?
Explain what happens step by step when you run: BEGIN; UPDATE accounts SET balance = balance - 100 WHERE id = 1; -- crash here. And why this matters for your application design.
What is Spark's DAG and how does the Catalyst optimizer improve query performance?
Explain what happens during a VACUUM operation in PostgreSQL. Why is it necessary?
Explain the difference between Spark transformations and actions. Why are transformations lazy?
Your React app uses React Query. Users complain data is always stale — they update a record and the list still shows old data. What's the correct fix and what are the tradeoffs?
Your CloudFormation stack update fails and rolls back, leaving your application in a partially deployed state. How do you prevent this and handle it when it happens?
Explain MongoDB's WiredTiger storage engine. How does its document-level locking differ from earlier MMAPv1 collection-level locking?
Explain how AWS IAM roles vs users vs policies work. Why should applications NEVER use IAM users with access keys?
How do you implement tree shaking in a React component library so importing one component doesn't bundle the entire library?
A junior developer on your team committed an API key to a public GitHub repository 3 days ago. What do you do?
A stored procedure runs fine in isolation but causes deadlocks when called concurrently by 50 threads. The procedure does: UPDATE accounts, then UPDATE transactions. Another procedure does the same in reverse order. What's happening and how do you fix it?
You have a MongoDB aggregation pipeline that runs for 30 seconds on a collection with 10 million documents. How do you optimize it?
You have an S3 bucket that's costing $5K/month just for PUT/GET requests. Traffic hasn't changed. What could cause a spike in request costs?
Explain GraphQL's schema-first vs code-first approach. Trade-offs for a team of 5 backend developers?
Your TypeScript code compiles fine but throws 'Cannot read property X of undefined' at runtime. How is this possible in a strictly typed TypeScript codebase?
What is React Query's staleTime vs cacheTime? Explain with a scenario where misconfiguring them causes UX problems.
What is Snowflake's virtual warehouse concept and how does credit consumption work?
Design a Toast notification system in React that can be triggered from anywhere in the app, shows multiple toasts, and auto-dismisses after 3 seconds.
Your Lambda function needs to access a VPC resource (RDS in private subnet) but also needs to call external APIs. What's the networking concern and how do you resolve it?
Explain the TypeScript utility types: Partial<T>, Required<T>, Pick<T,K>, Omit<T,K>, and Record<K,V>. Give a real use case for each.
You have a TypeScript codebase where a function returns string | undefined. Throughout the codebase, developers use the ! non-null assertion operator everywhere. Why is this a code smell?
Practice these questions with AI feedback
Get instant grading on your answers, identify your weak areas, and generate a personalised 14-day study plan — all free.
Build my study plan →