Study notes for Adarsh Vishwakarma, SDE I AUTA APJ. Java Live Code. Job 10454435 still has no public named live question. Labels: IE-asked Resume-derived Standard CS. Full DSA problem cards: Answer-BIBLE.md. Scan sheet: Cheat-Sheet.md.
Notes for Adarsh (SDE I AUTA APJ, Job 10454435). Java is canonical for Live Code. These are questions other SDE I / UTA / AUTA candidates reported, plus resume-derived and standard CS. Your 18 Aug loop may differ. Unnamed stays unnamed. No public IE names 10454435 for a live-round question — this file is not a prediction list.
Every question is labeled IE-asked / Resume-derived / Standard CS. IE-asked titles come from Question-Research-BIBLE.md §5.C / §5.F (plus the GFG remainder that named LED RGB). Full LLD cards live in Answer-BIBLE.md §3 — this fragment is the OOP talk-track, not a paste of those cards.
60-s OOP opener if they go LLD: “I split *what varies* behind an interface, keep data objects dumb, put rules in one owner class, name SOLID as I add types.” Then write the smallest compiling sketch.
Source: Reddit 1ueybmg · reprint amazonsdeprep 1ueybwz · AUTA India 2025 passout · R1+R2 same day Bangalore onsite · our R2 · bible §5.C / §6.A. R1 greedy/tree/puzzle UNNAMED (not this Q). Fuller card: Answer-BIBLE §3 logger.
What they wrote: designing a logger system judged on SOLID and patterns.
Logger via DI vs global Singleton?Logger facade + LogSink / LogAppender Strategy + optional LogFormatter + CompositeSink for fan-out. OCP is the interview: new sink without editing Logger.JsonFormatter / SocketSink; L any sink substitutable; I write vs format (do not force close() on console); D Logger depends on LogSink, not FileWriter.main / factory — not Logger.getInstance() mutable global” (testability).log(level, msg) + if (level < min) return + System.out.println. Then extract LogSink. Async follow-up = BlockingQueue + worker (Producer-Consumer), not a new SOLID letter.
interface LogSink { void write(String line); }
final class ConsoleSink implements LogSink {
public void write(String line) { System.out.println(line); }
}
final class Logger {
private final int min; // ordinal
private final LogSink sink;
Logger(int min, LogSink sink) { this.min = min; this.sink = sink; }
void log(int level, String msg) {
if (level < min) return;
sink.write(level + " " + msg);
}
}
The interview is not “write Log4j”; it is whether you can split what varies behind interfaces and name SOLID while a compiling facade takes shape. A Logger is a facade that filters by min-level and hands a formatted line to a LogSink Strategy, not a subclass tree of ConsoleLogger and FileLogger. Single responsibility means a JsonFormatter only shapes text, a FileSink only appends bytes, and min-level lives on the facade. Open/closed is the grading point: add a SocketSink that implements LogSink without editing Logger at all. Liskov requires every sink to accept the line; interface segregation keeps close() and rotate() off LogSink so console is not forced to close; dependency inversion means Logger depends on LogSink, not FileWriter. Name Strategy, Composite for fan-out, and optional Decorator for timestamp or async, and construct one logger in main instead of a mutable Logger.getInstance(). If the clock is dying, print then extract LogSink; async is a BlockingQueue plus a worker, not a new SOLID letter. Ylogx services logged behind 99.9% uptime and sub-210 ms, so application code does not own disk IO; do not claim you shipped this Java logger.
Example. Wire new Logger(INFO, new SocketSink("logs.internal", 514)). Later wrap console, file, and socket in a CompositeSink. The Logger source file never gains a socket import.
interface LogSink { void write(String line); }
final class SocketSink implements LogSink {
private final java.io.PrintWriter out;
SocketSink(String host, int port) {
this.out = new java.io.PrintWriter(
new java.net.Socket(host, port).getOutputStream(), true);
}
public void write(String line) { out.println(line); }
}
// Logger still holds LogSink sink; no edit to Logger when SocketSink appears.
If they probe: Ask whether they want async; if yes, queue records and keep log() non-blocking. If they say Singleton, construct once in a factory and inject, rather than a static mutable instance.
Source: LC 6653463 · University Talent Acquisition named · Mar–Apr 2025 · our R1 · bible §4 A11 / §5.C / §6.A. Same R1 also asked HashMap internals (next Q) and count BT nodes with two children (DSA, not this file).
What they wrote: OOD for students with rollNo, marks, name, rank, using HashMap.
rollNo as key? rank on insert vs on query? ties = dense (1,2,2,4) vs competition (1,2,2,3) vs unique (1,2,3,4)?Student = data (rollNo final); ClassRoster owns Map<Integer, Student> and the rank rule (S). Do not put HashMap inside Student.rank = i+1. O(n log n) per add is fine until they ask lazy recompute.List only: get-by-roll becomes O(n).Ranker interface if they probe dense vs competition (O). Student.equals is not required if the map key is Integer rollNo.byRoll.put(s.rollNo, s) then sort values. Resume hook: GiftedBooks student engagement + PYQ topic ranking is product ranking, not this roster — do not force it. Honest: “same map-by-id, sort-for-order pattern.”
final class Student {
final int rollNo; String name; int marks; int rank;
Student(int rollNo, String name, int marks) {
this.rollNo = rollNo; this.name = name; this.marks = marks;
}
}
final class ClassRoster {
private final Map<Integer, Student> byRoll = new HashMap<>();
void add(Student s) { byRoll.put(s.rollNo, s); recompute(); }
Student get(int rollNo) { return byRoll.get(rollNo); }
void recompute() {
List<Student> all = new ArrayList<>(byRoll.values());
all.sort((a, b) -> Integer.compare(b.marks, a.marks));
for (int i = 0; i < all.size(); i++) all.get(i).rank = i + 1;
}
}
A Student is a data object with final rollNo, mutable name and marks, and a derived rank; a ClassRoster owns Map<Integer, Student> and the ranking rule, which is Single Responsibility. Clarify unique roll, rank-on-insert versus rank-on-query, and ties: dense 1,2,2,4 versus competition 1,2,2,3 versus unique 1,2,3,4. Live Code copies values, sorts by marks descending, and assigns rank = i + 1 in O(n log n) per add until they ask for lazy recompute. HashMap is the index because get-by-roll is O(1) average; TreeMap sorts by roll, not marks, and a List alone makes get O(n). You do not need Student.equals if the key is Integer rollNo; if Student is later a key, equals and hashCode use only final roll. Extract a Ranker interface when they probe dense versus competition so a new policy does not edit the roster. GiftedBooks ranking is product ranking, not this roster; the honest bridge is map-by-id then sort-for-order, and this UTA card is LC 6653463, not Job 10454435.
Example. Add (101, Ada, 90), (102, Bob, 90), (103, Cyd, 70). Unique ranks after a stable sort: Ada 1, Bob 2, Cyd 3. Dense ties: Ada 1, Bob 1, Cyd 3. Competition: Ada 1, Bob 1, Cyd 2. Get Ada by roll is a HashMap lookup, not a scan.
void recomputeDense() {
List<Student> all = new ArrayList<>(byRoll.values());
all.sort((a, b) -> Integer.compare(b.marks, a.marks));
int i = 0;
while (i < all.size()) {
int j = i;
while (j < all.size() && all.get(j).marks == all.get(i).marks) j++;
for (int k = i; k < j; k++) all.get(k).rank = i + 1; // 1,2,2,4
i = j;
}
}
If they probe: Lazy rank: dirty flag, recompute on getRank. Concurrent adds need one lock on the roster. Do not put rank in the HashMap key.
Source (two IEs, same topic):
This is CS-fundamentals-asked, not “Job 10454435 will ask HashMap.”
& (n-1). Java mix: h ^ (h >>> 16) so high bits affect the index.equals.a.equals(b) then a.hashCode()==b.hashCode(). Override both or neither. Mutable key after insert → lost entry (bucket moved, map still looks in old bin).HashSet = HashMap keys + dummy value. One null key in HashMap. ConcurrentHashMap: no null, bin-level concurrency — not a drop-in for a shared roster without a spec.TreeMap. Word-count: HashMap counts + size-K heap.A HashMap is an array of buckets whose capacity is a power of two, and the index is mixed hash h ^ (h >>> 16) then & (n - 1) so high bits affect the bin. A get walks that bin and uses equals after the hash matches. Collisions start as a linked list; Java 8+ treeifies at eight nodes when the table is large enough, and untreeifies on shrink. Load factor 0.75 triggers a 2× resize and a rehash, so average get and put are O(1) while a total collision is O(n) or O(log n) in a tree bin. If a.equals(b) then the hash codes must be equal: override both methods or neither, and never mutate hash fields after put or the entry is lost. HashSet is a HashMap of keys plus a dummy value; HashMap allows one null key; ConcurrentHashMap allows none and is not a drop-in roster unless they asked for threads. LC 6570344 also asked why a PriorityQueue: repeated extract-min for top-K, not a fully sorted TreeMap. Ylogx Redis that cut bot DB latency 35% is outside the JVM; in Live Code the HashMap is the index, and this is CS asked on 6653463 and 6570344, not a named Job 10454435 question.
Example. Two new Roll(5) objects: equal by value, same hash, map.get(new Roll(5)) finds the entry. Mutate roll.n after put and the next get misses because the bucket index moved in your head but not in the table.
If they probe: Walk one collision: same hash, different equals, list then treeify at 8. Ask load 0.75 and why capacity is 2^k. Do not claim ConcurrentHashMap for the student roster unless they asked for threads.
Source: GFG sde-1-16 · last-updated republish 23 Jul 2025 · older remainder, not UTA-default 2026 · OA-as-R1 Y → their Round 2 (SDM) maps to our R1 analogue · bible §5.C remainder / §6.C.
Candidate wording: “Design an approach for glowing different combinations of LEDs (Red, Blue, and Green) — focused on OOPS and SOLID.” Also LP in that same SDM round (disagree with manager; redo work) — not this file.
setRgb? hardware vs simulation?ColorSink / Led) from effect (Effect.apply(sink)). Combinations are data (r,g,b or bitmask), not 7 subclasses (RedLed, GreenLed, …) — that fails O the moment they add amber.FadeEffect without editing Led; L any ColorSink; I setRgb is enough (no playSound on an LED); D controller depends on Effect, not SolidEffect.BlinkController *has* a sink and an effect. Inheritance only if they insist on an AbstractLed with shared clamp.class Led { int r,g,b; void setColor(int r,int g,int b); } then extract Effect. Do not design a lighting mesh network.
interface ColorSink { void setRgb(int r, int g, int b); }
interface Effect { void apply(ColorSink sink); }
final class Led implements ColorSink {
int r, g, b;
public void setRgb(int r, int g, int b) {
this.r = clamp(r); this.g = clamp(g); this.b = clamp(b);
}
static int clamp(int x) { return Math.max(0, Math.min(255, x)); }
}
final class SolidEffect implements Effect {
final int r, g, b;
SolidEffect(int r, int g, int b) { this.r = r; this.g = g; this.b = b; }
public void apply(ColorSink s) { s.setRgb(r, g, b); }
}
Combinations of red, green, and blue are data, not seven subclasses named RedLed and YellowLed: an RGB pixel has three integers, seven on/off mixes are a bitmask, and PWM is 256³ values. Split hardware from effect: a ColorSink exposes setRgb, and an Effect Strategy applies solid, blink, or fade onto that sink. Adding amber or a strip is a new sink or a new effect, which is Open/Closed, not a rewrite of Led. Single responsibility keeps clamp on hardware and blink timing on the effect; Liskov requires every sink to honor setRgb; interface segregation keeps playSound off an LED; dependency inversion means a controller depends on Effect, not SolidEffect. Composition is the shape: a BlinkController has a sink and has an effect, and inheritance is only if they insist on shared clamp. Horizon’s GStreamer 60 FPS path is a pipeline of nodes, not Camera extends Rover, and Argus’s 20+ feeds keep detector, alerter, and Postgres log as separate objects. This GFG remainder is older and not UTA-default 2026; still name SOLID out loud and do not design a lighting mesh in forty minutes.
Example. Bitmask 0b101 means red and blue on, green off: one Led, new SolidEffect(255, 0, 255).apply(led). A later FadeEffect implements Effect; Led is unchanged.
If they probe: If they want 7 named modes, still one class plus a mask, not 7 subclasses. If they add a strip, a StripSink implements ColorSink per pixel or as a bulk write.
Source: Pratyush LinkedIn · Hyd onsite · our R2 analogue · not UTA/AUTA · bible §5.C. Related find-family (Raghav Java-library-on-Linux; Vanshika Unix find) is the same OOP split (predicate vs walk) — not a second UTA ask. US 3×60 Find = NMF.
Asked: file library OOD: recursive traversal, filtering, abstractions, inheritance.
FileComponent ← FileLeaf + Directory (this is the honest use of inheritance they asked for).NameSuffixFilter / MinSizeFilter / AndFilter — do not inherit JpgFilter extends SizeFilter.search(dir, filter). Cycles: identity-visited dirs.FileFilter, not *.jpg (D).They asked for inheritance on a file library, so use Composite for the tree: an abstract FileComponent with FileLeaf and Directory children, and a recursive search — that is the honest is-a. Filters are not an inheritance tree; a JPG-and-min-size query is AndFilter wrapping NameSuffixFilter and MinSizeFilter, not JpgFilter extends SizeFilter. Open/closed means a new date filter implements FileFilter without touching the walk, and the library depends on FileFilter, not on *.jpg. Walk with a Visitor or recursion, and keep an identity set of visited directories for cycles. This Pratyush Hyd onsite card is not UTA; Raghav’s Linux library and Vanshika’s Unix find are the same predicate-versus-walk family, not a second UTA ask. StratifyLabs 50+ models is catalog plus filter, and IQVIA 200+ page BRDs walk chunks with a retrieval predicate. Do not invent a second UTA find question from the US 3×60 post.
Example. Search “*.log larger than 1 MB”: library.search(root, new AndFilter(new NameSuffixFilter(".log"), new MinSizeFilter(1_000_000))). Adding MinMtimeFilter does not edit Directory.search.
If they probe: They asked inheritance: Composite for files. If they push filters as subclasses, push back with composition and name Open/Closed. Symlinks: visited-identity set.
Source: GFG sde-1-29 · 2022-era · BR · not UTA/AUTA · year-out · bible §5.C. Not Connect Sticks “Alexa ropes.”
AlexaDevice *has* Battery + PowerSource.SolarDock implements PowerSource. L: any Battery. D: device does not new LithiumBattery() inside if they want testability.An Alexa-like device is not a battery and is not a charger. The device has a Battery and has a PowerSource. Chemistry (lithium versus a mock) is substitutable under Liskov. A solar dock implements PowerSource without editing the device class, which is Open/Closed. Dependency inversion: the device does not new LithiumBattery() inside its constructor if they want tests; inject it. Observer is an optional follow-up: low-battery callbacks. Do not design Alexa cloud, skills, or wake-word in this older GFG BR card. Horizon rover power is not on the resume; do not invent a BMS. The honest composition analogue is Argus: camera has detector has alerter, a pipeline, not Camera extends SafetySystem. This is year-out and not UTA.
Example. A test injects new AlexaDevice(new FakeBattery(5), new NoopCharger()) and asserts a low-battery observer fires. Production wires LithiumBattery and UsbCharger. The device class is unchanged.
If they probe: If they add wireless charging, a new PowerSource impl. If they add two batteries, the device has a list of batteries, still composition.
Source: GFG off-campus-8 · our R1 analogue in that IE · bible §6.C. Same IE also: pile of books DS (not OOP).
headcount().Pick one tree and say it out loud so you do not mix org-chart with floor-plan. Either Office contains Buildings, each Building contains Floors, each Floor contains Rooms, or a manager contains reports. Both are Composite: a node implements the same headcount() or capacity() as a leaf, then recurses. This is the same pattern as the file library: leaf versus node, recursion, not a SQL org chart unless they ask persistence. Do not invent a people-manager tree from IEDC CUSAT or Horizon; those reporting lines are informal. This older GFG off-campus card also asked a pile-of-books data-structure question in the same IE; that is not OOP. Keep the sketch to a handful of types and one recursive method.
Example. A floor with three meeting rooms and an open bay: floor.headcount() sums each room. Adding a wing is a new Building child of Office, not a new subclass of Floor.
If they probe: If they switch to manager-reports, the Composite is the same; names change. Persistence is out of scope unless they ask.
Production was Python FastAPI + TypeScript NestJS/React (plus ROS2 on Horizon). Live Code is Java. Bridging line: “Same types — interface vs class — I write Java here.” Do not claim the internships were Java OO codebases.
Role enum or small type (3 organizational tiers on resume — do not invent extra tiers). Identity holds userId + role. S: NestJS/FastAPI auth ≠ Postgres RLS policy.AuthZ interface: can(Identity, Action, Resource). App check is not enough; RLS is a second enforcement in SQL (composition of two gates, not User extends Admin).Analyst extends Manager for permissions — data + policy objects. New role = new policy row / strategy (O).Ylogx used three organizational tiers, SQL RAG with row-level security, Redis that cut bot DB latency by 35%, reports 40% faster, 99.9% uptime, sub-210 ms, and 30 KPI dashboards. Model a small Role type for those three tiers; do not invent extra tiers. An Identity holds user id plus role. Authorization is an AuthZ interface: can(identity, action, resource). The NestJS or FastAPI check is not enough; Postgres RLS is a second gate in SQL. That is composition of two enforcements, not User extends Admin. Do not inherit Analyst extends Manager for permissions. New access is a policy row or a Strategy, which is Open/Closed. Single responsibility: app auth is not the RLS policy module. Live Code is Java types; production was Python and TypeScript. Do not claim the internship was a Java OO codebase.
Example. A dashboard query builds an RlsContext from the identity and passes it into QueryService. Cached Redis answers must still be keyed by tier so a lower tier cannot read a higher-tier blob. The chatbot NlToSql sits behind the same RLS, not a second data path.
If they probe: App-only WHERE tenant_id is one missed query from a leak. That is why RLS lives in the database. Do not invent a TTL; the resume does not list one.
FrameSource, Detector, AlertSink, EventStore — has-a pipeline. YoloV9Detector implements Detector. Camera is not a subclass of “SafetySystem.”List<FrameSource> of 20+ feeds, same process(frame) loop. New PPE class = data/weights, not HelmetCamera extends Camera.Argus is a has-a pipeline: a frame source, a detector, an alert sink, and an event store. YOLOv9 implements Detector. A camera is not a subclass of SafetySystem. Polymorphism is the 20+ camera loop: a list of FrameSource objects and the same process(frame) path. A new PPE class is weights and labels, not HelmetCamera extends Camera. That is Open/Closed on the detector, not an inheritance explosion. Resume numbers stay as written: 73% to 89% mAP, 15,000+ images, 24 FPS, 20+ cameras, violations down 50%, compliance 2×, Postgres logging. Do not claim this Java sketch ran at 24 FPS. Composition matches the production split: detector is not alerter is not store.
Example. Pipeline p = new Pipeline(new YoloV9Detector(weights), new SlackAlertSink(), new PostgresEventStore()); Swapping a future detector is a constructor argument. The 20-camera loop does not change.
If they probe: Backpressure if 20 cameras at 24 FPS flood alerts: bounded queue, drop or sample, same instinct as an elevator hall-call flood. Auth on the dashboard; no public stream URLs.
ModelCard (weights + metrics) *has* InferenceRuntime; marketplace listing is not GPTModel extends VisionModel unless they share a tiny RunnableModel interface.A marketplace listing is not GPTModel extends VisionModel. A ModelCard has weights and metrics and has an InferenceRuntime. Browser inference versus a training lab are two runtimes behind one interface, which is Strategy and Dependency Inversion. The URDF and WebGL editor is a separate component. Resume: ML iteration down 30%, marketplace of 50+ pre-trained models and datasets, 3D sim lab. Do not invent a training cluster you did not run. Do not use a default Next.js README to pad features; resume bullets win. Live Code can reuse a searchable collection of model cards, HashMap by id plus a name prefix Trie if they ask search.
Example. ModelCard holds id, name, metrics. card.run(image) delegates to the injected runtime. A new ONNX runtime implements the same interface; listings do not subclass each architecture.
If they probe: Search of 50+ models is HashMap plus optional Trie, not FAISS unless they name vectors.
class BingSearch extends DuckDuckGoSearch. Shared contract: ResearchTool.run(query) → Evidence.interface Retriever.A LangGraph is composition plus Strategy: each node is a callable with a shared contract, not BingSearch extends DuckDuckGoSearch. A ResearchTool.run(query) returns evidence. The ranker is a separate object because the work ranked 200+ websites. Hybrid RAG on 200+ page BRDs is a retrieval Strategy: keyword versus vector versus graph, not subclass soup. Azure AI Search hybrid plus semantic, GraphDB, and LangSmith evals stay as resume facts. Java Live Code is one interface Retriever with two implementations. Production was Python. BRDs are confidential: secrets in env, not in traces, and do not log full document text. Whiteboard IQVIA, not Amazon SNS.
Example. ResearchTask holds a list of ResearchTool. The graph invokes tools, a ranker orders RankedSnippet objects, and a Retriever implementation is injected. Adding a graph retriever does not edit the ranker.
If they probe: Evals are traces as an append-only list. Do not dump customer BRD text into a log sink.
DocumentStore, Embedder, Answerer composed; avatar/VR UI is not a subclass of RAG.GiftedBooks composes a document store, an embedder, and an answerer. The avatar and VR UI is not a subclass of RAG. Resume only: sub-300 ms API, 99.5% uptime, reading efficiency +35%, engagement +50%, 2.5× comprehension, doubt resolution 3–10 min. The GitHub README currently describes AegisAI; that is a mismatch, so answers stay resume-only. This is not Stack Overflow voting and not Shiwangi’s per-book HashMap word count unless they want a toy indexer first. Live Code fallback for topic strings is a searchable HashMap or Trie. Do not invent features from the wrong README.
Example. QaSession has a DocumentStore and an Answerer. Upload creates chunks; ask retrieves then generates. VR lab is a separate client of the same API.
If they probe: If they analogize to bookstore word-count, say RAG retrieval versus a frequency map. If they analogize to SO, there is no accept, vote, or tag marketplace.
class Rover extends Camera.ROS2 nodes are composition. Camera, mapper, and planner are not Rover extends Camera. The camera path is GStreamer at 60 FPS. The ZED mapper is 2M+ points per second. The costmap planner cut collision risk 55%. ERC 2024 placed 17th of 80+ teams. CUSAT CSE 8.42 is education, not an object. UDP versus TCP is a networking follow-up, not OOP: GStreamer UDP for the feed. Do not add unlisted sensors. The Gstreamer-UDP repo supports the 60 FPS story off-resume if they ask the repo; do not pad hardware. A costmap graph is not the LC 6369243 parcel DAG unless they explicitly connect them. Do not claim you delivered Amazon stations.
Example. Rover has CameraPipeline, has ZedMapper, has CostmapPlanner. Each node publishes; none inherit the rover. A new planner implements a Planner interface.
If they probe: If they stay on ERC, keep objects small: Pose, Costmap, CameraPipeline. If they pivot to delivery topo, that is a different IE; do not stamp LC 210.
The skills list includes Java. Internships and projects shipped Python and TypeScript because that was the stack: FastAPI, NestJS, React, ROS2 on Horizon. Amazon Live Code for this loop is Java, so DSA and OOD here are Java. The contracts map: a FastAPI or NestJS router is a thin controller, a service is the roster or logger, a repository is a HashMap or Postgres. Same types, interface versus class, written in the editor’s language. Do not claim the internships were Java OO codebases. Do not apologize; state the mapping in one breath and write the sketch. InstaRecon if they scroll GitHub is a security-awareness demo with consent and no production attacks, then redirect to Ylogx, IQVIA, Argus, or Stratify. No phishing, credential, or exploit steps.
Example. Ylogx query path in Java Live Code: QueryService depends on ReportStore and AuthZ. In production those were NestJS and FastAPI modules with the same split.
If they probe: If they ask depth in Java, write the logger or roster compiling sketch. If they ask Spring, say you can talk DI without claiming a Spring internship.
Student, Logger, Led.default/static only). Multiple interfaces OK (ColorSink + Closeable). Logger sinks, rankers, detectors.clamp *and* you truly have an is-a hierarchy; otherwise a final util + interface.default methods: mixin with care (diamond — next Q). Prefer composition.
interface Ranker { void assign(List<Student> all); }
abstract class AbstractSink implements LogSink {
final void write(String line) { emit(format(line)); }
abstract void emit(String line);
String format(String line) { return line; }
}
final class FileSink { /* concrete; prefer this over abstract if no shared state */ }
A class holds state and implementation. You instantiate it unless it is abstract. Use a class for Student, Logger, and Led. An interface is a can-do contract: no instance fields except constants, plus Java 8 default and static methods. A type may implement many interfaces, for example ColorSink plus Closeable. Logger sinks, rankers, and detectors are interfaces. An abstract class holds shared fields, a partial implementation, and often a template method. Java allows one class parent. Use abstract when many subtypes share real state and you would otherwise copy five lines into every subclass. Otherwise prefer a final utility plus an interface. The rule of thumb they like: depend on an interface, implement with a class, introduce abstract only to stop duplication. Java 8 default methods are mixins; the diamond problem is the next question, and composition is usually cleaner.
Example. Ranker is an interface with two classes, DenseRanker and CompetitionRanker. AbstractSink with template write-then-emit is optional; a concrete FileSink is enough if there is no shared state.
If they probe: If they ask why not always abstract: you get one parent and a fragile base. If they ask default methods: fine for a tiny mixin, not for state.
AbstractLed.tick() breaks every subclass. Composition isolates that.FileLogger extends ConsoleLogger.Inheritance is is-a and must pass Liskov; composition is has-a. A logger has a sink, an LED controller has an effect, and a roster has a map. Prefer composition when you will swap behavior such as appenders, rank policy, or YOLO versus a future detector. Use inheritance for a genuine taxonomy such as File versus Directory in Composite, which is what Pratyush asked. Do not write FileLogger extends ConsoleLogger, because that copies console behavior and then fights it when you need only a file. Changing AbstractLed.tick() breaks every subclass at a distance; composition isolates that change behind an interface. Resume pipelines are has-a: Argus detector-alerter-store, Horizon ROS2 nodes, and Ylogx policy composed with queries. A Car has an Engine; do not extend Vehicle for every motor type if the motor is injected.
Example. Electric versus petrol is not ElectricCar extends Car and PetrolCar extends Car if the only difference is start behavior. Inject Engine: a Car has an Engine. A later hybrid is another Engine implementation. The Car class does not grow a subclass per motor.
interface Engine { void start(); }
final class ElectricMotor implements Engine {
public void start() { /* draw from battery */ }
}
final class PetrolMotor implements Engine {
public void start() { /* crank */ }
}
final class Car {
private final Engine engine; // has-a, injected
Car(Engine engine) { this.engine = engine; }
void start() { engine.start(); }
}
// wrong: class ElectricCar extends Car { /* a subclass per motor type */ }
If they probe: If they asked inheritance on the file library, Composite is the yes. Filters stay composed. Logger: inject LogSink, never FileLogger extends ConsoleLogger.
LogSink s = new FileSink(); s.write(line); — call resolved on the object.log(String) vs log(Level, String) — resolved on the *reference type* + argument list at compile time.
void pulse(ColorSink sink, Effect e) { e.apply(sink); } // runtime
Runtime polymorphism is overriding through a superclass or interface. The call LogSink s = new FileSink(); s.write(line); is resolved on the object at runtime. Compile-time polymorphism is overloading: log(String) versus log(Level, String) is chosen from the reference type and the argument list when the compiler runs. Subtype polymorphism is what Liskov and Strategy use. Do not say “polymorphism means many classes” without a call site. The LED pulse helper is the spoken example: e.apply(sink) does not know whether the effect is solid or fade. Argus’s 20-camera loop is the same idea: each FrameSource is a subtype, one loop. Overloading is useful for convenience methods on Logger; it is not the SOLID letter they are grading.
Example. void pulse(ColorSink sink, Effect e) { e.apply(sink); } is runtime. Adding log(String) that delegates to log(20, m) is compile-time overloading.
If they probe: Ask them to name the call site. If they confuse overload with override, use the equals(Student) trap: that overloads equals(Object) and HashMap will not call it.
| Overload | Override | |
|---|---|---|
| When | Same class (or subclass) same name, different params | Subclass same signature as parent/interface |
| Binding | Compile time | Runtime (virtual) |
| Return type | Can differ (not by return alone) | Same or covariant |
static / private | Can hide / not applicable | Not overridden (static hides) |
| Annotation | none required | @Override — use it |
log(Object) vs log(String) — null picks the more specific. Say it if they write two overloads.equals(Student) does not override equals(Object) — it overloads. HashMap will not call it. (Next Q.)
class Logger {
void log(String m) { log(20, m); } // overload
void log(int level, String m) { /* ... */ }
}
class FileSink implements LogSink {
@Override public void write(String line) { /* file */ } // override
}
Overloading is the same method name with a different parameter list in the same class or a subclass. Binding is compile-time. Return type may differ but cannot overload by return type alone. Overriding is the same signature in a subclass or interface implementation. Binding is runtime. Return type is the same or covariant. Static and private methods are not overridden; static hides. Use @Override so a signature mismatch fails to compile. The overload trap: log(Object) versus log(String) and a null argument picks the more specific String overload. The override trap: equals(Student) does not override equals(Object); it overloads. HashMap stores and looks up through equals(Object), so your typed equals never runs and two equal students miss each other in the map. FileSink.write is a true override of LogSink.write.
Example. Logger.log(String) delegates to Logger.log(int, String): overload. FileSink.write with @Override: override. Never write equals(Student) without equals(Object).
If they probe: Walk a null overload. Walk HashMap get after a broken equals(Student). Ask covariant returns only if they go there.
x.equals(null)==false.Objects.equals / Objects.hash.rollNo as Integer key is safer than Student as key unless equals is roll-only and roll is final.== vs equals: reference vs value. String intern is not a strategy.
final class Roll {
final int n;
Roll(int n) { this.n = n; }
@Override public boolean equals(Object o) {
return (o instanceof Roll) && ((Roll) o).n == n;
}
@Override public int hashCode() { return Integer.hashCode(n); }
}
Equals must be reflexive, symmetric, transitive, and consistent, and x.equals(null) is false. Equal objects must have equal hash codes. Unequal objects may share a hash; that is a collision, not a bug. Always override both methods and include the same fields. Use Objects.equals and Objects.hash, and do not use a field you will mutate while the object is a map key. Roll number as an Integer key is safer than Student as a key unless equals is roll-only and roll is final. == is reference identity; equals is value; String intern is not a strategy. HashMap first finds a bucket from the hash, then equals: if equals is wrong, get misses, and if hashCode is wrong after a mutation, get looks in the wrong bucket. This contract was IE-asked on LC 6653463 and 6570344 as HashMap internals, and it is Standard CS here. Job 10454435 does not name this question publicly.
Example. Two Roll(5) instances: equals true, same hashCode, map.get works. A Student key whose marks participate in hashCode, then marks change, is a lost entry. Prefer Map<Integer, Student>.
final class Roll {
final int n;
Roll(int n) { this.n = n; }
@Override public boolean equals(Object o) {
return (o instanceof Roll) && ((Roll) o).n == n;
}
@Override public int hashCode() { return Integer.hashCode(n); }
}
If they probe: Dry-run put then mutate. Ask why HashSet needs the same pair. Mention treeify only if they still want internals.
final class (no subclass mutating), final fields, no setters, defensive copy of arrays/lists (List.copyOf).LogRecord).String is immutable — concat in a loop is O(n²); use StringBuilder.LogRecord / LED SolidEffect RGB tuple: immutable. Roster Student.marks is mutable on purpose (updates) — then rank is derived, not a key.record is a one-liner immutable; Live Code may be older — final class + constructor is enough.An immutable type is a final class, final fields, no setters, and a defensive copy of any array or list you accept, for example List.copyOf. Benefits: safe as HashMap keys, and safe to share across threads without a lock, which is why a logger LogRecord should be immutable. String is already immutable; concatenating in a loop is quadratic, so use StringBuilder. SolidEffect’s RGB triple is immutable. Roster Student.marks is mutable on purpose because scores update; rank is derived and must not be a map key. Java 16 record is a one-liner; Live Code may be older, so final class plus constructor is enough. Do not mutate a key after insert. Do not expose a live list from a constructor without copying it.
Example. LogRecord stores ts and message, both final. A caller cannot change the record after the sink queue accepts it, so the worker thread prints what was enqueued.
If they probe: If they hand you a mutable Student as a HashMap key, refuse and key by rollNo. If they ask records, say yes if the editor is new enough.
ClassRoster ranks; Student holds fields; FileSink writes bytes.HttpSink implements LogSink — Logger unchanged. LED: new FadeEffect. Closed to *edit*, open to *extend*.ColorSink impls must honor setRgb (no “USB LED that throws on blue”). No square-extends-rectangle.LogSink.write ≠ LogFormatter.format. Do not put rotateLogs() on every sink.Logger depends on LogSink abstraction; factory/main wires new FileSink(path).if (role==2) copied into every query. Argus: swap detector (O) without rewriting the 20-camera loop.S, Single responsibility: ClassRoster ranks students; Student holds fields; FileSink writes bytes. One reason to change per type. O, Open/closed: add SocketSink or HttpSink implements LogSink and Logger does not change; add FadeEffect and Led does not change. Closed to edit, open to extension via new types. L, Liskov substitution: any ColorSink must honor setRgb, including blue; a USB LED that throws on blue is not a ColorSink. Square extends Rectangle that lets width and height diverge independently fails Liskov. I, Interface segregation: LogSink.write is not LogFormatter.format, and rotateLogs does not belong on every sink. Clients must not depend on methods they do not use. D, Dependency inversion: high-level Logger depends on the LogSink abstraction; main or a factory wires new FileSink(path). Ylogx RLS is a policy module the RAG bot depends on, not if (role==2) copied into every query. Argus swaps a detector without rewriting the 20-camera loop. Recite the letters on the design you just drew, not as a memorized poster.
Example. Logger + SocketSink is O and D. Ranker interface for dense versus competition is O and S. ColorSink that throws on blue is an L failure. close() on LogSink is an I failure. new FileWriter inside Logger is a D failure.
If they probe: Ask them to point at a class on the board and name the letter. If they skip I, split write from format. If they skip D, show the constructor injection.
final, static — Standard CSprivate fields; package default rare in interviews; protected for intended subclass hook; public API.final field = assigned once; final method = no override; final class = no extend (good for Student / Logger unless they asked inheritance).static belongs to the type (clamp, LoggerFactory.consoleInfo). Not polymorphic.Fields default to private. Package-private is rare in interviews. Protected is for an intended subclass hook, which you should need seldom if you prefer composition. Public is the API. A final field is assigned once. A final method cannot be overridden. A final class cannot be extended, which is right for Student and Logger unless they asked for inheritance. Static belongs to the type: Led.clamp, LoggerFactory.consoleInfo. Static is not polymorphic; you cannot override a static method, you can only hide it. In Live Code, keep fields private, inject collaborators, and mark data objects final when they should not grow subclasses. Protected tick() on an abstract LED is the opposite of the composition story unless they insisted on a template method.
Example. Logger’s sink is private final, assigned in the constructor. clamp is static on Led because it has no instance state. Do not make log() static if you want to inject a sink in tests.
If they probe: If they ask getter/setter for every field, push back: rank is derived, rollNo has no setter.
default methods with the same signature → class must override (or pick I.super.m()).Java allows one class parent and many interfaces. Two interfaces with the same default method force the class to override or to pick I.super.m(). That is the diamond: which default wins. Classes cannot extend two abstract parents, so you never merge two fields with the same name from two class bases. State lives in the concrete class, which is composition. Prefer two small interfaces over an abstract mega-parent. Default methods are mixins with care; if both defaults have behavior you need, write the override explicitly. This is why LogSink and Closeable can both sit on FileSink, while ConsoleSink implements only LogSink. C++ multiple inheritance of classes is not Java; do not describe vtable diamonds unless they ask C++.
Example. interface Timestamped { default String stamp(String s) { return s; } } plus LogSink on one class: no diamond. Two defaults named write: the class must override write and may call A.super.write.
If they probe: If they ask why not two abstract classes: state clash and one-parent rule. Composition holds the two behaviors as fields.
Comparable vs Comparator (rank / sort) — Standard CSComparable = natural order on the type (Student by roll). Comparator = external policy (by marks, then name).Comparator (or Ranker) so you can swap dense vs competition without changing Student (O, S).Comparable is the type’s natural order: Student by roll, if anything. Comparator is an external policy: by marks descending, then name. Ranking belongs on a Comparator or a Ranker so you can swap dense versus competition without changing Student. That is Open/Closed and Single Responsibility. Arrays.sort and List.sort take a Comparator. A PriorityQueue’s ordering is a Comparator too. Do not implement Comparable by marks if marks change; the contract of Comparable is broken if compareTo disagrees with equals, and TreeSet will misbehave. HashMap does not use Comparable. TreeMap does. For the roster, HashMap by roll plus a sort with a Comparator is the Live Code path.
Example. all.sort(Comparator.comparingInt((Student s) -> s.marks).reversed().thenComparing(s -> s.name)); Student stays a data object. A CompetitionRanker uses the same sort then a different rank write.
If they probe: If they want Student implements Comparable, make it roll-only and keep marks ranking as a Comparator.
Language: Java. Sketches are Live-Code size, not Answer-BIBLE dumps.
See IE-asked logger sketch. Add only if they push: List<LogSink> loop (Composite) + synchronized or a queue.
See IE-asked student sketch. Probe: competition rank — skip increment on tie, next rank = index+1 or previous+1 depending on spec.
See IE-asked LED sketch. Combination as bitmask if they want 7 modes: if ((mask & 1) != 0) r = 255; still one Led, not 7 subclasses.
Roll sketch above. Dry-run: two new Roll(5) — equals true, same bucket, map.get works. Mutate a field used in hash after put — get misses.
interface Detector { List<Box> detect(Frame f); }
final class YoloDetector implements Detector {
public List<Box> detect(Frame f) { /* weights */ return List.of(); }
}
final class Pipeline {
private final Detector detector; // DIP
Pipeline(Detector detector) { this.detector = detector; }
void onFrame(Frame f) { detector.detect(f); }
}
Resume-derived Argus analogue — do not claim this Java ran at 24 FPS.
// wrong for logger
class FileLogger extends ConsoleLogger { /* copies console then adds file */ }
// right
final class Logger {
private final LogSink sink; // injected
Logger(LogSink sink) { this.sink = sink; }
}
final class LogRecord {
final long ts;
final String message;
LogRecord(long ts, String message) {
this.ts = ts;
this.message = message; // String already immutable
}
}
Use when they ask “give a real example of SOLID / composition,” not as fake Amazon LLD you shipped in Java.
| Story | OOP point | Resume numbers only |
|---|---|---|
| Ylogx BI + SQL RAG | Policy (RLS/RBAC) composed with app; not User extends Admin | 3 tiers; 40% faster reports; 99.9% uptime; RAG productivity +65%; bot latency −35%; 30 dashboards; sub-210 ms; CloudFront/ECS/Docker |
| IQVIA research agents | ResearchTool interface, ranker separate | 200+ sites; 200+ page BRDs; Hybrid + Semantic Azure Search; GraphDB; LangSmith |
| Argus | Detector / AlertSink / store; 20+ sources same loop | 73→89% mAP; 15k+ images; 24 FPS; 20+ cameras; violations −50%; compliance 2× |
| StratifyLabs | Model vs runtime vs marketplace | iteration −30%; 50+ models |
| GiftedBooks | RAG vs VR UI composed | sub-300 ms; 99.5% uptime; reading +35%; engagement +50%; 2.5×; doubts 3–10 min |
| Horizon | ROS2 nodes composed | 17th / 80+; 60 FPS; 2M+ pts/sec; collision −55% |
| Education / leadership | no fake org-chart inheritance | CUSAT CSE 8.42; IEDC tech team; 8 hackathons (1st CodeRecet, MLH Best Project, Magnathon runner-up) |
Java vs production: skills include Java; shipped stack was Python/TS/ROS2. InstaRecon if they scroll GitHub: ethics one-liner (security-awareness demo, consent, no production attacks) then move to Ylogx / IQVIA / Argus / Stratify. No phishing / credential / exploit steps.
Do not present as on-resume STAR. Confirm with Adarsh before using.
new_login / get_oldest_login): unverified in the research bible; mentor-only. Not first-hand R2 evidence. Not a Job 10454435 question.RateLimiter interface + token-bucket impl (Strategy) — still not your default 18 Aug format.| Q | Label | Evidence |
|---|---|---|
| Logger SOLID | IE-asked | Reddit 1ueybmg, AUTA same-day R2 |
| Student HashMap OOD | IE-asked | LC 6653463 UTA R1 |
| HashMap internals / equals+hashCode | IE-asked | LC 6653463; LC 6570344 §5.F |
| LED RGB OOPS | IE-asked | GFG sde-1-16, OA-as-R1 → our R1 analogue, older remainder |
| File library inheritance | IE-asked | Pratyush §5.C, not UTA |
| Alexa battery SOLID | IE-asked | GFG sde-1-29 BR, year-out |
| Office structure OOD | IE-asked | GFG off-campus-8 |
| Ylogx/Argus/Stratify/IQVIA/GiftedBooks/Horizon type models | Resume-derived | Aug 2026 resume |
| class/interface/abstract, inheritance vs composition, poly, overload vs override, immutability, SOLID letters, modifiers, diamond, Comparable | Standard CS | CS inventory for the OOP chapter, not named as 10454435 asks |
Adarsh Vishwakarma, SDE I AUTA APJ, Job 10454435, Java Live Code. R2 lock: 18 Aug 2026. Still no public IE names 10454435 for a live-round design — do not treat CampusToCareer “Tech 2 = APIs / databases / caching layers” as an asked prompt. Login Tracker is unverified. Rate Limiter independent SDE I live-round count = 1, and that one is OA+3 Second Technical SD, not UTA two-DSA.
How to use: each IE card is a 40-min Live Code shape (one-paragraph ask + classes + DS + follow-ups). Full Java lives in Answer-BIBLE.md §3. Do not paste a novel of empty classes; compile dropOff / get / allowRequest first.
Other §5.C rows not expanded here (notification-like, music Song/Artist/Album, flexible playlist, prefix top-K on 6282609, Spring login HM, Alexa battery year-out, LED/office GFG): see Answer-BIBLE §3 if they name them. Canada cart, intern eviction DS, 5-round board-game: NMF/INTERN.
Every item below is first-hand in Question-Research-BIBLE.md §5.C. Unnamed stays unnamed. No fake LC ids. LC 6369243 is not 962/210.
Label: IE-asked · not UTA/AUTA · two IEs, two slots, same family
Prince (Job 3057703, OA+2+BR): design a Locker Management System for Warehouse Packages as R1 after an LC-424-like DSA. Uday Singh (OA+3, ~Aug 2025): Amazon Locker System as the second live — candidate expected DSA, got SD; follow-ups UX + scalability. Not two products. Not evidence 10454435 asked lockers.
LockerSize enum; Package; Locker (occupy/release + access code); LockerAssignmentStrategy + SmallestFitStrategy; LockerSite.HashMap lockerId → Locker, packageId → lockerId; EnumMap<LockerSize, Deque<Locker>> free lists. Smallest-fit deque head is O(1) Live Code; strategy scan is fine for a small site.synchronized in-memory; prod unique constraint / SET NX. Failed pickup TTL → FC. UX: SMS/map/code; oversized → associate. Do not open with “add a cache layer.”Prince’s warehouse locker management and Uday’s Amazon Locker are the same family, two IEs, two slots, not two products, and not evidence Job 10454435 asked lockers. Clarify pickup versus drop-off, hub versus warehouse cubby, sizes S/M/L, one package per cubby, assign versus customer-choose, code expiry, single versus multi-site, and concurrency. Types are LockerSize, Package, Locker with occupy/release and an access code, LockerAssignmentStrategy with SmallestFitStrategy, and LockerSite. Data is HashMap lockerId to Locker, packageId to lockerId, and an EnumMap of size to a Deque of free lockers; smallest-fit pops the head of the smallest deque that fits in O(1). Open/closed: a new ClosestToEntranceStrategy implements the strategy without editing LockerSite, and a wrong assignment is a leak — Ylogx 3-tier RLS is the same instinct, not a claim you shipped lockers. Uday scale is site-shard plus a conditional write so two couriers cannot win one cubby; cache free-counts, not truth, and use synchronized in memory or a unique constraint in production. Compile dropOff first: pick a free locker, occupy, mint a six-character code, map package to locker. Do not open with a cache layer; full Java lives in Answer-BIBLE §3.
Example. A medium parcel: skip empty S deque, pop M, occupy, return code. A later large-only strategy still calls occupy on a Locker; Site does not change.
Locker dropOff(Package p) {
LockerSize min = LockerSize.minFit(p);
Locker chosen = strategy.pick(freeLists, min); // SmallestFit
if (chosen == null) return null;
String code = Code.sixChar();
chosen.occupy(p.id, code);
packageToLocker.put(p.id, chosen.id);
return chosen;
}
If they probe: Two threads dropOff the last medium: one lock or a DB unique occupy. Multi-site: shard by siteId, not a global Redis of all cubbies as a first sentence.
Label: IE-asked · UTA named · mapped R3 (not the 18 Aug second live by default)
Shiwangi Medium: R1 Currency Converter graph; R2 easy hashmap UNNAMED; R3 bookstore word-count OOD; comment: no LP each round. Ask: count of a particular word in a specific book — classes / objects / methods.
Book (isbn, title, freq); Bookstore (isbn → Book); optional WordSplitter later.HashMap<String,Integer>. Query O(1), build O(tokens). Inverted word → Map<isbn,count> only if they ask “which books contain X.”Shiwangi’s UTA R3 asked for the count of a particular word in a specific book, as classes, objects, and methods. It is mapped R3, not the 18 Aug second live by default. Clarify one book versus a catalog, case-fold and punctuation, query-time scan versus precomputed frequency, title versus body, and concurrent new editions. A Book holds isbn, title, and a HashMap of word to count. A Bookstore holds isbn to Book. Query is O(1) after an O(tokens) build. An inverted index word to map of isbn to count is only if they ask which books contain X. Phrase count needs token arrays, not only frequencies. GiftedBooks PDF Q&A is RAG retrieval, not this HashMap; say the difference if they analogize. Scale for Live Code is one map per book. Optional WordSplitter later is Open/Closed: new tokenizer without editing Bookstore.
Example. Index “The cat sat on the mat”: the → 2, cat → 1, sat → 1, on → 1, mat → 1 after lowercasing. bookstore.count(isbn, "the") returns 2. Adding a second book is another HashMap, same Bookstore.get(isbn).
final class Book {
final String isbn;
final Map<String, Integer> freq = new HashMap<>();
void index(String text) {
for (String w : text.toLowerCase().split("\\W+")) {
if (w.isEmpty()) continue;
freq.merge(w, 1, Integer::sum);
}
}
int count(String word) { return freq.getOrDefault(word.toLowerCase(), 0); }
}
final class Bookstore {
private final Map<String, Book> byIsbn = new HashMap<>();
int count(String isbn, String word) {
Book b = byIsbn.get(isbn);
return b == null ? 0 : b.count(word);
}
}
If they probe: Which books contain “cat”? Build inverted Map<String, Map<String,Integer>> only then. Phrase “the cat”: store tokens, not freq alone.
Label: IE-asked · AUTA · R1+R2 same day Bangalore · reprint amazonsdeprep 1ueybwz
Design a logger judged on SOLID and patterns. R1 greedy/tree/puzzle UNNAMED is not this card.
LogLevel; LogRecord; LogSink / LogAppender; ConsoleSink / FileSink; LogFormatter; Logger; LoggerFactory; optional CompositeAppender.BlockingQueue<LogRecord> + worker (Producer-Consumer). No fancy index.HttpAppender without editing Logger. DIP = depend on LogSink, not FileWriter. File rotation = new class. Disk full: do not crash the request path. Avoid Logger.getInstance() mutable global.Same AUTA same-day R2 logger as the R02 card, judged on SOLID and patterns; R1 greedy, tree, and puzzle are UNNAMED and are not this card. Clarify levels, min-level, sinks, format, sync versus async, and DI rather than a mutable Singleton. Types are LogLevel, LogRecord, LogSink implementations, LogFormatter, Logger, and an optional CompositeAppender over a list of sinks. Open/closed is a new HttpAppender without editing Logger; dependency inversion is depending on LogSink, not FileWriter. Async is a BlockingQueue plus a worker; file rotation is a new class; disk full must not crash the request path. Argus PostgreSQL logging of PPE events is a sink analogue, and Ylogx dashboards are not a logger LLD. Recite S format versus write versus filter, O new sink, L any sink, I write not rotate, D inject the sink.
Example. LoggerFactory.fileAndConsole(INFO) returns a Logger whose CompositeSink holds FileSink and ConsoleSink. Adding SocketSink is a new class plus one factory line, not an edit to log().
If they probe: Decorator for JSON or async around an existing sink. If they insist on Singleton, one instance from the factory, still injectable for tests. Full Java: Answer-BIBLE §3.
Label: IE-asked · Hyd onsite · not Login Tracker · Spring login layers = Bhavya HM, different card
Interview 2: LP + LRU Cache + unnamed design-principles talk. Mentor new_login / get_oldest_login is unverified — do not treat it as this ask.
get miss −1; get counts as use; int vs generic; thread-safe / TTL only if they add it.LRUNode (key, value, prev, next); LRUCache (get/put). Do not extract EvictionPolicy unless they pivot — that is the LFU+extensible IE.HashMap<key, node> + dummy-headed doubly linked list. get/put O(1). Mention LinkedHashMap(accessOrder) then write pointers. Refuse TreeMap by timestamp.put(1) put(2) get(1) put(3) → key 2 gone. Thread-safety: one lock. TTL: expireAt lazy delete. Redis LRU is SD, not this card.Bhavya Interview 2 was LP plus LRU Cache plus unnamed design-principles talk, not Login Tracker: mentor new_login / get_oldest_login is unverified, and Spring login layers were a different hiring-manager card. Clarify capacity, get miss −1, get counts as use, and thread-safety or TTL only if they add it. Types are LRUNode and LRUCache with get and put; do not extract EvictionPolicy unless they pivot to the LFU-plus-extensible IE. Data is HashMap from key to node plus a dummy-headed doubly linked list so get and put are O(1): mention LinkedHashMap accessOrder, then write the pointers, and refuse TreeMap by timestamp. Dry-run capacity 2: put 1, put 2, get 1, put 3, and key 2 is gone. Ylogx Redis that cut bot DB latency 35% is cache-as-infra, not “I implemented LRU in Java at work.”
Example. Dummy head is most recent, dummy tail is least recent. get unlinks the node and splices it after head. put of a new key splices after head; if size exceeds capacity, drop tail.prev and remove it from the map.
int get(int key) {
LRUNode n = map.get(key);
if (n == null) return -1;
unlink(n);
insertAfterHead(n);
return n.value;
}
void put(int key, int value) {
LRUNode n = map.get(key);
if (n != null) { n.value = value; unlink(n); insertAfterHead(n); return; }
n = new LRUNode(key, value);
map.put(key, n);
insertAfterHead(n);
if (map.size() > cap) {
LRUNode lru = tail.prev;
unlink(lru);
map.remove(lru.key);
}
}
If they probe: Thread-safety: one lock on the cache. TTL: expireAt and lazy delete on get. Redis LRU is system design, not this card. Do not merge with LFU extensible.
Label: IE-asked · 2 live · reprints GFG Set 186/322 · DevBrainiac Parking Lot = their R3 NMF, not a second UTA ask
Parking Lot OOD after Burning Tree + Merge Intervals. Behavioral 2–3 UNNAMED.
SpotType / VehicleType; Vehicle; ParkingSpot; Ticket; PricingPolicy + HourlyPricing; ParkingLot (enter/exit).Deque per SpotType; openTickets HashMap. First-fit assign.Floor free maps + nearest floor with a fit. Full lot: null / wait queue. Taanya (OA+2+BR+HM): R2 “LLD similar to parking lot” + intervals/stream — same entities plus sweep-line / min-platforms on [in,out). Not a second independent Parking Lot count.Parking Lot OOD after Burning Tree and Merge Intervals on a GFG fresher loop. DevBrainiac’s parking lot as their R3 is NMF, not a second UTA ask. Clarify bike, car, bus versus spot types, whether a car may take a large spot, multi-floor and multi-gate, hourly versus flat, ticket in and pay out. EV and reserved only if they add it. Types: SpotType, VehicleType, Vehicle, ParkingSpot, Ticket, PricingPolicy with HourlyPricing, ParkingLot with enter and exit. Data: a free Deque per SpotType and openTickets as a HashMap. First-fit assign: bike deque, else car, else large, according to the rule you confirmed. Open/closed: a new WeekendPricing implements PricingPolicy without editing ParkingLot. Full lot returns null or a wait queue. Multi-floor is a Floor with its own free maps plus nearest floor with a fit. Taanya’s R2 “LLD similar to parking lot” plus intervals is the same entities plus a sweep on [in, out); that is not a second independent parking-lot count. No resume parking product; do not invent a lot at Ylogx.
Example. Car enters: pop a CAR spot, mint Ticket(id, inTime, spotId), store in openTickets. Exit: lookup ticket, compute HourlyPricing.charge, free the spot back onto the deque. A bus that may only take LARGE skips the car deque.
Ticket enter(Vehicle v) {
SpotType need = v.type.minSpot();
ParkingSpot s = firstFit(need); // walk deques from need upward
if (s == null) return null;
s.occupy(v.id);
Ticket t = new Ticket(ids.next(), now(), s.id, v.id);
openTickets.put(t.id, t);
return t;
}
int exit(String ticketId) {
Ticket t = openTickets.remove(ticketId);
ParkingSpot s = spots.get(t.spotId);
s.release();
freeLists.get(s.type).addLast(s);
return pricing.charge(t.inTime, now());
}
If they probe: Nearest floor: scan floors for a non-empty fit deque. Concurrent gates: one lock on the lot, or shard by floor. Do not start with EV chargers.
Label: IE-asked · OA+2 · Tech 2 = elevator LLD + DoS/cyber + project walkthrough
One (or N) elevator controller. They did ask a cyber follow-up. That DoS rate-cap is not the Rate Limiter SD card (count stays 1).
Direction; Request; DispatchPolicy + NearestCarPolicy; ElevatorCar; ElevatorController (hallCall / cabinSelect / tick).TreeSets of pending floors (SCAN). Dispatch: nearest car for Live Code; say real elevator scheduling is hard.One or N elevator cars, hall call up or down, cabin buttons, and a cyber follow-up on hall-call flood. That DoS rate-cap is not the Rate Limiter system-design card; independent SDE I live-round Rate Limiter count stays 1. Clarify one shaft versus N cars, SCAN or LOOK versus nearest-car, capacity, event loop versus thread per car. Types: Direction, Request, DispatchPolicy with NearestCarPolicy, ElevatorCar, ElevatorController with hallCall, cabinSelect, and tick. Data: per car two TreeSets of pending floors for SCAN, one above and one below. Dispatch for Live Code is nearest car; say real elevator scheduling is hard. Open/closed: a new LoadBalancedPolicy implements DispatchPolicy without editing the controller. DoS: unauthenticated hall-call flood makes cars thrash. Mitigate with a per-kiosk or IP fixed window, auth on the cabin panel, ignore duplicate floor, circuit-break a kiosk, and do not accept calls faster than physics. Failure: drop a stuck car from dispatch. Scale: one controller per building, not Kafka. Argus 20+ cameras and alerts is a flood-of-events talk, not an elevator you shipped.
Example. Car at 5 going up, hall call 8 up: add 8 to the up set. tick moves 5 to 6 to 7 to 8, opens, then continues to the next up floor. A flood of hallCall(1) from one kiosk is ignored after N per window.
void hallCall(int floor, Direction d, String kioskId) {
if (!kioskLimiter.allow(kioskId)) return; // DoS: closed
ElevatorCar car = dispatch.pick(cars, floor, d);
car.addHall(floor, d);
}
void tick(ElevatorCar car) {
Integer next = car.nextOnScan(); // TreeSet ceiling / floor
if (next == null) { car.idle(); return; }
car.moveToward(next);
}
If they probe: N cars: nearest idle or nearest in the right direction. Do not implement Kafka. The limiter here is a kiosk cap, not the distributed Rate Limiter LLD.
find / Java file search by constraints — Vanshika + Raghav (+ Pratyush cousin)Label: IE-asked · find family · US 3×60 Levels.fyi oP6vow = NMF extra evidence, not a second India UTA ask
Vanshika (OA+3, Sep 2025, 3rd live / second coding): Unix find-like search a file; 3–4 follow-ups; two LP UNNAMED; not UTA-default two-DSA. Raghav (OA+DSA+design+HM): Java library on Linux to search files by constraints (high-level). Pratyush Hyd onsite R2: file library recursive traversal, filter, inheritance — in-memory Composite cousin, same Specification pattern.
java.nio.file) vs in-memory tree; name glob / type / min size / mtime / empty; AND vs OR; follow symlinks; permission errors; return List<Path> vs print.PathPredicate; NameGlob; TypeFile; MinSize; AndPred; FileFinder (Files.walkFileTree); façade LinuxFileSearch.FileComponent; FileLeaf / Directory (Composite); FileFilter + AndFilter; FileVisitor / CollectingVisitor; FileLibrary.search.lastModifiedTime; do not claim Vanshika listed size/name/type/date/empty unless they did (those names are the US NMF post). Inheritance: they asked it — Composite for files; composition for filters.Vanshika asked a Unix find-like search with follow-ups. Raghav asked a Java library on Linux to search files by constraints. Pratyush asked an in-memory file library with recursive walk, filter, and inheritance. That is one family, not three UTA defaults. The US 3×60 Find post is NMF extra evidence, not a second India UTA ask. Clarify real filesystem versus in-memory tree, name glob, type, min size, mtime, empty, AND versus OR, symlinks, permission errors, and List versus print. POSIX shape: PathPredicate, NameGlob, TypeFile, MinSize, AndPred, FileFinder using Files.walkFileTree, facade LinuxFileSearch. In-memory shape: FileComponent, FileLeaf, Directory (Composite inheritance they asked for), FileFilter plus AndFilter (composition), visitor, FileLibrary.search. Walk is DFS or BFS, with no Trie unless they index millions of names, a visited-dir identity set for cycles, and Open/Closed so a new predicate does not touch traversal. Inheritance is Composite for files; filters stay composed. Skills list Linux; Horizon and Argus walk directories of frames; you did not ship find(1).
Example. find . -name '*.log' -size +1M is AndPred(NameGlob, MinSize) over walkFileTree. A permission error skips that subtree and continues. Adding MinMtime implements PathPredicate; FileFinder is unchanged.
interface PathPredicate { boolean test(Path p, BasicFileAttributes a); }
final class AndPred implements PathPredicate {
private final List<PathPredicate> parts;
public boolean test(Path p, BasicFileAttributes a) {
for (PathPredicate x : parts) if (!x.test(p, a)) return false;
return true;
}
}
List<Path> find(Path root, PathPredicate pred) throws IOException {
List<Path> out = new ArrayList<>();
Files.walkFileTree(root, new SimpleFileVisitor<Path>() {
public FileVisitResult visitFile(Path f, BasicFileAttributes a) {
if (pred.test(f, a)) out.add(f);
return FileVisitResult.CONTINUE;
}
public FileVisitResult visitFileFailed(Path f, IOException e) {
return FileVisitResult.CONTINUE; // skip unreadable
}
});
return out;
}
If they probe: Empty file is size 0. Date is lastModifiedTime. Do not claim Vanshika listed size, name, type, date, and empty unless they did; those names are the US NMF post. OR is OrPred, same composition.
Label: IE-asked · same Prince loop as Locker R1 · not UTA/AUTA
Design a Spotify Playlist: insert / delete / search by name in O(1). Same Prince R2 as matrix max-path DSA. Related but different IEs: LC 6570344 music Song/Artist/Album; LC 6873106 flexible playlist; GetRandom O(1) (HashMap+ArrayList) — do not merge.
SongNode; Playlist (insert/delete/search). Keep streaming/bitrate out.HashMap<name, SongNode> + doubly linked list (LRU-shaped). Average O(1). Refuse BST unless they want ordered-by-name (that is O(log n)).name#id + secondary index. Next/prev = DLL walk. One lock on playlist if concurrent. Spotify-scale is not this question.Prince R2 asked a Spotify Playlist with insert, delete, and search by name in O(1). Same loop as his locker R1, not UTA. Related but different IEs: Song/Artist/Album, flexible playlist, GetRandom O(1). Do not merge them. Clarify unique names versus duplicates, insert at end versus at index (an array index insert cannot be O(1)), exact versus prefix, one playlist versus a library, play versus mutate. Types: SongNode and Playlist with insert, delete, search. Keep streaming and bitrate out. Data: HashMap from name to SongNode plus a doubly linked list, LRU-shaped, so splice is O(1) and search is containsKey on average; refuse a BST unless they want ordered-by-name, which is O(log n). Duplicates use name#id plus a secondary index; next and previous are DLL walks; one lock if concurrent. Spotify-scale is not this question, and there is no resume music product, so stay on the sketch.
Example. insert("Karma") appends a node and map.put. search("Karma") is map.get. delete("Karma") unlinks the node and map.remove. Order of play is the list; lookup is the map. Same skeleton as LRU without capacity eviction.
final class Playlist {
private final Map<String, SongNode> byName = new HashMap<>();
private final SongNode head = new SongNode(null), tail = new SongNode(null);
Playlist() { head.next = tail; tail.prev = head; }
void insert(String name) { // O(1) append
if (byName.containsKey(name)) throw new IllegalArgumentException();
SongNode n = new SongNode(name);
SongNode last = tail.prev;
last.next = n; n.prev = last; n.next = tail; tail.prev = n;
byName.put(name, n);
}
boolean search(String name) { return byName.containsKey(name); }
void delete(String name) { // O(1) splice
SongNode n = byName.remove(name);
if (n == null) return;
n.prev.next = n.next;
n.next.prev = n.prev;
}
}
If they probe: Insert at index i is O(n) on an array; if they demand O(1) by name only, append. Prefix search is a Trie, a different IE. Concurrent play plus mutate: one lock.
Label: IE-asked · AUTA · OA+3 same-day Pacific 31 Jul 2025 · location India not stated
R2 12:30: LP + LLD dog check-in/out tracking. Candidate said tracking, not a named Amazon Pets product — do not invent Amazon Pets. R1 long-string sum + k-page sequence is not this card.
dogId + timestamp; re-enter after checkout; queries: currently boarded / history / duration / owner’s dogs; double check-in without checkout = error; single-thread first.Dog; Stay (checkIn, checkOut nullable); Daycare (register / checkIn / checkOut / isBoarded). Capacity policy can extract later (OCP).Map<dogId, Stay> active; append-only List<Stay> history; Map<dogId, Dog> registry. State transitions, not a graph algorithm.synchronized / concurrent maps. Pattern: parking-lot tickets, not a strategy zoo. Do not design a dog social network.Nisarg AUTA R2 was LP plus LLD dog check-in and check-out tracking. The candidate said tracking, not a named Amazon Pets product; do not invent Amazon Pets. Location India was not stated. R1 long-string sum and k-page sequence is not this card. Clarify one facility and kennel capacity, dogId plus timestamp, re-enter after checkout, queries for currently boarded, history, duration, owner’s dogs, double check-in without checkout as error, single-thread first. Types: Dog, Stay with checkIn and nullable checkOut, Daycare with register, checkIn, checkOut, isBoarded. Capacity policy can extract later for Open/Closed. Data: Map of dogId to active Stay, append-only List of Stay for history, Map of dogId to Dog for the registry. This is state transitions, not a graph algorithm. Pattern: parking-lot tickets, not a strategy zoo. Argus attendance tracking is the honest analog, in and out of frame, not kennels. Do not design a dog social network.
Example. checkIn(42): if unknown, already active, or at capacity, throw; else active.put(42, new Stay(now)). checkOut(42): take the stay, set checkOut, append history, remove from active. isBoarded is containsKey.
If they probe: Waitlist if at capacity. Billing sums history durations. Threads: synchronized on Daycare. Extract CapacityPolicy if they ask OCP.
Label: IE-asked · OA numbered R1 · their R3 = our R2 · not UTA/AUTA
Design a Q&A platform similar to Stack Overflow — entities / models / DS. Not a full HLD of SO. Their R2 was story DSA → our R1.
User; Tag; Post; Question extends Post; Answer extends Post; VoteService; QaStore.questionIdsByTag inverted index. Full-text = “inverted index / ES later” in one sentence.acceptedAnswerId. One vote per user-post. Scale is not the 45-min entity sketch.Kamlesh asked a Q&A platform similar to Stack Overflow as entities, models, and data structures, not a full HLD of Stack Overflow. OA was numbered R1; their R3 maps to our R2; not UTA. Clarify question, answer, comment, vote, tag, accept, search by tag versus full-text, reputation, auth, in-memory Live Code. Types: User, Tag, Post, Question extends Post, Answer extends Post, VoteService, QaStore. This is an honest small inheritance tree: Question and Answer share author, body, votes. Data: HashMaps by id, inverted questionIdsByTag. Full-text is “inverted index or ES later” in one sentence. Accept is question author only, one acceptedAnswerId. One vote per user-post. Scale is not the 45-minute entity sketch. GiftedBooks PDF Q&A is RAG over a book, not SO voting; if they analogize, draw the entity difference: no accept, vote, or tag marketplace.
Example. postQuestion creates a Question, indexes tags. postAnswer links answerId onto the question. vote(user, post) records a key userId+postId so a second vote is rejected. accept(questionId, answerId) checks the asker.
If they probe: Comments can hang on Post. Reputation is a derived counter. Do not build Elasticsearch in the hour.
Label: IE-asked · consec-day 21–22 Nov 2024 · not Bhavya LRU · not Login Tracker
Implement LFU (candidate linked slug) then LLD: make that cache extensible. Consecutive-day, not named UTA.
CacheNode (key, value, freq); NodeList (dummy DLL); EvictionPolicy (onGet / onPutNew / evict); LfuPolicy; LruPolicy; ExtensibleCache.key → node; freq → DLL; minFreq. get/put O(1). Extensible = Strategy on eviction — that is the LLD half.Reddit 1idtlan R2: implement LFU, then LLD to make that cache extensible. Consecutive days in Nov 2024, not named UTA, not Bhavya’s LRU-only Interview 2, not Login Tracker. Clarify capacity, miss -1, tie-break LRU among the same frequency (LC 460-shaped), thread-safe or generic only if they add it. Types: CacheNode with key, value, freq; NodeList dummy DLL; EvictionPolicy with onGet, onPutNew, evict; LfuPolicy; LruPolicy; ExtensibleCache. Data: key to node, freq to DLL, minFreq. Get and put O(1). The LLD half is Strategy on eviction: ExtensibleCache depends on EvictionPolicy, so FIFO is a DLL without move-on-get, LRU is one list, LFU is freq lists, all without rewriting get and put. Ylogx Redis −35% is not LFU code you wrote. One lock on the cache. Do not merge this with Bhavya LRU.
Example. Get key 2: remove node from freq 1 list; if that list is empty and minFreq was 1, minFreq becomes 2; insert node at front of freq 2 list. Evict: drop minFreq list’s tail. Swap LruPolicy in the constructor and the facade is unchanged.
void bump(CacheNode n) { // LFU
NodeList old = freqLists.get(n.freq);
old.unlink(n);
if (old.isEmpty() && minFreq == n.freq) minFreq++;
n.freq++;
freqLists.computeIfAbsent(n.freq, f -> new NodeList()).insertFront(n);
}
CacheNode evict() {
NodeList list = freqLists.get(minFreq);
CacheNode victim = list.removeTail();
map.remove(victim.key);
return victim;
}
If they probe: FIFO policy: onGet is a no-op. Thread-safety: one lock wrapping policy calls. Do not extract policy on Bhavya LRU unless they pivot here.
Label: IE-asked · 2 onsite + BR · 2026
Searchable Collection LLD add/search; LP Ownership; adapting to new tech.
String; unique ids / duplicate values; n in-memory?; first hit vs all vs top-K.SearchableCollection<T> (add/search); HashSearchableCollection; TrieNode + TrieSearchableCollection.Aditya R2 2026: Searchable Collection LLD add and search, plus LP Ownership and adapting to new tech. Clarify exact versus prefix versus contains, typed payload versus String, unique ids, duplicate values, in-memory n, first hit versus all versus top-K. Types: SearchableCollection<T> with add and search, HashSearchableCollection, TrieNode plus TrieSearchableCollection. Exact is HashMap. Prefix is Trie plus DFS collect. Contains is a scan unless they ask a suffix structure. Top-K prefix is a different IE on LC 6282609; do not steal it. Open/closed: a new inverted-index implementation behind the same interface. Case-fold and Unicode normalize if they care. ConcurrentHashMap for exact; a Trie needs a lock. StratifyLabs 50+ models and GiftedBooks topic suggestions are “add then search”; Live Code is still HashMap or Trie, not FAISS unless they name vectors.
Example. add("yolov9", card). search("yolo") on a Trie walks y-o-l-o and DFS-collects yolov9 and yolov8. Exact search("yolov9") is HashMap get. A contains search without an index scans values.
If they probe: Do not pull SERP top-K from 6282609. New impl (inverted index) is OCP. Concurrent adds on a Trie: one lock.
Label: IE-asked · first-hand wording · not LC 210 · not LC 962
Delivery stations / parcels + classes + topological sort. Same post’s other slot: max-sum switching two sorted LLs (also not 962). LC 210 is linked on 6282609 only. Do not stamp Course Schedule II or Width Ramp on this IE.
Station; Parcel; DeliveryNetwork (addStation / addConstraint / processingOrder). Names from candidate wording, not a LeetCode slug.ArrayDeque. TC O(V+E). Brute DFS without cycle check hangs. Refuse “this is LC 210” — domain wrapper around topo, different IE.order.size() != stations.size(). Dry-run A→B, A→C, B→D, C→D. List classes on the board first, then the Kahn loop.LC 6369243 R2: delivery stations, parcels, classes, and topological sort. First-hand wording, not LC 210 and not LC 962. The same post’s other slot was max-sum switching two sorted linked lists, also not 962. LC 210 lives on 6282609 only. Do not stamp Course Schedule II or Width Ramp on this IE. Clarify station objects (id, parcels, downstream), whether prerequisites must finish first, cycle as error, how many classes they want (confirm; do not invent a 12-class diagram), parcel path versus a global station DAG. Types from candidate wording: Station, Parcel, DeliveryNetwork with addStation, addConstraint, processingOrder. Data: adjacency list, indegree, Kahn ArrayDeque, time O(V+E); brute DFS without a cycle check can hang. Refuse “this is LC 210”; it is a domain wrapper around topo, a different IE. Cycle if order.size() != stations.size(). Horizon costmap path planning is a graph, not this parcel DAG; do not claim you delivered Amazon stations.
Example. Constraints A→B, A→C, B→D, C→D. Kahn emits A, then B and C in queue order, then D. A cycle A→B→A yields a partial order and an error. List classes on the board first, then the Kahn loop.
List<Station> processingOrder() {
ArrayDeque<Station> q = new ArrayDeque<>();
for (Station s : stations.values()) if (s.indegree == 0) q.add(s);
List<Station> order = new ArrayList<>();
while (!q.isEmpty()) {
Station u = q.poll();
order.add(u);
for (Station v : u.out) if (--v.indegree == 0) q.add(v);
}
if (order.size() != stations.size()) throw new IllegalStateException("cycle");
return order;
}
If they probe: Confirm class count before drawing twelve boxes. Say station and parcel classes, not LC 210. Dry-run the diamond A→B, A→C, B→D, C→D.
Label: IE-asked · OA+3 SD · 13 Feb 2025 · not UTA two-DSA · independent SDE I live-round count = 1
Design a Rate Limiter; scale across distributed systems. First Tech 4 Feb was graph+tree+OS (same loop, not this card). SDE-2 Super Day / YouTube d0yM6h0XRxk / Hitesh L5 / mentor prep / Rudraksh practice do not make count 2. Elevator DoS rate-cap is not this card. Rudraksh BR “rate limiting decisions” / geofencing = story follow-ups, not this LLD.
RateLimiter.allowRequest(key); TokenBucketRateLimiter (Bucket tokens + lastNanos); SlidingWindowCounterRateLimiter; RateLimitFilter (gateway, not inside each use-case).HashMap<key, state> + lock. Distributed = Redis + atomic Lua so refill/decr cannot race. Say the table: fixed window (2× burst at boundary), sliding log (exact, O(n)/key), sliding counter (approx O(1)), token bucket (burst = capacity), leaky (smoothed). Write one fully (token bucket); sketch the other. Cloudflare/Kong default talk: sliding counter; bursty APIs: token bucket.TIME inside Lua. Hot key: mention shard, don’t novel. 429 + Retry-After, not silent drop.Independent SDE I live-round Rate Limiter count is 1: that one is OA+3 Second Technical on 13 Feb 2025, not UTA two-DSA, and YouTube, Super Day, mentor prep, elevator DoS, and Rudraksh BR stories do not make count 2. Clarify per user or IP or API key, N requests per W seconds, burst, 429 plus Retry-After, many app servers, and fail-open versus fail-closed if Redis dies. Types are RateLimiter.allowRequest, token-bucket state, an optional sliding-window impl, and a gateway filter rather than a check inside each use-case. A single box is a HashMap of key to bucket plus a lock; distributed is Redis plus atomic Lua so refill and decrement cannot race. Write token bucket fully and sketch one other: fixed window can double-burst at the boundary, sliding log is exact and O(n) per key, sliding counter is approximate O(1), token bucket bursts to capacity, and leaky is smoothed. Fail-closed for checkout, fail-open for a marketing pixel, return 429 and Retry-After, and use Redis TIME inside Lua. Ylogx ALB plus 99.9% is the right seat for a limiter; do not claim you shipped one. This is not the default 18 Aug UTA two-DSA format; Login Tracker is unverified; Job 10454435 does not name this prompt.
Example. Token bucket capacity 10, refill 5 per second. After 2 seconds idle, tokens are min(10, tokens + 10). allowRequest decrements if tokens >= 1, else deny. Two app servers must not each keep a local bucket; they share Redis.
boolean allowRequest(String key) {
Bucket b = buckets.computeIfAbsent(key, k -> new Bucket(capacity));
long now = System.nanoTime();
double refill = (now - b.lastNanos) / 1e9 * ratePerSec;
b.tokens = Math.min(capacity, b.tokens + refill);
b.lastNanos = now;
if (b.tokens >= 1) { b.tokens -= 1; return true; }
return false;
}
// Distributed: same math inside Redis Lua, one key per client, TIME from Redis.
If they probe: If Redis is down: payments fail-closed, a pixel fail-open. Do not count elevator DoS or YouTube videos as a second live-round Rate Limiter. Count stays 1, not UTA.
Label: IE-asked · AUTA · Tech 2 26 Aug 2024 (Tech 1 12 Aug) · rejected 27 Aug · prompt unnamed
15–20 min LP UNNAMED, then one unnamed System Design for the rest of the hour (unexpected for AUTA fresher). Not two-DSA. Do not invent the domain. CampusToCareer “APIs, databases, caching layers” for Job 10454435 is Class C invention, not this IE. Do not recite lockers / Rate Limiter / Redis as “what they asked.”
FooService / InMemoryFooService / Foo + id/state/updatedAt. Not a claimed Amazon locker design.ConcurrentHashMap until they push scale. Then partition the entity that grew, not a generic Redis slide.Arijit Char AUTA Tech 2 on 26 Aug 2024: 15–20 minutes LP UNNAMED, then one unnamed System Design for the rest of the hour, unexpected for an AUTA fresher, not two-DSA. The prompt is unnamed, so do not invent the domain. CampusToCareer “APIs, databases, caching layers” for Job 10454435 is Class C invention, not this IE. Do not recite lockers, Rate Limiter, or Redis as what they asked. Clarify is the card: core entity, actors, one happy-path verb, QPS and size and read versus write — ask, do not invent millions — single host versus services, APIs as proposals, wait for a nod, stale reads OK. Classes are placeholders only after they name the domain: FooService, InMemoryFooService, Foo with id, state, updatedAt. Not a claimed Amazon locker design. Data: in-process ConcurrentHashMap until they push scale, then partition the entity that grew, not a generic Redis slide. Forty-minute box: 0–5 restate scope, 5–12 entities and APIs they named, 12–25 one deep slice and an invariant, 25–35 what breaks at 10× if they asked, 35–40 failure and one metric. SOLID in one breath: store interface (D), new store without rewriting APIs (O), one class one reason (S). If they still will not name a domain, offer Ylogx report store or Argus event log as your example and wait. Do not dump caching as Job 10454435.
Example. They say “reports.” Draw Client → ReportService → ReportStore. Happy path getReport(id). Invariant: RLS tier is on every read. Scale later partitions by report id if they ask. You did not invent lockers.
If they probe: If they stay silent on domain, ask one more time, then offer Ylogx or Argus and wait. Do not fill the board with Redis because a blog said Tech 2 is caching.
Not in §5.C. Fair if they walk the Aug 2026 resume / GitHub. Metrics only from that PDF. Java in the editor; production was Python/TS — say that once.
Intern Nov 2024–Oct 2025. FastAPI + NestJS + Postgres. 40% faster reports, 99.9% uptime, 30 KPI dashboards, sub-210 ms, Redis −35% bot DB latency, RLS + RBAC 3 organizational tiers, chatbot +65% analysis productivity.
ReportDefinition; QueryService; RlsContext (tier); DashboardTile; CacheAside (Redis); chatbot as NlToSql behind the same RLS, not a second data path.WHERE tenant_id is one missed query from a leak → RLS in the DB. REST for BI (on resume); GraphQL/ProtoBuf only if they ask skills. Live Code: Java interfaces, not a NestJS dump.Ylogx intern Nov 2024–Oct 2025, FastAPI plus NestJS plus Postgres. Metrics only: 40% faster reports, 99.9% uptime, 30 KPI dashboards, sub-210 ms, Redis −35% bot DB latency, RLS plus RBAC three organizational tiers, chatbot +65% analysis productivity. Types: ReportDefinition, QueryService, RlsContext for the tier, DashboardTile, CacheAside for Redis, chatbot as NlToSql behind the same RLS, not a second data path. Data: Postgres rows plus a Redis key per user-tier and query-hash. A cached answer must still be tier-correct. The resume does not give a TTL; do not invent one. App-only WHERE tenant_id is one missed query from a leak, so RLS lives in the database. REST for BI is on the resume; GraphQL or ProtoBuf only if they ask skills. Live Code is Java interfaces, not a NestJS dump. Ownership and Dive Deep, not Amazon retail HLD. Production was not Java; say that once.
Example. QueryService.execute(identity, reportId) builds RlsContext from the three-tier role, checks AuthZ, then reads CacheAside keyed by (tier, queryHash), else QueryStore with RLS, then fills the cache. NlToSql uses the same execute path.
If they probe: Do not invent 403 SEO, tenant models, or TTLs. Redis and RLS are on-resume. Confirm GraphQL only as a skill, not as shipped BI.
VR labs + RAG assistant. Sub-300 ms, 99.5% uptime, hours → 3–10 min doubt time, +35% reading efficiency, +50% engagement, 2.5x comprehension.
Document; Chunk; TopicSuggestion; QaSession. Not Stack Overflow votes. Not Shiwangi per-book HashMap unless they want a toy indexer first.VR labs plus a RAG assistant. Resume only: sub-300 ms, 99.5% uptime, hours to 3–10 min doubt time, +35% reading efficiency, +50% engagement, 2.5× comprehension. Types: Document, Chunk, TopicSuggestion, QaSession. Not Stack Overflow votes. Not Shiwangi’s per-book HashMap unless they want a toy indexer first. Data: vector index (FAISS on skills) plus a metadata store. Live Code fallback: Searchable Collection Trie or HashMap for topic strings. Do not use the GiftedBooks GitHub README if it describes AegisAI; mismatch, resume only. Avatar UI is composed with RAG, not a subclass. Upload chunks a PDF; ask retrieves then answers. This is not a bookstore word-count product.
Example. upload(pdf) → Document plus Chunks. suggestTopics uses a Trie of headings. ask(session, question) embeds, retrieves chunks, Answerer writes a reply. VR client calls the same API.
If they probe: If they want word count, say that is a different UTA bookstore card. If README says AegisAI, ignore it.
YOLOv9 73% → 89% mAP, 15,000+ images, 24 FPS, 20+ cameras, violations −50%, compliance 2x, Postgres logging.
CameraFeed; DetectionEvent; AttendanceRecord; AlertSink (logger-shaped).YOLOv9 73% to 89% mAP, 15,000+ images, 24 FPS, 20+ cameras, violations −50%, compliance 2×, Postgres logging. Types: CameraFeed, DetectionEvent, AttendanceRecord, AlertSink shaped like a logger sink. Data: append-only event log, query by camera and time. Bounded in-memory queue if they ask backpressure; that is the elevator-DoS cousin, a flood of frames. No public stream URLs; auth on the dashboard. Skip RLS depth unless they ask; Ylogx owns that story. Detector versus alerter versus store is composition, covered in the R02 resume card; here the objects are the event and the attendance record. Do not claim the Java types ran at 24 FPS.
Example. onFrame(cameraId, frame) → detector.detect → DetectionEvent → AlertSink.write and EventStore.append. Attendance is enter/leave of a person id in frame, analogous to dog check-in without inventing kennels.
If they probe: Flood of 20×24 events: bounded queue, sample, or coalesce. Auth on dashboard. No public RTSP.
Browser CV lab. ML iteration −30%. Marketplace 50+ pre-trained models, datasets, profiles, WebGL URDF editor.
ModelCard; Dataset; UserProfile; SearchableCollection<ModelCard>.Browser CV lab. ML iteration −30%. Marketplace of 50+ pre-trained models, datasets, profiles, WebGL URDF editor. Types: ModelCard, Dataset, UserProfile, SearchableCollection of ModelCard. Data: exact id HashMap plus name prefix Trie, Aditya’s shape. Do not invent a training cluster you did not run. Do not pad from a default Next.js README. Adding a model is collection.add. Search is exact or prefix. Iteration is swap weights on a ModelCard, not a new subclass per architecture. Browser versus lab runtime stays a Strategy from the R02 card. Live Code is Java; production was TypeScript.
Example. add(new ModelCard("yolov9", metrics)). search("yolo") returns that card via Trie. A new dataset is another type in the same catalog, not Dataset extends Model.
If they probe: 50+ is small enough for HashMap. Vectors only if they name FAISS.
Apr 2026–present. LangGraph agents researching 200+ websites; Hybrid RAG on 200+ page BRDs (Azure AI Search + GraphDB); LangSmith evals.
ResearchTask; SourcePage; RankedSnippet; BrdDocument; RetrievalStrategy (vector / hybrid / graph).Apr 2026–present: LangGraph agents researching 200+ websites, Hybrid RAG on 200+ page BRDs with Azure AI Search and GraphDB, and LangSmith evals. Types are ResearchTask, SourcePage, RankedSnippet, BrdDocument, and RetrievalStrategy for vector, hybrid, or graph. Data is a stateful graph of agent nodes with traces as an append-only list. Whiteboard IQVIA, not SNS, and keep BRDs confidential: secrets in env, not in traces, and do not log full document text. Java Live Code is an interface Retriever; production was Python LangGraph, and the ranker is a separate object. This is resume-derived, not a §5.C Amazon LLD, so do not turn it into an Amazon retail design.
Example. ResearchTask runs tools, collects SourcePage, Ranker orders RankedSnippet. BrdDocument retrieval injects HybridStrategy. A new GraphStrategy implements RetrievalStrategy; the task loop does not change.
If they probe: Evals: traces, not full BRD dumps. Confidentiality first if they ask logging.
ERC 2024 17th / 80+. Camera 60 FPS GStreamer. ZED 2 2M+ pts/sec. Collision risk −55%.
Pose; Costmap; CameraPipeline. Graph for planning ≠ LC 6369243 parcel topo unless they explicitly connect them.Gstreamer-UDP repo supports the 60 FPS story; do not add unlisted sensors.ERC 2024 17th of 80+. Camera 60 FPS GStreamer. ZED 2 at 2M+ points per second. Collision risk −55%. Types: Pose, Costmap, CameraPipeline. Graph for planning is not LC 6369243 parcel topo unless they explicitly connect them. Off-resume confirm: Gstreamer-UDP repo supports the 60 FPS story; do not add unlisted sensors. ROS2 nodes are composition, as in the R02 card. Do not write Rover extends Camera. UDP versus TCP is one networking sentence if they ask. CUSAT 8.42 is not an object. Keep the sketch small if they stay on ERC; do not expand into Amazon lockers.
Example. CameraPipeline publishes frames. ZedMapper updates a point cloud. CostmapPlanner.read(pose) returns a path. A new planner implements Planner; the rover has-a planner.
If they probe: If they connect this to delivery stations, still do not stamp LC 210 or 962. If they leave ERC, stop adding rover types.
Asked as probes on top of LLD, or in CS-fund slots (bible §5.F is OS/DB-heavy; SOLID showed up on the logger IE).
DispatchPolicy / RateLimiter / EvictionPolicy substitutable.allowRequest, test, write) — no AmazonGodService.Point at the board. S: one reason to change, Locker versus Site versus Strategy, or Logger versus Sink versus Formatter. O: a new appender, pricing policy, or eviction policy without editing the facade. L: any DispatchPolicy, RateLimiter, or EvictionPolicy is substitutable; a policy that throws on a legal input is not. I: tiny interfaces, allowRequest, test, write; no AmazonGodService. D: depend on abstractions; logger DIP is the 1ueybmg point. Recite letters on the design you drew, not as a poster. Ylogx RLS as a module the bot depends on is D. Argus swapping a detector is O. Rate Limiter count remains 1 and is not UTA; if that design is not on the board, do not drag it in. Unnamed stays unnamed; do not recite lockers as Job 10454435.
Example. On a locker board: S is occupy on Locker not on Site, O is SmallestFit versus Closest, L is any AssignmentStrategy, I is pick() not also SMS, D is Site depends on the strategy interface.
If they probe: If they skip a letter, fill it from the sketch in front of you. If the sketch is unnamed SD, use store interface for D and new store for O.
Files.walkFileTree visit hooks.Logger, LinuxFileSearch, RateLimitFilter.Strategy is interchangeable algorithm: locker assignment, elevator dispatch, cache eviction, rate-limit math, log formatter. Template Method is a skeleton with hooks: Files.walkFileTree visit methods, or AbstractSink write then emit. Decorator wraps the same interface: timestamp or JSON or async around a sink; AndFilter wrapping filters. Composite is tree of the same type: directory tree, fan-out appenders. Facade is a simple front: Logger, LinuxFileSearch, RateLimitFilter. Observer is publish-subscribe: optional on Stack Overflow votes or Argus alerts; do not force it on locker occupy. Name the pattern that is already on the board. Do not dump a catalogue. Logger interview wants Strategy plus Composite plus optional Decorator. File library wants Composite plus Specification-style filters. Extensible cache wants Strategy.
Example. CompositeSink holds List<LogSink> and write loops. TimestampDecorator implements LogSink, writes prefix plus delegate.write. Logger is the facade. None of these require Observer.
If they probe: If they ask Observer on locker, say occupy is a command, not a fan-out, unless they want SMS as a sink. Template versus Strategy: template owns the skeleton; strategy owns the whole algorithm.
RateLimiter). Abstract class = shared fields + partial impl (Post for Q/A).is-a).An interface is a behavior contract, for example Java RateLimiter.allowRequest. An abstract class is shared fields plus a partial implementation, for example Post for Question and Answer. They asked inheritance on Pratyush’s file library; Composite is the honest use. Prefer composition for filters and policies so you get Open/Closed without a brittle is-a. Four pillars in one breath: encapsulation (Locker.occupy hides the code), abstraction (Site API), inheritance (Question and Answer), polymorphism (the policy call). Then write code. A Car has an Engine; do not extend Vehicle for every motor type if behavior is injected. Logger has a sink; do not FileLogger extends ConsoleLogger. Java one class parent, many interfaces. Abstract only when you would copy five lines into every subclass.
Example. Question extends Post is inheritance with shared body and votes. VoteService has a map of votes: composition. RateLimiter is an interface with TokenBucketRateLimiter as the class.
If they probe: If they want both, say interface for the contract, abstract only for shared state. If they asked inheritance, Composite files yes, filter subclasses no.
LinkedHashMap(accessOrder) is the JDK line; they still want splice code.You need arbitrary delete of a node and a recency or playlist order in O(1). A hash map finds the node. Doubly linked list pointers splice it. TreeMap is O(log n) per operation and a clock key is the wrong order statistic: you would still need to find the least-recent by scanning or by a second structure. LinkedHashMap with accessOrder is the JDK one-liner; interviewers still want you to write unlink and insertAfterHead. Playlist search by name is containsKey, O(1) average, not a tree ordered by name unless they asked sorted order. LRU get is map plus splice. LFU adds freq lists, still hash plus DLL, still O(1). Refuse TreeMap for LRU. Capacity eviction is drop tail.prev, not tree first-key unless the key is carefully the recency rank, which it is not if you update timestamps.
Example. Playlist and LRU share the skeleton: map to node, dummy head and tail. LRU also evicts tail.prev when size exceeds cap. TreeMap by lastAccess would be O(log n) and you must remove and reinsert on every get.
If they probe: LinkedHashMap removeEldestEntry is the JDK LRU. They still want pointers. ConcurrentHashMap plus DLL without a lock is a bug.
synchronized across hosts.ConcurrentHashMap without a lock is a bug (playlist/LRU).One monitor on the site, lot, cache, or playlist is enough for Live Code: synchronized methods or a single ReentrantLock around get and put. Production locker assign and distributed rate limit are a database unique constraint or Redis Lua, not synchronized across hosts. A doubly linked list plus ConcurrentHashMap without a lock is a bug, because splice is not atomic with the map. HashMap itself is not thread-safe; iterator fail-fast is not a lock. ConcurrentHashMap helps isolated map operations, not a multi-structure invariant. Elevator tick plus hallCall need the same monitor or a single event loop thread. Prefer one thread and a queue if they want to avoid locks. Do not start a locker design with a distributed lock service.
Example. LRUCache.get and put both synchronized on this. Two gates in a parking lot share one lock on ParkingLot, or shard by floor with one lock per floor if they push scale.
If they probe: If they say ConcurrentHashMap for LRU, explain the DLL race. If they say synchronized across two locker sites, that does not compose; shard and conditional write.
Fail-closed means deny when the limiter or Redis is down: protect origin, payments, checkout, occupy of the last locker. Fail-open means allow: availability for a marketing pixel or a best-effort metric. Pick with the use-case; do not waffle. Elevator DoS defaults closed: ignore extra hails so cars do not thrash. A distributed Rate Limiter that cannot reach Redis should fail-closed on checkout and may fail-open on a public read that is cheap. Count of that Rate Limiter LLD stays 1, OA+3, not UTA. Ylogx 99.9% uptime is availability; still do not claim you shipped the limiter. Circuit-break a kiosk is fail-closed for that kiosk, not for the whole building. Silent drop is worse than 429 plus Retry-After when you are closed.
Example. Payments: if Redis.time fails, return 429. Pixel: if Redis fails, allow and log. Hall-call kiosk over quota: ignore. Last locker cubby: do not double-assign if the conditional write fails.
If they probe: Ask which request is more expensive to serve wrongly. Do not mix this with Login Tracker. Do not invent Job 10454435 asking Redis down.
Java. Full listings: Answer-BIBLE §3. These are the inner loops to type if the clock is dying.
LRU get: map lookup → miss −1 → unlink node → insert after dummy head → return value.
LRU put new + overflow: new node at head; if map.size()>cap drop tail.prev and map.remove.
LFU bump: remove from freq list; if that list empties and minFreq==freq, minFreq++; freq++; insert front of new list.
Playlist O(1): same HashMap+DLL as LRU; search = containsKey; no capacity eviction.
Token bucket allowRequest: refill min(capacity, tokens + dt*rate); if tokens>=1 decrement else deny.
Kahn order: queue indegree 0; emit; decrement neighbors; if emitted ≠ V → cycle. Say “station/parcel classes,” not “LC 210.”
Unix find: Files.walkFileTree + PathPredicate.test; AND-compose; skip failed visits.
Locker dropOff: candidates from free deques ≥ min size → strategy.pick → occupy + 6-char code → map package→locker.
Logger log: if level < min return; format; each sink write. Then extract interfaces and name SOLID.
Arijit unnamed: do not implement a fake product. Draw Client → Service → Store; fill names from their answers.
Searchable prefix: walk Trie by query chars; DFS collect values from that node down.
Dog check-in: if unknown / already active / at capacity → throw; else active.put(id, new Stay(now)).
| Design they named | Honest bridge (one sentence) |
|---|---|
| Logger / sinks | Argus Postgres event log; not a logging framework you published |
| LRU / LFU / cache | Ylogx Redis −35% bot DB latency; cache aside, not LC 146 at work |
| Rate limiter / gateway | Ylogx ALB + 99.9%; seat of a limiter, not a shipped Redis Lua limiter |
| Searchable collection | Stratify 50+ models; GiftedBooks topics — HashMap/Trie in editor |
| Q&A entities | GiftedBooks PDF RAG Q&A (no SO votes); IQVIA BRD retrieval |
| Bookstore word count | Toy indexer vs GiftedBooks RAG — different |
| Locker assignment | Ylogx 3-tier RLS: wrong row = leak; not lockers |
| Parking / dog in-out | Argus attendance in/out of frame |
| Elevator DoS / flood | Argus 20+ cameras at 24 FPS — backpressure |
| File find | Linux + walking frame dirs; not a find(1) product |
| Delivery + topo | Horizon costmap graph; still not LC 210/962 |
| Unnamed SD | Offer Ylogx report store or Argus event log after they refuse to name a domain |
| Playlist / parking lot | No resume product — stay on the IE sketch |
Also on-resume if an LLD turns into “your system”: IQVIA 200+ sites / 200+ page BRDs; Horizon 17th/80+, 60 FPS, ZED 2M+/s, collision −55%; GiftedBooks sub-300 ms / 99.5% / 3–10 min; Stratify iteration −30%.
new_login / get_oldest_login as SDE I R2: I could not verify (mentor only). Closest public: Bhavya LRU; GetRandom O(1) other IEs; Spring login = Bhavya HM; prachub first-unique-login is Oracle.)