实例介绍
TripAdvisor常考面经总结 TripAdvisor Coding Practice List
Constaints: 1. No duplicate returning value 2. getRandom( will at most be invoked 100 million times Then optimize for space 47. Implement LRU algorithm; Write code to implement a general Binary Search Tree 48. Write a routine to print the numbers 1 to 100 and back to 1 again without using any loops 49. coding up a binary search tree and implementing an insert and findSum atlevelint n)routine 50. Given a tree of world regions locations and specific destinations and attractions find the most efficient ways to determine the common parent of two arbitrary nodes in terms of space and time 51. Write a web crawler to count number of pages in a website 52. count the number of duplicates in a binary tree in o(n) time o() space 53. Find the next larger node of a node in a binary search tree 54. Describe a hashtable and what's the time complexity for searching for a particular element 55. Write an algorithm for finding all pairs in a set of integers that add to a given target sum 56. Given two stacks, how can you implement a queue? What are the costs of push and pop operations? 57. How would you implement a bit vector data structure? Optimizing for memory 58. How would you implement a binary Search Tree? 59. What are the properties of a good hash? 60. Given two strings; boston and obtons how can you determine that they and any other set of strings, are anagrams of each other try and make it as efficient as possible 61. Other than an array what data structure has o(1) insertion and o(1 search? 62. How can you tell efficiently how many consecutive zero s are in a number without looping through its digits? 63. 64 Implement String Builder in Java 65. The most difficult question was when the interviewer asked that if we sum up the elements in the nodes by first visiting the left subtree, then the middle, and then the right what kind of traversal is this? 66. Check if one binary tree is the subtree of another 67 68. He gave me a set of nodes and asked me to search for a given node. Note: Consider the nodes are in a binary tree 69. how to get the middle index in an array list 70. Given a dictionary of words and a 4x 4 boggle board see which dictionary words you can make 71. Given a binary search tree, set up a variable in each node that points to its right neighbor 72. 73. Identify the best alert Given an alert find the closest area that the alert must be sent to Had some Java code in front and had to complete it 74. the first interviewer described to me a system that he called h-score h-score is a score that publishers get if articles that they publish get citations in other articles. a publisher gets h-score of x if they wrote at least x articles that got x citations each given an array with the number of citations per article write a function to calculate the h-score for the publisher. 75. Finding the depth of any arbitrary node in a binary tree 76.2sum 77. find if two linked lists join each others or not and if yes where is the intersection point 78 What's the difference for and foreach. He expect me to say: if I use LinkedList a, use for and a get(index) would take o(n 2 time complexity 79. Write a function that raises a number to an exponent in c or Java 80. Check if a tree is symmetric. 81. If you can do unlimited pre-processing, how would you find the lowest common ancestor of any two nodes in a tree, in o(1) time? 【实例截图】
【核心代码】
标签:
相关软件
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论