Tag: Data Eng

  • MSD0052 Airbnb Photo Tagging

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0047 Robinhood Trading Fraud Detection

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0044 Drug Discovery System

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0043 Credit Scoring Explainability

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0041 Fitness Pose Estimation

    Design a deep learning model for real-time pose estimation in a fitness app that counts reps, corrects exercise form, and runs on a phone. The app uses the phone’s front camera to track the user’s body keypoints (shoulders, elbows, wrists, hips, knees, ankles) while they perform squats, push-ups, and yoga poses.

    The model must estimate 2D or 3D pose at 30 fps on-device, recognize which exercise is being performed, count repetitions by detecting the movement cycle, and flag form errors such as knees caving inward during a squat or a back rounding during a deadlift. It has to work across body types, clothing, camera angles, and lighting, and latency must stay low enough for real-time audio feedback.

    How would you design this model? Cover the candidate pose estimation architectures (heatmap regression vs direct coordinate regression vs 3D lifting from 2D), the exercise classification and rep counting logic, the form-error detection mechanism, the on-device deployment strategy (quantization, distillation), and how you evaluate pose accuracy and rep-counting reliability.

    Line-art scene: a person mid-squat in front of a propped-up phone, a magnifier over the knees, and the phone screen asking how many reps, whether form is good, and which cue to speak

    The Problem: one lens, no depth, and a 33 ms per frame budget, yet every frame must answer three questions at once: where the joints are, where in the rep cycle the body is, and whether the form is safe.

    Answer

    Run a detector-tracker cascade around a single-person 2D keypoint network whose output head is a coordinate classifier (SimCC-style 1D bins per axis), trained with dense heatmap supervision and distilled from a large teacher. The scale-normalized keypoint sequence then feeds one small temporal head that emits the exercise label, the rep phase, and the form flags. 2D stays the primary signal because monocular depth is ambiguous, and a 27-frame 2D-to-3D lifting head is switched on only for errors that genuinely need depth, such as back rounding or knee valgus seen from an oblique angle. Two decisions carry the design: put the spatial prior in training (heatmaps) while keeping the cheap output at inference (coordinates), and treat rep counting as hysteresis on a phase signal rather than peak-picking on a raw joint angle.

    (1) Heatmap Regression: the backbone emits one H/4 \times W/4 map per joint, and the joint location is the argmax cell plus a learned sub-pixel offset; strong spatial inductive bias, heavy output tensor.
    (2) Direct Coordinate Regression: the head emits 2K numbers directly, or classifies each axis into 1D bins (SimCC); tiny output, no argmax, needs heatmap-style supervision or bin targets during training to localize well.
    (3) 3D Lifting From 2D: a temporal network consumes a window of 2D keypoints and predicts root-relative 3D joints; it recovers depth-dependent form errors but inherits every 2D error and adds window latency.

    Pipeline: camera frames feed a detect-and-track stage, then a 2D keypoint network, an optional 3D lifting head, a keypoint buffer, and three parallel outputs for exercise ID, rep counting, and form checking

    Figure 1: One cheap keypoint pass per frame; everything the product actually says out loud is computed from the buffered keypoint sequence, not from raw pixels.

    Clarify Before Designing:
    (1) Depth Requirement: which form errors are in scope, and can any of them only be judged from depth (back rounding, hip hinge) rather than from an in-plane 2D ratio?
    (2) Compute Budget: what is the target device tier, and how much of the 33 ms frame budget is already spent by camera capture, rendering, and audio?
    (3) Framing Control: is the phone propped up with the whole body in view, or handheld with limbs leaving the frame; can the app force a calibration pose first?
    (4) Exercise Vocabulary: a closed set of 20 named movements, or open-set counting for anything the user does?
    (5) Label Availability: do we have keypoint labels on fitness footage (not just COCO street photos), and do we have per-rep form-error labels from coaches?
    (6) Teacher Access: can we run a large server-side pose model offline to generate pseudo-labels and distillation targets?


    Login to view more content
  • MSD0029 Food Calorie Estimation

    Design a model that estimates the calorie and macronutrient content of a meal from a single photo, as used by apps like MyFitnessPal, Calorie Mama, or Lose It. The user snaps a photo of their plate. The model must identify the dishes, estimate portion sizes from a 2D image with no depth cue, look up or predict per-gram nutritional values, and return a calorie estimate within a few seconds.

    The core technical challenge is portion estimation: a single 2D photo carries no metric depth, so converting pixel area into grams requires a mechanism assumption. The model must also handle a long tail of cuisines and homemade dishes that match no packaged-food database, varying plating and lighting, and the inherent ambiguity of judging a portion from one viewpoint.

    How would you design this model? Cover the candidate portion estimation approaches (monocular depth estimation, reference-object scaling, semantic segmentation with food-class density priors, and direct end-to-end calorie regression), how you handle the long tail of homemade and mixed dishes, how you generate training labels at scale when ground-truth portion weights are scarce, and how you calibrate and communicate uncertainty when a single 2D photo is inherently ambiguous.

    Line-art scene: a phone photographs a plate top-down, and two unseen side views with identical pixel area show a flat serving of about 120 g and a mounded serving of about 380 g, with a question mark between them

    The Problem: the same mask area can be a thin layer or a tall mound, so one photo maps to a wide range of grams before any model has made a single assumption explicit.

    Answer

    The design is a segmentation-conditioned multi-task regressor. One shared backbone emits per-dish instance masks, a relative depth map, and a direct per-region regression of grams, calories, and macronutrients, with the physical volume-times-density estimate retained as a parallel sanity check rather than as the primary predictor. Google’s Nutrition5k study drives that ordering: an end-to-end regressor from a single RGB view reaches roughly 26% mean calorie error, and feeding depth, either as an extra channel or as a depth-derived volume scalar, cuts that error substantially, which is why depth is an auxiliary input to the regressor here rather than the front end of a separate segment-then-volume-then-density-lookup chain. Two decisions are pivotal. First, scale is treated as a learned prior anchored by plate and utensil geometry, not as metric information that a single RGB frame secretly contains. Second, the output is a calibrated interval and an editable suggestion, because one viewpoint leaves real ambiguity that no architecture removes.

    (1) Monocular Depth Volume: predict per-pixel depth, fit the plate plane, and integrate height over each mask to get volume, then multiply by a food-class density. Physically interpretable, but scale-ambiguous.
    (2) Reference-Object Scaling: use a known-size object in frame (bank card, coin, thumb, standard plate rim) to fix millimeters per pixel in the plate plane, which pins down area but not height.
    (3) Segmentation With Density Priors: multiply mask area by a learned per-class height prior and a tabulated density in grams per cubic centimeter from food-composition data. Cheapest to build and to explain.
    (4) Direct End-to-End Regression: regress grams, kilocalories, and macros straight from region features, letting the network learn scale from plate, cutlery, and hand context. Most accurate where labels exist, least interpretable.

    Mechanism diagram: one photo enters a shared backbone that feeds an instance segmentation head, a metric depth head, and a per-region regression head; segmentation and depth feed a physical volume-times-density check, which is fused with the regression output through a conformal interval step into calories, macros, and a range

    Figure 1: The mechanism: photo → masks and depth → grams per dish, with the physical volume path acting as a guardrail on the learned regressor and a conformal step turning the point estimate into a range.

    Clarify Before Designing:
    (1) Label Ground Truth: do we have any scale-weighed dishes with per-ingredient masses, or only crowd labels and user-entered corrections?
    (2) Capture Protocol: is it strictly one top-down snap, or may we request an oblique angle, a second frame, or a reference object without destroying adoption?
    (3) Depth Sensors: what fraction of devices expose LiDAR or ARKit/ARCore depth, which turns scale from a guess into a measurement?
    (4) Accuracy Bar: what calorie error is product-acceptable, and does the UX accept a range plus an edit control instead of one number?
    (5) Coverage And Budget: which cuisines dominate traffic, what share of meals is packaged or restaurant food with known nutrition, and is inference on-device or server-side?


    Login to view more content
  • MSD0028 Deepfake AIGC Detection

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0027 Fake Account Bot Detection

    Design a system to detect fake accounts and bots on a social network like Facebook, Twitter/X, or Instagram. Fake accounts power spam, coordinated inauthentic behavior, follower farming, and political manipulation, and their operators evolve constantly: they buy aged accounts with real history, use LLMs to write bios and mimic human posting cadence, and route traffic through residential proxies so IP reputation says nothing.

    The system must score accounts at creation time and keep re-evaluating them as behavior develops, while holding the false-positive rate low enough that real users are not wrongly suspended, and routing the highest-risk cases to human investigators.

    How would you design this system? Cover the account-level feature signals (registration, graph, content, behavior), the detection model architecture, how you handle adversarial evolution, the human-in-the-loop review queue, and how you measure precision and recall when ground truth is scarce.

    Line-art scene: a device farm of phones behind a proxy feeds a stack of new account cards into a social network, with a real person in the same batch and a question mark asking who is fake

    The Problem: millions of new accounts a day, a farm that can forge everything cheap to forge, and one real person sitting in the same batch. Decide who to trust without suspending them.

    Answer

    Treat this as two coupled problems running at two speeds. At signup, a low-latency gradient-boosted scorer over registration, device, and infrastructure features decides whether the account starts with friction, and a continuous re-scoring layer then re-judges every live account as its graph and behavior accumulate. That second layer is where the real detections happen: a relational GNN over the follow and friend graph plus unsupervised synchrony clustering (the SynchroTrap idea of co-clustering accounts that act on the same targets in the same time buckets) catches campaigns whose individual members each look perfectly human. Scores never map directly to bans. They map to a graduated enforcement ladder (allow, challenge, limit reach, human review, disable) so the expensive mistake, suspending a real user, requires either overwhelming cluster-level evidence or an investigator.

    (1) Two-Speed Detection: a synchronous per-signup scorer under a 200 ms budget, plus a daily (and event-triggered) batch pass over every active account, since most fake accounts only reveal themselves after they start acting.
    (2) Cluster-Level Evidence: the decision unit is the account and the campaign; graph plus action-synchrony clustering finds coordinated groups without needing labels for the new tactic.
    (3) Cost-To-Forge Feature Weighting: prefer signals an operator must pay real money or real time to fake (device integrity, aged organic graph, human-only interaction telemetry) over signals a proxy or an LLM erases for free.
    (4) Graduated Enforcement: friction first (phone or CAPTCHA challenge, reach limiting), auto-disable only in the top band with corroboration, always with an appeal path that feeds labels back.
    (5) Label Machinery: reviewer verdicts, appeal reversals, honeypot and test-buy cohorts, and a random-audit stream, because production has no clean ground truth and the flagged sample alone teaches the model its own blind spots.

    Pipeline: signup and live accounts feed a feature store, which serves a fast GBDT scorer and a daily graph and synchrony pass; a policy engine maps scores to allow, challenge or limit, or a human review queue, whose verdicts flow to a label store and weekly retraining

    Figure 1: Two speeds, one policy: a synchronous scorer at signup, a daily graph and synchrony pass over every live account, and a ladder whose top band ends at a human, not a model.

    Clarify Before Designing:
    (1) Scale And Prevalence: how many signups per day, how many active accounts to re-score, and what does the current prevalence estimate say (a few percent of MAU)?
    (2) False-Positive Budget: how many wrongly restricted real users per day is the product willing to accept, and is auto-suspension allowed at all under the platform’s appeal and regulatory commitments?
    (3) Enforcement Surface: can we impose signup friction (phone verification, CAPTCHA), or does growth own that decision and force us to detect after the fact?
    (4) Review Capacity: how many investigator-hours per day exist, in which languages and regions, and what is the target queue latency for high-harm cases?
    (5) Threat Priority: which abuse type pays first, follower farms, spam, or coordinated political campaigns, since they differ in scale, sophistication, and tolerance for delay?
    (6) Signal Access: what device, telemetry, and payment signals are legally usable per region, and how long may we retain them?


    Login to view more content
  • MSD0022 Model Drift Dashboard

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0021 Hashtag Video Relevance

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.