← Google Interview Insights

Google·Data Scientist·Technical Phone Screen·Senior

SeniorPrefer not to say
May 2026

Summary

Google DS interview with a battery prediction scenario that felt more like a research problem than a typical ML question. The feature engineering follow-up pushed me into territory I wasn't fully prepared for.

Questions Asked (3)

Q1

Write code using linear interpolation to estimate remaining usage time from a phone's current battery percentage.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Straightforward enough on the surface.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem: we need to estimate remaining usage time based on current battery percentage, using linear interpolation between known data points (e.g., battery percentage vs. time). Then, outline the algorithm: collect or assume a set of reference points, sort them, and interpolate to find the time corresponding to the current percentage. Finally, discuss implementation details, assumptions, and potential extensions.

Pro tip: Mention that linear interpolation assumes a constant discharge rate between points, which may not hold in reality; suggest validating with real data or considering piecewise linear interpolation for better accuracy. Also, highlight the importance of handling edge cases like battery percentage outside the known range.

1. Clarify the problem and assumptions

Ask clarifying questions: Is the battery discharge linear? Do we have historical data? What is the desired output format? State assumptions such as known battery percentage at specific times or a known discharge curve.

2. Define the interpolation function

Explain that linear interpolation estimates a value between two known points. For battery percentage p between p1 and p2 (with corresponding times t1 and t2), the estimated time t is t1 + (p - p1) * (t2 - t1) / (p2 - p1).

3. Implement the algorithm

Write code that takes a list of (percentage, time) points, sorts them by percentage, and finds the segment containing the current percentage. Then apply the interpolation formula. Handle edge cases: if percentage is below the lowest or above the highest known point, extrapolate or return an error.

4. Test and validate

Test with sample data, including edge cases. Discuss how to validate the model, e.g., using holdout data or cross-validation. Mention that linear interpolation may not capture non-linear battery behavior.

5. Discuss trade-offs and extensions

Compare linear interpolation with other methods (e.g., polynomial, spline, or machine learning models). Discuss computational complexity, data requirements, and real-world applicability.

Key Points to Mention

  • Linear interpolation formula and its derivation
  • Assumption of linear discharge between data points
  • Handling edge cases (extrapolation, out-of-range values)
  • Time complexity: O(n) for unsorted, O(log n) if sorted and binary search used
  • Alternative methods: piecewise linear, spline, or regression models
  • Real-world factors: battery usage patterns, temperature, app usage

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Beyond battery percentage, what additional features would you engineer to improve prediction accuracy, and why?

Data ModelingProduct Analytics & Metrics
Author's notes

This is where it got interesting.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the prediction task (e.g., battery depletion time, remaining useful life) and the current model's limitations. Then propose additional features across sensor, contextual, and usage-pattern categories, explaining how each would improve accuracy. Finally, discuss validation and potential trade-offs.

Pro tip: Emphasize feature engineering that captures user behavior and environmental context, as these often have higher predictive power than raw sensor data. Also, mention the importance of feature importance analysis to avoid overfitting.

1. Clarify the prediction goal

Restate the prediction task (e.g., time to empty, remaining capacity) and the current baseline using battery percentage. This ensures alignment with the interviewer's intent.

2. Identify feature categories

Brainstorm features from sensor data (voltage, current, temperature), usage patterns (app usage, screen time, background processes), and context (location, network strength, time of day).

3. Explain feature impact

For each proposed feature, describe how it would improve prediction accuracy, e.g., temperature affects battery chemistry, usage patterns indicate load, and context influences power consumption.

4. Address data collection and engineering

Discuss how to collect and preprocess these features (e.g., aggregating usage stats, handling missing data) and potential challenges like privacy or sensor availability.

5. Validate and iterate

Propose methods to evaluate feature importance (e.g., permutation importance, SHAP) and model performance (e.g., cross-validation, A/B testing) to ensure features generalize.

Key Points to Mention

  • Voltage and current curves to capture non-linear battery discharge
  • Temperature and device thermal state as they affect battery efficiency
  • User behavior features: app usage frequency, screen brightness, background sync
  • Contextual features: location (GPS vs. indoor), network type (5G vs. Wi-Fi), time of day
  • Historical usage patterns and charging habits (e.g., time since last charge)
  • Feature importance analysis to avoid overfitting and ensure interpretability

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

If no historical data exists for the specific phone model, how would you build a usable training set using data from other devices?

Data ModelingAdaptability & Ambiguity
Author's notes

Blanked for a second here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the prediction task and the target phone's characteristics, then propose a transfer learning strategy that leverages data from similar devices. Emphasize domain adaptation techniques to bridge the gap between source and target domains, and discuss validation methods to ensure the model generalizes to the new phone model.

Pro tip: Highlight the importance of feature engineering to create device-agnostic representations, and mention that you would validate the approach using a holdout set from a similar device to simulate the target scenario.

1. Define the problem and target characteristics

Clarify the prediction task (e.g., battery life, performance) and identify key attributes of the target phone model (e.g., hardware specs, usage patterns) that can guide data selection.

2. Select and weight source devices

Choose data from devices with similar characteristics to the target, and assign weights based on similarity to create a representative training set.

3. Apply domain adaptation techniques

Use methods like transfer learning, fine-tuning, or adversarial domain adaptation to align feature distributions between source devices and the target phone model.

4. Validate and iterate

Simulate the target scenario by holding out data from a similar device, evaluate model performance, and iterate on feature engineering and adaptation strategies.

Key Points to Mention

  • Transfer learning and fine-tuning
  • Domain adaptation and covariate shift
  • Feature engineering for device-agnostic representations
  • Similarity metrics for source device selection
  • Validation strategy using holdout devices
  • Handling data imbalance and bias

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.