Closest Land Mark π
Updated
Problem statement
Imagine you're on a journey along the path of numbers, starting from your current location marked by an integer N. Your goal is to find the nearest landmark, which happens to be a Fibonacci number. But before you can reach it, you must determine the distance you need to travel to get there. Your task is to calculate this distance and return it as another integer.
Function
closestLandMark(aNum: int) β int
Complete the function closestLandMark in the editor π.
closestLandMark has the following parameter:
int aNum: an integer number
Returns
int: the distance to the closest "land mark".
Examples
Example 1
aNum = 25return = 4No explanation provided for now. Will add once find it :)
Example 2
aNum = 5return = 0No explanation provided for now. Will add once find it :)
Constraints
0 β€ N β€ 1,000,000
More Meta interview questions
- Convert a Sorted Linked List to a Balanced BSTPHONE SCREEN Β· Seen Nov 2026
- Fuzzy Word Lookup With One Misspelled LetterPHONE SCREEN Β· Seen Nov 2026
- Multi-Head Attention Forward PassPHONE SCREEN Β· ONSITE INTERVIEW Β· Seen Nov 2026
- Run-Length Encoded Vector Dot ProductPHONE SCREEN Β· ONSITE INTERVIEW Β· Seen Nov 2026
- Mutual-Friend RecommendationsPHONE SCREEN Β· ONSITE INTERVIEW Β· Seen Nov 2026
- Best Time to Buy and Sell StockPHONE SCREEN Β· Seen Nov 2026
- First Element Greater Than KPHONE SCREEN Β· Seen Nov 2026
- Bank Accounts with Balance HistoryOA Β· Seen Nov 2026
- Count Events in Rolling Minute WindowsPHONE SCREEN Β· Seen Oct 2026
- Valid Word AbbreviationPHONE SCREEN Β· Seen Oct 2026
Similar questions at other companies
- Last Digit of the Ways to Split Traders Between Two OfficesAkuna Capital Β· OAAkuna Capital interview questions
- Counting Cows by Their LegsSusquehanna International Group (SIG) Β· OASusquehanna International Group (SIG) interview questions
- Summarize Taxi Drivers and RidesBoston Consulting Group Β· OABoston Consulting Group interview questions
- Total Cost Against the Lowest Earlier PricePayPal Β· OAPayPal interview questions
- Count Valid Square PairsAuxoAI Β· OA
- Server InvestmentRippling Β· OARippling interview questions
- Basic Item DiscountsPalantir Β· OAPalantir interview questions
- Identification Number Check DigitAbridge Β· OAAbridge interview questions
- Count Substrings With Identical CharactersVirtu Financial Β· OAVirtu Financial interview questions
- Next Pascal Row CoefficientIntuit Β· OAIntuit interview questions
Meta interview experiences
- Meta PhD SWE Intern AI Coding Phone Screen: 1 Experience
- Meta Business Support Engineer Phone Screen: 1 Experience
- Meta Software Engineer Onsite Questions: 3 Experiences
- Meta AI Native Engineer OA and Onsite: 1 Experience
- Meta AI-Native Coding Interview: 3 Experiences
- Meta Production Engineer Intern Questions: 6 Experiences