PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Meta

Solve library coding tasks in Python

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in Python coding and algorithmic problem-solving, focusing on list and dictionary manipulation, state-sequence validation, and selection/optimization across categories.

  • Medium
  • Meta
  • Coding & Algorithms
  • Data Engineer

Solve library coding tasks in Python

Company: Meta

Role: Data Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Implement the following Python tasks: 1) Given a list of (category, points) for books, choose up to 3 books with all different categories to maximize total points; return the maximum achievable points. 2) Given a dictionary mapping library_location -> list_of_people and a collection of closed locations, return a new dictionary containing only open locations and their associated people. 3) Given an ordered list of log entries (book_id, action) where action is 'checkout' or 'return', validate the sequence: return False if a book is checked out twice in a row without a return, or returned when it is not currently checked out; otherwise return True.

Quick Answer: This question evaluates proficiency in Python coding and algorithmic problem-solving, focusing on list and dictionary manipulation, state-sequence validation, and selection/optimization across categories.

Related Interview Questions

  • Solve Two Backtracking Array Problems - Meta (hard)
  • Solve Array, Matrix, and Recommendation Problems - Meta (medium)
  • Find a String Containing Another - Meta (medium)
  • Solve Subarray Sum and Local Minimum - Meta (hard)
  • Validate abbreviations and brackets - Meta (medium)
Meta logo
Meta
Jul 16, 2025, 12:00 AM
Data Engineer
Technical Screen
Coding & Algorithms
9
0

Implement the following Python tasks:

  1. Given a list of (category, points) for books, choose up to 3 books with all different categories to maximize total points; return the maximum achievable points.
  2. Given a dictionary mapping library_location -> list_of_people and a collection of closed locations, return a new dictionary containing only open locations and their associated people.
  3. Given an ordered list of log entries (book_id, action) where action is 'checkout' or 'return', validate the sequence: return False if a book is checked out twice in a row without a return, or returned when it is not currently checked out; otherwise return True.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Meta•More Data Engineer•Meta Data Engineer•Meta Coding & Algorithms•Data Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.